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


PHP opToolkit::writeCacheFile方法代码示例

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


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

示例1: generateApplicationMessages

 public function generateApplicationMessages($dirs)
 {
     $catalogues = array();
     $files = sfFinder::type('file')->follow_link()->name('*.xml')->maxdepth(1)->in($dirs);
     foreach ($files as $file) {
         $name = basename($file);
         if (empty($catalogues[$name])) {
             $catalogues[$name] = array();
         }
         $messageSource = sfMessageSource::factory('OpenPNE');
         $data = $messageSource->loadData($file);
         $catalogues[$name] = array_merge($data, $catalogues[$name]);
     }
     $cacheDir = sfConfig::get('sf_app_cache_dir') . DIRECTORY_SEPARATOR . 'i18n';
     foreach ($catalogues as $filename => $catalogue) {
         $path = $cacheDir . DIRECTORY_SEPARATOR . $filename . '.php';
         opToolkit::writeCacheFile($path, '<?php return ' . var_export($catalogue, true) . ';');
     }
 }
开发者ID:te-koyama,项目名称:openpne,代码行数:19,代码来源:opI18N.class.php

示例2: setOpenPNEConfiguration

 protected function setOpenPNEConfiguration()
 {
     $opConfigCachePath = sfConfig::get('sf_cache_dir') . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'OpenPNE.yml.php';
     if (is_readable($opConfigCachePath)) {
         $config = (array) (include $opConfigCachePath);
     } else {
         $path = OPENPNE3_CONFIG_DIR . '/OpenPNE.yml';
         $config = sfYaml::load($path . '.sample');
         if (is_readable($path)) {
             $config = array_merge($config, sfYaml::load($path));
         }
         if (isset($config['base_url'])) {
             $config['base_url'] = preg_replace('/\\/$/', '', $config['base_url']);
         }
         opToolkit::writeCacheFile($opConfigCachePath, '<?php return ' . var_export($config, true) . ';');
     }
     $this->configureSessionStorage($config['session_storage']['name'], (array) $config['session_storage']['options']);
     unset($config['session_storage']);
     foreach ($config as $key => $value) {
         sfConfig::set('op_' . $key, $value);
     }
 }
开发者ID:kawahara,项目名称:OpenPNE3,代码行数:22,代码来源:opProjectConfiguration.class.php

示例3: globEnablePlugin

 public function globEnablePlugin($pattern, $isControllerPath = false)
 {
     if ($this->isDebug()) {
         return $this->globPlugins($pattern, false, $isControllerPath);
     }
     $cacheKey = md5(serialize($pattern));
     $cacheHead = substr($cacheKey, 0, 2);
     $cacheDir = sfConfig::get('sf_cache_dir') . DIRECTORY_SEPARATOR;
     $cacheFile = $cacheDir . 'glob_enable_plugin_path' . DIRECTORY_SEPARATOR . $cacheHead . '.php';
     $cacheProperty = 'globEnablePluginList';
     if ($isControllerPath) {
         $cacheFile = $cacheDir . 'glob_enable_plugin_path_controller' . DIRECTORY_SEPARATOR . $cacheHead . '.php';
         $cacheProperty = 'globEnablePluginControllerList';
     }
     $_prop =& $this->{$cacheProperty};
     if (empty($_prop[$cacheHead])) {
         if (is_readable($cacheFile)) {
             $_prop[$cacheHead] = (include $cacheFile);
         }
     }
     if (isset($_prop[$cacheHead][$cacheKey])) {
         return $_prop[$cacheHead][$cacheKey];
     }
     $_prop[$cacheHead][$cacheKey] = $this->globPlugins($pattern, false, $isControllerPath);
     opToolkit::writeCacheFile($cacheFile, "<?php\nreturn " . var_export($_prop[$cacheHead], true) . ';');
     return $_prop[$cacheHead][$cacheKey];
 }
开发者ID:niryuu,项目名称:OpenPNE3,代码行数:27,代码来源:opApplicationConfiguration.class.php


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