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


PHP CRM_Utils_Cache::create方法代碼示例

本文整理匯總了PHP中CRM_Utils_Cache::create方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Utils_Cache::create方法的具體用法?PHP CRM_Utils_Cache::create怎麽用?PHP CRM_Utils_Cache::create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CRM_Utils_Cache的用法示例。


在下文中一共展示了CRM_Utils_Cache::create方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: singleton

 /**
  * @param bool $fresh
  * @return CRM_Cxn_CiviCxnHttp
  */
 public static function singleton($fresh = FALSE)
 {
     if (self::$singleton === NULL || $fresh) {
         $cache = CRM_Utils_Cache::create(array('name' => 'CiviCxnHttp', 'type' => Civi::settings()->get('debug_enabled') ? 'ArrayCache' : array('SqlGroup', 'ArrayCache'), 'prefetch' => FALSE));
         self::$singleton = new CRM_Cxn_CiviCxnHttp($cache);
     }
     return self::$singleton;
 }
開發者ID:FundingWorks,項目名稱:civicrm-core,代碼行數:12,代碼來源:CiviCxnHttp.php

示例2: boot

 /**
  * Get a list of boot services.
  *
  * These are services which must be setup *before* the container can operate.
  *
  * @param bool $loadFromDB
  * @throws \CRM_Core_Exception
  */
 public static function boot($loadFromDB)
 {
     $bootServices = array();
     \Civi::$statics[__CLASS__]['boot'] =& $bootServices;
     $bootServices['runtime'] = array('class' => 'CRM_Core_Config_Runtime', 'obj' => $runtime = new \CRM_Core_Config_Runtime());
     $runtime->initialize($loadFromDB);
     if ($loadFromDB && $runtime->dsn) {
         \CRM_Core_DAO::init($runtime->dsn);
     }
     $bootServices['paths'] = array('class' => 'Civi\\Core\\Paths', 'obj' => new \Civi\Core\Paths());
     $class = $runtime->userFrameworkClass;
     $bootServices['userSystem'] = array('class' => 'CRM_Utils_Cache_Interface', 'obj' => $userSystem = new $class());
     $userSystem->initialize();
     $userPermissionClass = 'CRM_Core_Permission_' . $runtime->userFramework;
     $bootServices['userPermissionClass'] = array('class' => 'CRM_Core_Permission_Base', 'obj' => new $userPermissionClass());
     $bootServices['cache.settings'] = array('class' => 'CRM_Utils_Cache_Interface', 'obj' => \CRM_Utils_Cache::create(array('name' => 'settings', 'type' => array('*memory*', 'SqlGroup', 'ArrayCache'))));
     $bootServices['settings_manager'] = array('class' => 'Civi\\Core\\SettingsManager', 'obj' => new \Civi\Core\SettingsManager($bootServices['cache.settings']['obj']));
     $bootServices['lockManager'] = array('class' => 'Civi\\Core\\Lock\\LockManager', 'obj' => self::createLockManager());
     if ($loadFromDB && $runtime->dsn) {
         \CRM_Utils_Hook::singleton(TRUE);
         \CRM_Extension_System::singleton(TRUE);
         $c = new self();
         \Civi::$statics[__CLASS__]['container'] = $c->loadContainer();
     }
 }
開發者ID:rameshrr99,項目名稱:civicrm-core,代碼行數:33,代碼來源:Container.php

示例3: getCache

 /**
  * @return CRM_Utils_Cache_Interface
  */
 public function getCache()
 {
     if ($this->cache === NULL) {
         $cacheGroup = md5(serialize(array('ext', $this->parameters)));
         // Extension system starts before container. Manage our own cache.
         $this->cache = CRM_Utils_Cache::create(array('name' => $cacheGroup, 'type' => array('*memory*', 'SqlGroup', 'ArrayCache'), 'prefetch' => TRUE));
     }
     return $this->cache;
 }
開發者ID:kcristiano,項目名稱:civicrm-core,代碼行數:12,代碼來源:System.php

示例4: __construct

 public function __construct()
 {
     $this->cache = CRM_Utils_Cache::create(array('name' => 'hooks', 'type' => array('ArrayCache'), 'prefetch' => 1));
 }
開發者ID:rollox,項目名稱:civicrm-core,代碼行數:4,代碼來源:Hook.php

示例5: boot

 /**
  * Get a list of boot services.
  *
  * These are services which must be setup *before* the container can operate.
  *
  * @param bool $loadFromDB
  * @throws \CRM_Core_Exception
  */
 public static function boot($loadFromDB)
 {
     // Array(string $serviceId => object $serviceInstance).
     $bootServices = array();
     \Civi::$statics[__CLASS__]['boot'] =& $bootServices;
     $bootServices['runtime'] = $runtime = new \CRM_Core_Config_Runtime();
     $runtime->initialize($loadFromDB);
     $bootServices['paths'] = new \Civi\Core\Paths();
     $class = $runtime->userFrameworkClass;
     $bootServices['userSystem'] = $userSystem = new $class();
     $userSystem->initialize();
     $userPermissionClass = 'CRM_Core_Permission_' . $runtime->userFramework;
     $bootServices['userPermissionClass'] = new $userPermissionClass();
     $bootServices['cache.settings'] = \CRM_Utils_Cache::create(array('name' => 'settings', 'type' => array('*memory*', 'SqlGroup', 'ArrayCache')));
     $bootServices['settings_manager'] = new \Civi\Core\SettingsManager($bootServices['cache.settings']);
     $bootServices['lockManager'] = self::createLockManager();
     if ($loadFromDB && $runtime->dsn) {
         \CRM_Core_DAO::init($runtime->dsn);
         \CRM_Utils_Hook::singleton(TRUE);
         \CRM_Extension_System::singleton(TRUE);
         \CRM_Extension_System::singleton(TRUE)->getClassLoader()->register();
         $runtime->includeCustomPath();
         $c = new self();
         $container = $c->loadContainer();
         foreach ($bootServices as $name => $obj) {
             $container->set($name, $obj);
         }
         \Civi::$statics[__CLASS__]['container'] = $container;
     }
 }
開發者ID:kcristiano,項目名稱:civicrm-core,代碼行數:38,代碼來源:Container.php


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