本文整理汇总了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);
}
}
示例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;
}
示例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;
}