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


PHP Kurogo::deleteCache方法代码示例

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


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

示例1: setSectionVars

 public function setSectionVars($sectionVars, $area, $type, $opts = 0)
 {
     if ($type instanceof Module) {
         $key = $type->getConfigModule() . '-' . $area;
     } else {
         $key = $type . '-' . $area;
     }
     if ($config = $this->getConfig($area, $type, $opts)) {
         $config->setSectionVars($sectionVars);
         $config->saveConfig();
         unset($this->configs[$key]);
         Kurogo::deleteCache('config-' . $key);
     }
 }
开发者ID:sponto,项目名称:Kurogo-Mobile-Web,代码行数:14,代码来源:ConfigStore.php

示例2: saveConfig

 public function saveConfig(Config $config)
 {
     $key = sprintf("%s-%s", $config->getType(), $config->getArea());
     if (!($file = $config->getFile('base'))) {
         throw new KurogoConfigurationException("Unable to load base file for " . $config->getType() . '-' . $config->getArea());
     }
     if (count($config->getFiles()) > 1) {
         KurogoDebug::Debug($config, true);
         throw new KurogoConfigurationException("Safety net. File will not be saved because it was loaded with extra files. The code is probably wrong");
     }
     $data = $config->getSaveData();
     if (!is_writable($file)) {
         throw new KurogoConfigurationException("Cannot save config file: {$file} Check permissions");
     }
     file_put_contents($file, $data);
     unset($this->configs[$key]);
     Kurogo::deleteCache('config-' . $key);
     return true;
 }
开发者ID:sponto,项目名称:Kurogo-Mobile-Web,代码行数:19,代码来源:ConfigFileStore.php

示例3: saveFile

 public function saveFile()
 {
     if (!is_writable($this->filepath)) {
         throw new KurogoConfigurationException("Cannot save config file: {$this->filepath} Check permissions");
     } elseif ($this->localFile) {
         throw new KurogoConfigurationException("Safety net. File will not be saved because it was loaded and has local overrides. The code is probably wrong");
     }
     $string = array();
     foreach ($this->sectionVars as $section => $sectionData) {
         if (is_array($sectionData)) {
             if (count($string) > 0) {
                 $string[] = '';
             }
             if (isset($sectionData[0])) {
                 foreach ($sectionData as $value) {
                     $string[] = sprintf("%s[] = %s", $section, $this->saveValue($value));
                 }
                 $sectionData = array();
             } elseif ($section !== 'No Section') {
                 $string[] = sprintf("[%s]", $section);
             }
             foreach ($sectionData as $var => $value) {
                 if (is_scalar($value)) {
                     $string[] = sprintf('%s = %s', $var, $this->saveValue($value));
                 } elseif (isset($value[0])) {
                     foreach ($value as $_value) {
                         $string[] = sprintf("%s[] = %s", $var, $this->saveValue($_value));
                     }
                 } else {
                     Kurogo::log(LOG_WARNING, "Error parsing non scalar value for {$var} in " . $this->filepath, 'config');
                 }
             }
         } else {
             $string[] = sprintf('%s = %s', $section, $this->saveValue($sectionData));
         }
     }
     file_put_contents($this->filepath, implode(PHP_EOL, $string));
     $cacheKey = $this->cacheKeyForFile($this->filepath);
     Kurogo::deleteCache($cacheKey);
     return true;
 }
开发者ID:nncsang,项目名称:Kurogo,代码行数:41,代码来源:ConfigFile.php


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