当前位置: 首页>>代码示例>>PHP>>正文


PHP static::cache方法代码示例

本文整理汇总了PHP中static::cache方法的典型用法代码示例。如果您正苦于以下问题:PHP static::cache方法的具体用法?PHP static::cache怎么用?PHP static::cache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在static的用法示例。


在下文中一共展示了static::cache方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getCache

 /**
  * @return SplObjectStorage
  */
 protected static function getCache()
 {
     if (!static::$cache) {
         static::$cache = new SplObjectStorage();
     }
     return static::$cache;
 }
开发者ID:tacone,项目名称:datasource,代码行数:10,代码来源:EloquentCache.php

示例2: clearCache

 public function clearCache()
 {
     static::$cache = [];
     static::$cacheFile = NULL;
     $this->initialize();
     return $this;
 }
开发者ID:pixel418,项目名称:staq,代码行数:7,代码来源:Setting.php

示例3: provide

 public static function provide()
 {
     if (!static::$cache) {
         static::$cache = static::loadCache();
     }
     return static::$cache;
 }
开发者ID:mleko,项目名称:validate-commit,代码行数:7,代码来源:ValidMessageProvider.php

示例4: useRangeDate

 public function useRangeDate()
 {
     if (static::$cache === null) {
         static::$cache = $this->getHandleClassInstance();
     }
     return static::$cache->useRangeDate();
 }
开发者ID:vigourouxjulien,项目名称:thelia,代码行数:7,代码来源:Export.php

示例5: getConfig

 /**
  * Get plugin config
  * 
  * @param string $packageName
  * @param string $pluginName
  * @return Config
  */
 public static function getConfig($packageName, $pluginName = null, $ignoreCache = false)
 {
     if (empty($packageName)) {
         throw new InvalidArgumentException("\$packageName is empty");
     }
     if ($pluginName === null) {
         $pluginName = $packageName;
     }
     if (!is_object(static::$cache)) {
         static::$cache = new Config();
     }
     if (isset(static::$globalConfig->{$packageName}) and isset(static::$globalConfig->{$packageName}->{$pluginName})) {
         $globalConfig = static::$globalConfig->{$packageName}->{$pluginName};
     } else {
         $globalConfig = new Config();
     }
     if (!$ignoreCache and isset(static::$cache->{$packageName}) and isset(static::$cache->{$packageName}->{$pluginName})) {
         return static::mergeConfigs($globalConfig, static::$cache->{$packageName}->{$pluginName});
     }
     //echo "$packageName - $pluginName<br>\n";
     if (file_exists(SITE_PACKAGES_PATH . "{$packageName}/{$pluginName}/DefaultConfig.inc.php")) {
         include SITE_PACKAGES_PATH . "{$packageName}/{$pluginName}/DefaultConfig.inc.php";
     } elseif (file_exists(STINGLE_PATH . "packages/{$packageName}/{$pluginName}/DefaultConfig.inc.php")) {
         include STINGLE_PATH . "packages/{$packageName}/{$pluginName}/DefaultConfig.inc.php";
     } else {
         $defaultConfig = array();
     }
     $defaultConfigObj = new Config($defaultConfig);
     $result = static::mergeConfigs($globalConfig, $defaultConfigObj);
     if (!isset(static::$cache->{$packageName})) {
         static::$cache->{$packageName} = new Config();
     }
     static::$cache->{$packageName}->{$pluginName} = $defaultConfigObj;
     return $result;
 }
开发者ID:Welvin,项目名称:stingle,代码行数:42,代码来源:ConfigManager.class.php

示例6: cache

 /**
  * @return \metalguardian\fileProcessor\components\ThumbnailCache
  * @throws \yii\base\InvalidConfigException
  */
 public static function cache()
 {
     if (is_null(static::$cache)) {
         static::$cache = \Yii::createObject(\metalguardian\fileProcessor\components\ThumbnailCache::className());
     }
     return static::$cache;
 }
开发者ID:vadimsemenykv,项目名称:yii2-file-processor-module,代码行数:11,代码来源:FPM.php

示例7: setInstance

 public static function setInstance($dir = null)
 {
     $dir = $dir ? $dir : "myAppDirCache";
     static::$file_cache_dir = sfConfig::get('sf_cache_dir') . DIRECTORY_SEPARATOR . $dir;
     static::$cache = new sfFileCache(array('cache_dir' => static::$file_cache_dir));
     return static::$cache;
 }
开发者ID:lagden,项目名称:sf14libs,代码行数:7,代码来源:FileCache.php

示例8: init

 /**
  * Should be called in beforeRender()
  *
  */
 public static function init(View $View)
 {
     $params = $View->request->params;
     if (Configure::read('UrlCache.pageFiles')) {
         $cachePageKey = '_misc';
         if (is_object($View)) {
             $path = $View->request->here;
             if ($path === '/') {
                 $path = 'uc_homepage';
             } else {
                 $path = strtolower(Inflector::slug($path));
             }
             if (empty($path)) {
                 $path = 'uc_error';
             }
             $cachePageKey = '_' . $path;
         }
         static::$cachePageKey = static::$cacheKey . $cachePageKey;
         static::$cachePage = Cache::read(static::$cachePageKey, '_cake_core_');
     }
     static::$cache = Cache::read(static::$cacheKey, '_cake_core_');
     // still old "prefix true/false" syntax?
     if (Configure::read('UrlCache.verbosePrefixes')) {
         unset(static::$paramFields[3]);
         static::$paramFields = array_merge(static::$paramFields, (array) Configure::read('Routing.prefixes'));
     }
     static::$extras = array_intersect_key($params, array_combine(static::$paramFields, static::$paramFields));
     $defaults = array();
     foreach (static::$paramFields as $field) {
         $defaults[$field] = '';
     }
     static::$extras = array_merge($defaults, static::$extras);
 }
开发者ID:miznokruge,项目名称:base-cake,代码行数:37,代码来源:UrlCacheManager.php

示例9: setCustomCache

 /**
  * Use a custom fCache object to serve caches. Any fCache object works, so if the directory
  * cache isn't working well, developers should test different cache options and find one that
  * works best.
  * 
  * @param fCache $cache 		The fCache object to serve as a cache
  */
 public static function setCustomCache(fCache $cache)
 {
     if (static::$authorized_override) {
         return false;
     }
     static::$enabled = true;
     static::$cache = $cache;
 }
开发者ID:rizqidjamaluddin,项目名称:Swoosh,代码行数:15,代码来源:sfPageCache.php

示例10: request

 public static function request()
 {
     if (empty(self::$cache)) {
         static::$cache = new \Rpp\Extend\Memcached();
         return static::$cache;
     } else {
         return static::$cache;
     }
 }
开发者ID:tresemece,项目名称:monte,代码行数:9,代码来源:Cache2.php

示例11: cache

 /**
  * Load annotation cache strategy
  * 
  * @param CacheInterface $cache
  * @return CacheInterface
  */
 public static function cache(CacheInterface $cache = null)
 {
     if ($cache) {
         static::$cache = $cache;
     } elseif (!static::$cache) {
         static::$cache = new Annotation\EphemeralCache();
     }
     return static::$cache;
 }
开发者ID:colorium,项目名称:runtime,代码行数:15,代码来源:Annotation.php

示例12: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     if (!extension_loaded('xcache')) {
         static::$cache = null;
         return;
     }
     xcache_clear_cache(XC_TYPE_VAR);
     static::$cache = new \Cachalot\XcacheCache('cachalot-test:');
 }
开发者ID:ihor,项目名称:cachalot,代码行数:9,代码来源:XcacheCacheTest.php

示例13: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     if (!extension_loaded('apc') && !extension_loaded('apcu')) {
         static::$cache = null;
         return;
     }
     apc_clear_cache();
     static::$cache = new \Cachalot\ApcCache('cachalot-test:');
 }
开发者ID:ihor,项目名称:cachalot,代码行数:9,代码来源:ApcCacheTest.php

示例14: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     if (!extension_loaded('couchbase') || !class_exists('CouchbaseCluster')) {
         static::$cache = null;
         return;
     }
     $cluster = new \CouchbaseCluster('couchbase://localhost');
     $bucket = $cluster->openBucket('cachalot-test');
     static::$cache = new \Cachalot\Couchbase2Cache($bucket);
 }
开发者ID:ihor,项目名称:cachalot,代码行数:10,代码来源:Couchbase2CacheTest.php

示例15: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     if (!extension_loaded('couchbase') || !class_exists('Couchbase')) {
         static::$cache = null;
         return;
     }
     $couchbase = new \Couchbase('127.0.0.1', '', '', 'cachalot-test');
     $couchbase->flush();
     static::$cache = new \Cachalot\CouchbaseCache($couchbase);
 }
开发者ID:ihor,项目名称:cachalot,代码行数:10,代码来源:CouchbaseCacheTest.php


注:本文中的static::cache方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。