本文整理汇总了PHP中CRM_Core_PseudoConstant::getExtensions方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_PseudoConstant::getExtensions方法的具体用法?PHP CRM_Core_PseudoConstant::getExtensions怎么用?PHP CRM_Core_PseudoConstant::getExtensions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_PseudoConstant
的用法示例。
在下文中一共展示了CRM_Core_PseudoConstant::getExtensions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: registerScripts
static function registerScripts()
{
static $loaded = FALSE;
if ($loaded) {
return;
}
$loaded = TRUE;
CRM_Core_Resources::singleton()->addSettingsFactory(function () {
global $user;
$settings = array();
$config = CRM_Core_Config::singleton();
$extensions = CRM_Core_PseudoConstant::getExtensions();
return array('Appraisals' => array('extensionPath' => CRM_Core_Resources::singleton()->getUrl('uk.co.compucorp.civicrm.appraisals'), 'settings' => $settings, 'permissions' => array()), 'adminId' => CRM_Core_Session::getLoggedInContactID(), 'contactId' => CRM_Utils_Request::retrieve('cid', 'Integer'), 'debug' => $config->debug);
});
}
示例2: getBootstrapFile
/**
* Find (or auto-create) a PHP file with information for bootstrapping the test environment
*
* @param string $key the extension for which tests will be run
* @return string temp file path
*/
protected function getBootstrapFile($key, $clear = FALSE)
{
$file = $this->getContainer()->get('kernel')->getCacheDir() . "/civix-phpunit.{$key}.php";
if ($clear || !file_exists($file) || filemtime($file) < time() - self::BOOTSTRAP_TTL) {
$template_vars = array();
$template_vars['civicrm_setting'] = array();
// disable extension searching
$template_vars['civicrm_setting']['Extension Preferences']['ext_repo_url'] = FALSE;
// use the same source tree for linked Civi runtime and test Civi runtime
$template_vars['civicrm_setting']['Directory Preferences']['extensionsDir'] = \CRM_Core_BAO_Setting::getItem('Directory Preferences', 'extensionsDir');
// extensionsURL of linked Civi runtime may differ from ideal value for test Civi runtime, but that's OK because extensionsURL defines *static* resources
$template_vars['civicrm_setting']['URL Preferences']['extensionsURL'] = \CRM_Core_BAO_Setting::getItem('URL Preferences', 'extensionsURL');
$template_vars['civicrm_setting']['Test']['test_extensions'] = array_keys(\CRM_Core_PseudoConstant::getExtensions());
file_put_contents($file, $this->getContainer()->get('templating')->render('CRMCivixBundle:Code:phpunit-boot.php.php', $template_vars));
}
return $file;
}
示例3: isExtensionClass
/**
* Given the string, returns true or false if it's an extension class name.
*
* @access public
* @param string $clazz a string which might be an extension class name
* @return boolean true if given string is an extension class name
*/
public function isExtensionClass($clazz)
{
if (substr($clazz, 0, 4) != 'CRM_') {
require_once 'CRM/Core/PseudoConstant.php';
$extensions = CRM_Core_PseudoConstant::getExtensions($clazz);
if (array_key_exists($this->classToKey($clazz), $extensions)) {
return TRUE;
}
}
return FALSE;
}