本文整理匯總了PHP中Pimcore\Cache::disable方法的典型用法代碼示例。如果您正苦於以下問題:PHP Cache::disable方法的具體用法?PHP Cache::disable怎麽用?PHP Cache::disable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Pimcore\Cache
的用法示例。
在下文中一共展示了Cache::disable方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: mkdir
<?php
\Pimcore\Cache::disable();
$customCacheFile = PIMCORE_CONFIGURATION_DIRECTORY . "/cache.xml";
// create legacy config folder
$legacyFolder = PIMCORE_CONFIGURATION_DIRECTORY . "/LEGACY";
if (!is_dir($legacyFolder)) {
mkdir($legacyFolder, 0777, true);
}
if (file_exists($customCacheFile)) {
try {
$conf = new \Zend_Config_Xml($customCacheFile);
$arrayConf = $conf->toArray();
$content = json_encode($arrayConf);
$content = \Zend_Json::prettyPrint($content);
$jsonFile = \Pimcore\Config::locateConfigFile("cache.json");
file_put_contents($jsonFile, $content);
rename($customCacheFile, $legacyFolder . "/cache.xml");
} catch (\Exception $e) {
}
}
示例2: executeScript
/**
* @param $revision
* @param $type
* @return array
*/
public static function executeScript($revision, $type)
{
$script = PIMCORE_SYSTEM_TEMP_DIRECTORY . "/update/" . $revision . "/scripts/" . $type . ".php";
$maxExecutionTime = 900;
@ini_set("max_execution_time", $maxExecutionTime);
set_time_limit($maxExecutionTime);
Cache::disable();
// it's important to disable the cache here eg. db-schemas, ...
if (is_file($script)) {
$outputMessage = "";
ob_start();
try {
if (!self::$dryRun) {
include $script;
}
} catch (\Exception $e) {
\Logger::error($e);
$outputMessage .= "EXCEPTION: " . $e->getMessage();
$outputMessage .= "<br>For details please have a look into debug.log<br>";
}
$outputMessage .= ob_get_clean();
}
self::clearOPCaches();
return ["message" => $outputMessage, "success" => true];
}