本文整理汇总了PHP中CRM_Core_Config::addTrailingSlash方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_Config::addTrailingSlash方法的具体用法?PHP CRM_Core_Config::addTrailingSlash怎么用?PHP CRM_Core_Config::addTrailingSlash使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_Config
的用法示例。
在下文中一共展示了CRM_Core_Config::addTrailingSlash方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
/**
* Function to add additional config paramters to the core Config class
* if CiviContribute is enabled
*
* Note that this config class prevent code bloat in the Core Config class,
* however we declare all the variables assigned here, more for documentation
* than anything else, at some point, we'll figure out how to extend a class
* and properties dynamically in PHP (like Ruby)
*
* @param CRM_Core_Config (reference ) the system config object
*
* @return void
* @static
* @access public
*/
function add(&$config)
{
$config->paymentProcessor = null;
$config->paymentClass = null;
$config->paymentBillingMode = null;
$config->paymentCertPath = null;
$config->paymentKey = null;
$config->paymentPassword = null;
$config->paymentProcessorButton = "https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif";
$config->paymentPayPalExpressUrl = "www.paypal.com";
$config->paymentPayPalExpressTestUrl = "www.sandbox.paypal.com";
if (defined('CIVICRM_CONTRIBUTE_PAYMENT_PROCESSOR')) {
require_once 'CRM/Contribute/Payment.php';
$config->paymentProcessor = CIVICRM_CONTRIBUTE_PAYMENT_PROCESSOR;
switch ($config->paymentProcessor) {
case 'PayPal':
$config->paymentClass = 'CRM_Contribute_Payment_PayPal';
$config->paymentExpressButton = CIVICRM_CONTRIBUTE_PAYMENT_EXPRESS_BUTTON;
$config->paymentPayPalExpressUrl = CIVICRM_CONTRIBUTE_PAYMENT_PAYPAL_EXPRESS_URL;
$config->paymentPayPalExpressTestUrl = CIVICRM_CONTRIBUTE_PAYMENT_PAYPAL_EXPRESS_TEST_URL;
$config->paymentBillingMode = CRM_CONTRIBUTE_PAYMENT_BILLING_MODE_FORM | CRM_CONTRIBUTE_PAYMENT_BILLING_MODE_BUTTON;
break;
case 'PayPal_Express':
$config->paymentClass = 'CRM_Contribute_Payment_PayPal';
$config->paymentBillingMode = CRM_CONTRIBUTE_PAYMENT_BILLING_MODE_BUTTON;
$config->paymentExpressButton = CIVICRM_CONTRIBUTE_PAYMENT_EXPRESS_BUTTON;
$config->paymentPayPalExpressUrl = CIVICRM_CONTRIBUTE_PAYMENT_PAYPAL_EXPRESS_URL;
$config->paymentPayPalExpressTestUrl = CIVICRM_CONTRIBUTE_PAYMENT_PAYPAL_EXPRESS_TEST_URL;
break;
case 'Moneris':
$config->paymentClass = 'CRM_Contribute_Payment_Moneris';
$config->paymentBillingMode = CRM_CONTRIBUTE_PAYMENT_BILLING_MODE_FORM;
break;
}
}
if (defined('CIVICRM_CONTRIBUTE_PAYMENT_CERT_PATH')) {
$config->paymentCertPath['live'] = CRM_Core_Config::addTrailingSlash(CIVICRM_CONTRIBUTE_PAYMENT_CERT_PATH);
}
if (defined('CIVICRM_CONTRIBUTE_PAYMENT_TEST_CERT_PATH')) {
$config->paymentCertPath['test'] = CRM_Core_Config::addTrailingSlash(CIVICRM_CONTRIBUTE_PAYMENT_TEST_CERT_PATH);
}
if (defined('CIVICRM_CONTRIBUTE_PAYMENT_KEY')) {
$config->paymentKey['live'] = CIVICRM_CONTRIBUTE_PAYMENT_KEY;
}
if (defined('CIVICRM_CONTRIBUTE_PAYMENT_TEST_KEY')) {
$config->paymentKey['test'] = CIVICRM_CONTRIBUTE_PAYMENT_TEST_KEY;
}
if (defined('CIVICRM_CONTRIBUTE_PAYMENT_PASSWORD')) {
$config->paymentPassword['live'] = CIVICRM_CONTRIBUTE_PAYMENT_PASSWORD;
}
if (defined('CIVICRM_CONTRIBUTE_PAYMENT_TEST_PASSWORD')) {
$config->paymentPassword['test'] = CIVICRM_CONTRIBUTE_PAYMENT_TEST_PASSWORD;
}
}
示例2: CRM_Core_Config
/**
* The constructor. Basically redefines the class variables if
* it finds a constant definition for that class variable
*
* @return object
* @access private
*/
function CRM_Core_Config()
{
require_once 'CRM/Core/Session.php';
$session =& CRM_Core_Session::singleton();
if (defined('CIVICRM_DOMAIN_ID')) {
$GLOBALS['_CRM_CORE_CONFIG']['_domainID'] = CIVICRM_DOMAIN_ID;
} else {
$GLOBALS['_CRM_CORE_CONFIG']['_domainID'] = 1;
}
$session->set('domainID', $GLOBALS['_CRM_CORE_CONFIG']['_domainID']);
// we figure this out early, since some config parameters are loaded
// based on what components are enabled
if (defined('ENABLE_COMPONENTS')) {
$this->enableComponents = explode(',', ENABLE_COMPONENTS);
for ($i = 0; $i < count($this->enableComponents); $i++) {
$this->enableComponents[$i] = trim($this->enableComponents[$i]);
}
}
if (defined('CIVICRM_DSN')) {
$this->dsn = CIVICRM_DSN;
}
if (defined('UF_DSN')) {
$this->ufDSN = UF_DSN;
}
if (defined('UF_USERTABLENAME')) {
$this->ufUserTableName = UF_USERTABLENAME;
}
if (defined('CIVICRM_DEBUG')) {
$this->debug = CIVICRM_DEBUG;
}
if (defined('CIVICRM_DAO_DEBUG')) {
$this->daoDebug = CIVICRM_DAO_DEBUG;
}
if (defined('CIVICRM_DAO_FACTORY_CLASS')) {
$this->DAOFactoryClass = CIVICRM_DAO_FACTORY_CLASS;
}
if (defined('CIVICRM_SMARTYDIR')) {
$this->smartyDir = CIVICRM_SMARTYDIR;
}
if (defined('CIVICRM_PLUGINSDIR')) {
$this->pluginsDir = CIVICRM_PLUGINSDIR;
}
if (defined('CIVICRM_TEMPLATEDIR')) {
$this->templateDir = CIVICRM_TEMPLATEDIR;
}
if (defined('CIVICRM_TEMPLATE_COMPILEDIR')) {
$this->templateCompileDir = CIVICRM_TEMPLATE_COMPILEDIR;
// make sure this directory exists
CRM_Utils_File::createDir($this->templateCompileDir);
}
if (defined('CIVICRM_RESOURCEBASE')) {
$this->resourceBase = CRM_Core_Config::addTrailingSlash(CIVICRM_RESOURCEBASE, '/');
}
if (defined('CIVICRM_UPLOADDIR')) {
$this->uploadDir = CRM_Core_Config::addTrailingSlash(CIVICRM_UPLOADDIR);
CRM_Utils_File::createDir($this->uploadDir);
}
if (defined('CIVICRM_IMAGE_UPLOADDIR')) {
$this->imageUploadDir = CRM_Core_Config::addTrailingSlash(CIVICRM_IMAGE_UPLOADDIR);
CRM_Utils_File::createDir($this->imageUploadDir);
}
if (defined('CIVICRM_IMAGE_UPLOADURL')) {
$this->imageUploadURL = CRM_Core_Config::addTrailingSlash(CIVICRM_IMAGE_UPLOADURL, '/');
}
if (defined('CIVICRM_CLEANURL')) {
$this->cleanURL = CIVICRM_CLEANURL;
}
if (defined('CIVICRM_COUNTRY_LIMIT')) {
$isoCodes = preg_split('/[^a-zA-Z]/', CIVICRM_COUNTRY_LIMIT);
$this->countryLimit = array_filter($isoCodes);
}
if (defined('CIVICRM_PROVINCE_LIMIT')) {
$isoCodes = preg_split('/[^a-zA-Z]/', CIVICRM_PROVINCE_LIMIT);
$provinceLimitList = array_filter($isoCodes);
if (!empty($provinceLimitList)) {
$this->provinceLimit = array_filter($isoCodes);
}
}
// Note: we can't change the ISO code to country_id
// here, as we can't access the database yet...
if (defined('CIVICRM_DEFAULT_CONTACT_COUNTRY')) {
$this->defaultContactCountry = CIVICRM_DEFAULT_CONTACT_COUNTRY;
}
if (defined('CIVICONTRIBUTE_DEFAULT_CURRENCY') and CRM_Utils_Rule::currencyCode(CIVICONTRIBUTE_DEFAULT_CURRENCY)) {
$this->defaultCurrency = CIVICONTRIBUTE_DEFAULT_CURRENCY;
}
if (defined('CIVICRM_LC_MESSAGES')) {
$this->lcMessages = CIVICRM_LC_MESSAGES;
}
if (defined('CIVICRM_ADDRESS_FORMAT')) {
// trim the format and unify line endings to LF
$format = trim(CIVICRM_ADDRESS_FORMAT);
$format = str_replace(array("\r\n", "\r"), "\n", $format);
//.........这里部分代码省略.........