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


PHP Cache_Lite::setOption方法代码示例

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


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

示例1: setOptions

 /**
  * Sets options for Cache_Lite based on the needs of the current method.
  * Options set include the subdirectory to be used, and the expiration.
  * 
  * @param string $key    The sub-directory of the cacheDir
  * @param string $expire The cache lifetime (expire) to be used
  * 
  * @return void
  */
 protected function setOptions($key, $expire = null)
 {
     $cacheDir = $this->options['cacheDir'] . '/oauth/';
     $cacheDir .= rtrim($key, '/') . '/';
     $this->ensureDirectoryExists($cacheDir);
     $this->cache->setOption('cacheDir', $cacheDir);
     $this->cache->setOption('lifeTime', $expire);
 }
开发者ID:verbazend,项目名称:AWFA,代码行数:17,代码来源:CacheLite.php

示例2: setOptions

 /**
  * Sets options for Cache_Lite based on the needs of the current method.
  * Options set include the subdirectory to be used, and the expiration.
  * 
  * @param string $key    The sub-directory of the cacheDir
  * @param string $expire The cache lifetime (expire) to be used
  * 
  * @return void
  */
 protected function setOptions($key, $expire = null)
 {
     $cacheDir = $this->options['cacheDir'] . '/openid/';
     $cacheDir .= rtrim($this->storeDirectories[$key], '/') . '/';
     $this->ensureDirectoryExists($cacheDir);
     $this->cache->setOption('cacheDir', $cacheDir);
     if ($expire !== null) {
         $this->cache->setOption('lifeTime', $expire);
     }
 }
开发者ID:shupp,项目名称:openid,代码行数:19,代码来源:CacheLite.php

示例3: gc

 /**
  * Garbage collect expired cache data
  *
  * @return  boolean
  *
  * @since   11.1
  */
 public function gc()
 {
     $result = true;
     static::$CacheLiteInstance->setOption('automaticCleaningFactor', 1);
     static::$CacheLiteInstance->setOption('hashedDirectoryLevel', 1);
     $success1 = static::$CacheLiteInstance->_cleanDir($this->_root . '/', false, 'old');
     if (!($dh = opendir($this->_root . '/'))) {
         return false;
     }
     while ($file = readdir($dh)) {
         if ($file != '.' && $file != '..' && $file != '.svn') {
             $file2 = $this->_root . '/' . $file;
             if (is_dir($file2)) {
                 $result = $result && static::$CacheLiteInstance->_cleanDir($file2 . '/', false, 'old');
             }
         }
     }
     $success = $success1 && $result;
     return $success;
 }
开发者ID:joomla-projects,项目名称:media-manager-improvement,代码行数:27,代码来源:cachelite.php


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