本文整理汇总了PHP中Options::resetFile方法的典型用法代码示例。如果您正苦于以下问题:PHP Options::resetFile方法的具体用法?PHP Options::resetFile怎么用?PHP Options::resetFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Options
的用法示例。
在下文中一共展示了Options::resetFile方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: renderOnlineList
/**
* Wrapper for UsersOnlineList->renderOnlineList()
* @see UsersOnlineList::renderOnlineList()
*/
protected function renderOnlineList()
{
require_once WCF_DIR . 'lib/data/user/usersOnline/UsersOnlineList.class.php';
$usersOnlineList = new UsersOnlineList('', true);
$usersOnlineList->renderOnlineList();
// check users online record
$usersOnlineTotal = USERS_ONLINE_RECORD_NO_GUESTS ? $usersOnlineList->usersOnlineMembers : $usersOnlineList->usersOnlineTotal;
if ($usersOnlineTotal > USERS_ONLINE_RECORD) {
// save new users online record
$sql = "UPDATE\twcf" . WCF_N . "_option\n\t\t\t\tSET\toptionValue = IF(" . $usersOnlineTotal . " > optionValue, " . $usersOnlineTotal . ", optionValue)\n\t\t\t\tWHERE\toptionName = 'users_online_record'\n\t\t\t\t\tAND packageID = " . PACKAGE_ID;
WCF::getDB()->registerShutdownUpdate($sql);
// save new record time
if (TIME_NOW > USERS_ONLINE_RECORD_TIME) {
$sql = "UPDATE\twcf" . WCF_N . "_option\n\t\t\t\t\tSET\toptionValue = IF(" . TIME_NOW . " > optionValue, " . TIME_NOW . ", optionValue)\n\t\t\t\t\tWHERE\toptionName = 'users_online_record_time'\n\t\t\t\t\t\tAND packageID = " . PACKAGE_ID;
WCF::getDB()->registerShutdownUpdate($sql);
}
// reset options file
require_once WCF_DIR . 'lib/acp/option/Options.class.php';
Options::resetFile();
}
}
示例4: 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);
}