本文整理汇总了PHP中Gpf_Settings类的典型用法代码示例。如果您正苦于以下问题:PHP Gpf_Settings类的具体用法?PHP Gpf_Settings怎么用?PHP Gpf_Settings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Gpf_Settings类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: readRequestVariables
public function readRequestVariables() {
$input = $this->readXmlData();
$this->debug("Input get: ".$input);
try {
$xml = new SimpleXMLElement($input);
} catch (Exception $e) {
$this->setPaymentStatus("Failed");
$this->debug('Wrong XML format.');
$this->outputError();
return;
}
// assign posted variables to local variables
$customField = 'custom_field_'.Gpf_Settings::get(UltraCart_Config::CUSTOM_FIELD_NUMBER);
$this->debug("Custom field number: ".Gpf_Settings::get(UltraCart_Config::CUSTOM_FIELD_NUMBER));
$cookieValue = (string)$xml->order->$customField;
$this->setCookie($cookieValue);
$this->setTotalCost($this->computeTotalCost($xml));
$this->setEmail((string)$xml->order->email);
$this->setTransactionID((string)$xml->order->order_id);
$this->setProductID((string)$xml->order->item->item_id);
$this->setPaymentStatus((string)$xml->order->payment_status);
$this->outputSuccess();
}
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:28,代码来源:Tracker.class.php
示例2: executeCurl
protected function executeCurl($xmlRequest, $headers) {
$url = '';
if (!$this->containsProtocol(Gpf_Settings::get(BusinessCatalyst_Config::BC_DOMAIN_NAME))) {
$url = 'http://';
}
$url .= Gpf_Settings::get(BusinessCatalyst_Config::BC_DOMAIN_NAME);
if (!$this->endsWithSlash($url)) {
$url .= '/';
}
$url .= 'catalystwebservice/catalystcrmwebservice.asmx';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlRequest);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER ,1);
$response = curl_exec($ch);
if ($response === false) {
Pap_Contexts_Action::getContextInstance()->debug('Error in communication with bc: ' . curl_error($ch));
throw new Gpf_Exception(curl_error($ch));
}
return $response;
}
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:27,代码来源:Retrieve.class.php
示例3: load
/**
* @anonym
* @service custom_separator read
* @param Gpf_Rpc_Params $params
* @return Gpf_Rpc_Form
*/
public function load(Gpf_Rpc_Params $params) {
$form = new Gpf_Rpc_Form($params);
$form->addField(self::PROCESS_WHOLE_CART_AS_ONE_TRANSACTION, Gpf_Settings::get(self::PROCESS_WHOLE_CART_AS_ONE_TRANSACTION));
$form->addField(self::MERCHANT_ID, Gpf_Settings::get(self::MERCHANT_ID));
$form->addField(self::API_SIGNATURE, Gpf_Settings::get(self::API_SIGNATURE));
return $form;
}
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:13,代码来源:Config.class.php
示例4: validate
/**
* Validate Db_Row
*
* @param Gpf_DbEngine_Row $row
* @throws Gpf_DbEngine_Row_ConstraintException
*/
public function validate(Gpf_DbEngine_Row $row)
{
if (Gpf_Settings::get(Gpf_Settings_Gpf::PASSWORD_MIN_LENGTH) > Gpf_Settings::get(Gpf_Settings_Gpf::PASSWORD_MAX_LENGTH)) {
return;
}
if (strlen($row->get($this->passwordField)) < Gpf_Settings::get(Gpf_Settings_Gpf::PASSWORD_MIN_LENGTH)) {
throw new Gpf_DbEngine_Row_PasswordConstraintException($this->passwordField, $this->_('Minimum length of password is %s characters', Gpf_Settings::get(Gpf_Settings_Gpf::PASSWORD_MIN_LENGTH)));
}
if (strlen($row->get($this->passwordField)) > Gpf_Settings::get(Gpf_Settings_Gpf::PASSWORD_MAX_LENGTH)) {
throw new Gpf_DbEngine_Row_PasswordConstraintException($this->passwordField, $this->_('Maximum length of password is %s characters', Gpf_Settings::get(Gpf_Settings_Gpf::PASSWORD_MAX_LENGTH)));
}
if (Gpf_Settings::get(Gpf_Settings_Gpf::PASSWORD_LETTERS) == Gpf::YES) {
if (preg_match('/[a-zA-Z]/', $row->get($this->passwordField)) == 0) {
throw new Gpf_DbEngine_Row_PasswordConstraintException($this->passwordField, $this->_('Password has to contain at least one letter (a-z, A-Z)'));
}
}
if (Gpf_Settings::get(Gpf_Settings_Gpf::PASSWORD_DIGITS) == Gpf::YES) {
if (preg_match('/[0-9]/', $row->get($this->passwordField)) == 0) {
throw new Gpf_DbEngine_Row_PasswordConstraintException($this->passwordField, $this->_('Password has to contain at least one digit (0-9)'));
}
}
if (Gpf_Settings::get(Gpf_Settings_Gpf::PASSWORD_SPECIAL) == Gpf::YES) {
if (preg_match('/[' . preg_quote(Gpf_Common_String::SPECIAL_CHARS) . ']/', $row->get($this->passwordField)) == 0) {
throw new Gpf_DbEngine_Row_PasswordConstraintException($this->passwordField, $this->_('Password has to contain at least one special character (%s)', Gpf_Common_String::SPECIAL_CHARS));
}
}
}
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:33,代码来源:PasswordConstraint.class.php
示例5: __construct
public function __construct()
{
$this->username = Gpf_Settings::get(Gpf_Settings_Gpf::FTP_USERNAME);
$this->password = Gpf_Settings::get(Gpf_Settings_Gpf::FTP_PASSWORD);
$this->hostname = Gpf_Settings::get(Gpf_Settings_Gpf::FTP_HOSTNAME);
$this->directory = Gpf_Settings::get(Gpf_Settings_Gpf::FTP_DIRECTORY);
}
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:7,代码来源:Ftp.class.php
示例6: report
/**
* @service report_problem write
*
* @param Gpf_Rpc_Params $params
* @return Gpf_Rpc_Form
*/
public function report(Gpf_Rpc_Params $params) {
$form = new Gpf_Rpc_Form($params);
$subject = 'PAP4: '.$form->getFieldValue('subject');
$message = 'License: '.$form->getFieldValue('licenseId').'<br>'.
'Product: <b>'.Gpf_Settings::get(Pap_Settings::BRANDING_TEXT_POST_AFFILIATE_PRO).' '.Gpf_Settings::get(Gpf_Settings_Gpf::VARIATION).'</b><br>'.
'Version: <b>'.Gpf_Application::getInstance()->getVersion().'</b><br>'.
'Url: <a href="'.Gpf_Paths::getInstance()->getFullBaseServerUrl().'">'.Gpf_Paths::getInstance()->getFullBaseServerUrl().'</a><br>'.
'-------------------------------------------------------------------------------<br>'.
$form->getFieldValue('message');
$mail = new Gpf_Db_Mail();
$mail->setSubject($subject);
$mail->setHtmlBody($message);
$mail->setFromMail($form->getFieldValue('email'));
$mail->setRecipients("[email protected]");
try {
$mail->insert();
$mail->scheduleNow(true);
$form->setInfoMessage($this->_("Email sent"));
} catch (Exception $e) {
$form->setErrorMessage($this->_("Error while sending mail"));
}
return $form;
}
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:33,代码来源:ReportProblem.class.php
示例7: getDatabase
/**
* @return Gpf_DbEngine_Database
*/
public static function getDatabase()
{
if (self::$database === null) {
self::create(Gpf_Settings::get(Gpf_Settings_Gpf::DB_HOSTNAME), Gpf_Settings::get(Gpf_Settings_Gpf::DB_USERNAME), Gpf_Settings::get(Gpf_Settings_Gpf::DB_PASSWORD), Gpf_Settings::get(Gpf_Settings_Gpf::DB_DATABASE));
}
return self::$database;
}
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:10,代码来源:Database.class.php
示例8: normalizePassword
/**
* Add minimum one character into password from string includeCharacters
* if it doesn't contain already such character
*
* @param $settingName
* @param $includeCharacters
* @param $password
* @return unknown_type
*/
private static function normalizePassword($settingName, $includeCharacters, $password)
{
if (Gpf_Settings::get($settingName) == Gpf::YES && !preg_match('/[' . preg_quote($includeCharacters) . ']/', $password)) {
$password[rand(0, strlen($password) - 1)] = $includeCharacters[rand(0, strlen($includeCharacters) - 1)];
}
return $password;
}
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:16,代码来源:String.class.php
示例9: getValidityInSeconds
private function getValidityInSeconds() {
$validity = Gpf_Settings::get(Pap_Settings::IP_VALIDITY_SETTING_NAME);
if($validity == '' || $validity == '0' || !is_numeric($validity)) {
throw new Gpf_Exception(" IP address validity period is not correct: '$validity'");
}
$validityPeriod = Gpf_Settings::get(Pap_Settings::IP_VALIDITY_FORMAT_SETTING_NAME);
if(!in_array($validityPeriod, array(Pap_Merchants_Config_TrackingForm::VALIDITY_DAYS,
Pap_Merchants_Config_TrackingForm::VALIDITY_HOURS,
Pap_Merchants_Config_TrackingForm::VALIDITY_MINUTES))) {
throw new Gpf_Exception(" IP address validity period is not correct: '$validityPeriod'");
}
switch($validityPeriod) {
case Pap_Merchants_Config_TrackingForm::VALIDITY_DAYS:
return $validity * 86400;
case Pap_Merchants_Config_TrackingForm::VALIDITY_HOURS:
return $validity * 3600;
case Pap_Merchants_Config_TrackingForm::VALIDITY_MINUTES:
return $validity * 60;
default: return 0;
}
}
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:25,代码来源:RecognizeVisitorAffiliateFromIp.class.php
示例10: loadItems
protected function loadItems($userId) {
$maxTiers = Gpf_Settings::get(Pap_Settings::TIERS_VISIBLE_TO_AFFILIATE);
if ($maxTiers == -1) {
return parent::loadItems($userId);
}
$currentUserId = Gpf_Session::getAuthUser()->getPapUserId();
$numberOfTiers = -1;
if($userId != '') {
try {
$numberOfTiers = $this->getNumberOfTiersToAncestor($userId, $currentUserId);
} catch (Gpf_Exception $e) {
}
}
if ($userId == '' && $maxTiers == 0) {
return new Gpf_Data_RecordSet();
}
if ($numberOfTiers >= $maxTiers-2) {
$lastTier = true;
} else {
$lastTier = false;
}
return parent::loadItems($userId, $lastTier);
}
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:27,代码来源:SubAffiliatesTree.class.php
示例11: updateCompressedCommissionsTask
private function updateCompressedCommissionsTask($recurrencePreset) {
if (Gpf_Settings::get(Pap_Features_CompressedCommissionPlacementModel_Definition::PROCESSING_ENABLED) == Gpf::YES) {
$this->insertCompressedCommissionsTask($recurrencePreset);
} else {
$this->removeCompressedCommissionsTask();
}
}
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:7,代码来源:CompressedCommissionsSettingsForm.class.php
示例12: save
/**
* @service cronjob write
* @param $fields
*/
public function save(Gpf_Rpc_Params $params) {
$form = new Gpf_Rpc_Form($params);
Gpf_Settings::set(Gpf_Settings_Gpf::CRON_RUN_INTERVAL, $form->getFieldValue(Gpf_Settings_Gpf::CRON_RUN_INTERVAL));
$form->setInfoMessage($this->_("Cron runtime saved"));
return $form;
}
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:11,代码来源:CronJobIntegration.class.php
示例13: addCommission
public function addCommission(Pap_Contexts_Signup $signupContext) {
if (($user = $signupContext->getUserObject()) == null) {
return;
}
$campaignId = Gpf_Settings::get(SignupActionCommissions_Config::AFTER_SIGNUP_ACTION_CAMPAIGNID);
$actionCode = Gpf_Settings::get(SignupActionCommissions_Config::AFTER_SIGNUP_ACTION_CODE);
if ($actionCode == '') {
Gpf_Log::error('SignupActionCommissions plugin: No Action code set');
return;
}
$saleTracker = new Pap_Tracking_ActionTracker();
$action = $saleTracker->createAction($actionCode);
$action->setAffiliateID($user->getId());
$action->setStatus($user->getStatus());
$action->setOrderId(SignupActionCommissions_Config::DEFAULT_ORDER_ID);
if ($campaignId != '') {
$action->setCampaignID($campaignId);
}
try {
$saleTracker->register();
} catch (Gpf_Exception $e) {
Gpf_Log::error('SignupActionCommissions plugin: '.$e->getMessage());
}
}
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:29,代码来源:Main.class.php
示例14: checkMultipleSignupsFromSameIp
/**
* checks for duplicate signups from same IP
*
* @return boolean
*/
private function checkMultipleSignupsFromSameIp(Pap_Signup_SignupFormContext $context) {
$checkIt = Gpf_Settings::get(Pap_Settings::REPEATING_SIGNUPS_SETTING_NAME);
if($checkIt != Gpf::YES) {
return true;
}
$checkPeriod = Gpf_Settings::get(Pap_Settings::REPEATING_SIGNUPS_SECONDS_SETTING_NAME);
$checkAction = Gpf_Settings::get(Pap_Settings::REPEATING_SIGNUPS_ACTION_SETTING_NAME);
if($checkPeriod == '' || $checkPeriod == '0' || !is_numeric($checkPeriod)) {
return true;
}
if($checkAction != self::ACTION_DECLINE && $checkAction != self::ACTION_DONTSAVE) {
return true;
}
$userObject = new Pap_Common_User();
$recordsCount = $userObject->getNumberOfUsersFromSameIP($context->getIp(), $checkPeriod);
if(($recordsCount > 0) && ($checkAction == self::ACTION_DONTSAVE)) {
$context->getForm()->setErrorMessage($this->_("Not saved by fraud protection"));
$context->setAllowSave(false);
return false;
} else if (($recordsCount > 0) && ($checkAction == self::ACTION_DECLINE)) {
$context->getRow()->setStatus(Gpf_Db_User::DECLINED);
}
return true;
}
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:32,代码来源:FraudProtection.class.php
示例15: loadSettingsEmailNotifications
public function loadSettingsEmailNotifications(Gpf_Rpc_Form $form) {
$form->setField(Pap_Features_SplitCommissions_Definition::NOTIFICATION_ON_SALE_SUMMARY,
Gpf_Settings::get(Pap_Features_SplitCommissions_Definition::NOTIFICATION_ON_SALE_SUMMARY));
$form->setField(Pap_Features_SplitCommissions_Definition::NOTIFICATION_ON_SALE_SUMMARY_STATUS,
Gpf_Settings::get(Pap_Features_SplitCommissions_Definition::NOTIFICATION_ON_SALE_SUMMARY_STATUS));
}
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:7,代码来源:Config.class.php
示例16: save
/**
* @service tracking_mod_rewrite write
* @param $fields
*/
public function save(Gpf_Rpc_Params $params) {
$form = new Gpf_Rpc_Form($params);
$prefix = $form->getFieldValue(Pap_Settings::MOD_REWRITE_PREFIX_SETTING_NAME);
$separator = $form->getFieldValue(Pap_Settings::MOD_REWRITE_SEPARATOR_SETTING_NAME);
$suffix = $form->getFieldValue(Pap_Settings::MOD_REWRITE_SUFIX_SETTING_NAME);
$htaccessCode = $this->generateHtaccessCode($prefix, $separator, $suffix);
if($separator == '') {
$form->setErrorMessage("Separator cannot be empty!");
return $form;
}
Gpf_Settings::set(Pap_Settings::MOD_REWRITE_PREFIX_SETTING_NAME, $prefix);
Gpf_Settings::set(Pap_Settings::MOD_REWRITE_SEPARATOR_SETTING_NAME, $separator);
Gpf_Settings::set(Pap_Settings::MOD_REWRITE_SUFIX_SETTING_NAME, $suffix);
$form->setField("htaccess_code", $htaccessCode);
$form->setInfoMessage($this->_("Changes saved"));
Pap_Db_Table_CachedBanners::clearCachedBanners();
return $form;
}
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:29,代码来源:ModRewriteForm.class.php
示例17: getTables
/**
*
* @return Gpf_SqlBuilder_SelectBuilder
*/
private function getTables() {
$select = new Gpf_SqlBuilder_SelectBuilder();
$select->select->add('TABLE_NAME', 'name');
$select->from->add("INFORMATION_SCHEMA.TABLES");
$select->where->add("TABLE_SCHEMA", "=", Gpf_Settings::get(Gpf_Settings_Gpf::DB_DATABASE));
return $select;
}
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:11,代码来源:RepairTablesTask.class.php
示例18: process
public function process(Pap_Common_TransactionCompoundContext $context) {
$transaction = $context->getTransaction();
$context->getContext()->debug("SubaffiliateFirstSaleBonus started");
if($transaction->getTier() != 2) {
$context->getContext()->debug("SubaffiliateFirstSaleBonus ended - Not 2. tier");
return;
}
$row = $this->getChildAffiliateInfo($transaction);
$date = new Gpf_DateTime(time());
$date->addDay(-Gpf_Settings::get(SubaffiliateFirstSaleBonus_Config::VALIDITY_DAYS));
if(Gpf_Common_DateUtils::getDateTime($date->toTimeStamp()) > $row->get(Pap_Db_Table_Users::DATEINSERTED)) {
$context->getContext()->debug("SubaffiliateFirstSaleBonus ended - Date Inserted is older than defined days.");
return;
}
if($this->getChildAffiliateTransactionsCount($row->get(Pap_Db_Table_Transactions::USER_ID)) > 1) {
$context->getContext()->debug("SubaffiliateFirstSaleBonus ended - Not user's first transaction.");
return;
}
if(Gpf_Settings::get(SubaffiliateFirstSaleBonus_Config::BONUS_TYPE) == '%') {
$transaction->setCommission($transaction->getCommission()+(Gpf_Settings::get(SubaffiliateFirstSaleBonus_Config::BONUS_AMOUNT)/100)*$transaction->getTotalCost());
} else{
$transaction->setCommission(Gpf_Settings::get(SubaffiliateFirstSaleBonus_Config::BONUS_AMOUNT)+$transaction->getCommission());
}
$context->getContext()->debug("SubaffiliateFirstSaleBonus ended - Success.");
return;
}
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:32,代码来源:Main.class.php
示例19: save
/**
* @service fraud_protection write
* @param $fields
*/
public function save(Gpf_Rpc_Params $params) {
$form = new Gpf_Rpc_Form($params);
Gpf_Settings::set(Pap_Settings::BANNEDIPS_LIST_SIGNUPS,
$form->getFieldValue(Pap_Settings::BANNEDIPS_LIST_SIGNUPS));
Gpf_Settings::set(Pap_Settings::BANNEDIPS_SIGNUPS,
$form->getFieldValue(Pap_Settings::BANNEDIPS_SIGNUPS));
Gpf_Settings::set(Pap_Settings::BANNEDIPS_SIGNUPS_ACTION,
$form->getFieldValue(Pap_Settings::BANNEDIPS_SIGNUPS_ACTION));
Gpf_Settings::set(Pap_Settings::REPEATING_SIGNUPS_SETTING_NAME,
$form->getFieldValue(Pap_Settings::REPEATING_SIGNUPS_SETTING_NAME));
Gpf_Settings::set(Pap_Settings::REPEATING_SIGNUPS_SECONDS_SETTING_NAME,
$form->getFieldValue(Pap_Settings::REPEATING_SIGNUPS_SECONDS_SETTING_NAME));
Gpf_Settings::set(Pap_Settings::REPEATING_SIGNUPS_ACTION_SETTING_NAME,
$form->getFieldValue(Pap_Settings::REPEATING_SIGNUPS_ACTION_SETTING_NAME));
Gpf_Plugins_Engine::extensionPoint('FraudProtectionSignupsForm.save', $form);
$form->setInfoMessage($this->_("Fraud protections saved"));
return $form;
}
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:30,代码来源:FraudprotectionSignupsForm.class.php
示例20: deleteLoginshistory
private function deleteLoginshistory()
{
$delete = new Gpf_SqlBuilder_DeleteBuilder();
$delete->from->add(Gpf_Db_Table_LoginsHistory::getName());
$delete->where->add(Gpf_Db_Table_LoginsHistory::LAST_REQUEST, '<', $this->getLastDate(Gpf_Settings::get(Gpf_Settings_Gpf::AUTO_DELETE_LOGINSHISTORY))->toDateTime());
$delete->limit->set('', Gpf_Log_DeleteTaskBase::DELETE_LIMIT);
return $delete->delete();
}
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:8,代码来源:DeleteLoginsHistoryTask.class.php
注:本文中的Gpf_Settings类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论