本文整理汇总了PHP中Options::resetCache方法的典型用法代码示例。如果您正苦于以下问题:PHP Options::resetCache方法的具体用法?PHP Options::resetCache怎么用?PHP Options::resetCache使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Options
的用法示例。
在下文中一共展示了Options::resetCache方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
/**
* @see AdminToolsFunction::execute($data)
*/
public function execute($data)
{
parent::execute($data);
$parameters = $data['parameters']['cache.clearCache'];
if ($parameters['clearWCFCache']) {
WCF::getCache()->clear(WCF_DIR . 'cache', '*.php', true);
}
if ($parameters['clearStandaloneCache']) {
$sql = "SELECT packageDir FROM wcf" . WCF_N . "_package WHERE packageID = " . PACKAGE_ID;
$row = WCF::getDB()->getFirstRow($sql);
WCF::getCache()->clear($row['packageDir'] . 'cache', '*.php', true);
}
if ($parameters['clearTemplateCache']) {
require_once WCF_DIR . 'lib/system/template/ACPTemplate.class.php';
ACPTemplate::deleteCompiledACPTemplates();
Template::deleteCompiledTemplates();
}
if ($parameters['clearLanguageCache']) {
LanguageEditor::deleteLanguageFiles('*', '*', '*');
}
if ($parameters['clearStandaloneOptions']) {
Options::resetCache();
Options::resetFile();
}
$this->executed();
}
示例2: save
/**
* @see Form::save()
*/
public function save()
{
parent::save();
// save options and affected package ids
$saveOptions = $affectedPackageIDArray = array();
foreach ($this->cachedOptions as $option) {
$saveOptions[$option['optionID']] = $option['optionValue'];
$affectedPackageIDArray[] = $option['packageID'];
}
Options::save($saveOptions);
// clear cache
Options::resetCache();
// delete relevant options.inc.php's
$affectedPackageIDArray = array_unique($affectedPackageIDArray);
Options::resetFile($affectedPackageIDArray);
$this->saved();
// show succes message
WCF::getTPL()->assign('success', true);
}
示例3: save
/**
* @see Form::save()
*/
public function save()
{
parent::save();
// get option ids
$sql = "SELECT\t\toptionName, optionID \n\t\t\tFROM\t\twcf" . WCF_N . "_option acp_option,\n\t\t\t\t\twcf" . WCF_N . "_package_dependency package_dependency\n\t\t\tWHERE \t\tacp_option.packageID = package_dependency.dependency\n\t\t\t\t\tAND package_dependency.packageID = " . PACKAGE_ID . "\n\t\t\tORDER BY\tpackage_dependency.priority";
$result = WCF::getDB()->sendQuery($sql);
$optionIDArray = array();
while ($row = WCF::getDB()->fetchArray($result)) {
$optionIDArray[$row['optionName']] = $row['optionID'];
}
// save
foreach ($this->options as $name => $value) {
if (isset($optionIDArray[$name])) {
$sql = "UPDATE\twcf" . WCF_N . "_option\n\t\t\t\t\tSET\toptionValue = '" . escapeString($value) . "'\n\t\t\t\t\tWHERE\toptionID = " . $optionIDArray[$name];
WCF::getDB()->sendQuery($sql);
}
}
// reset cache
Options::resetFile();
Options::resetCache();
$this->saved();
// show success message
WCF::getTPL()->assign('success', true);
}