當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CRM_Core_PseudoConstant::getExtensions方法代碼示例

本文整理匯總了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);
     });
 }
開發者ID:JoeMurray,項目名稱:civihr,代碼行數:15,代碼來源:Base.php

示例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;
 }
開發者ID:twomice,項目名稱:civix,代碼行數:23,代碼來源:TestRunCommand.php

示例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;
 }
開發者ID:hampelm,項目名稱:Ginsberg-CiviDemo,代碼行數:18,代碼來源:Extensions.php


注:本文中的CRM_Core_PseudoConstant::getExtensions方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。