當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CacheHandler::removeBySize方法代碼示例

本文整理匯總了PHP中CacheHandler::removeBySize方法的典型用法代碼示例。如果您正苦於以下問題:PHP CacheHandler::removeBySize方法的具體用法?PHP CacheHandler::removeBySize怎麽用?PHP CacheHandler::removeBySize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CacheHandler的用法示例。


在下文中一共展示了CacheHandler::removeBySize方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: chdir

// If the above doesn't work - place your working directory path to killboard root below - comment out the above two lines and uncomment the two below
// Edit the path below with your webspace directory to the killboard root folder - also check your php folder is correct as defined by the first line of this file
//$KB_HOME = "/home/yoursite/public_html/kb";
chdir($KB_HOME);
require_once 'kbconfig.php';
require_once 'common/includes/globals.php';
require_once 'common/includes/db.php';
require_once 'common/includes/class.edkerror.php';
set_error_handler(array('EDKError', 'handler'), E_ERROR);
@error_reporting(E_ERROR);
// disable query caching while the script is running.
$qcache = config::get('cfg_qcache');
if ($qcache) {
    echo "<br />\n File query cache disabled <br />\n";
    config::set('cfg_qcache', 0);
}
echo "<br />Removed " . CacheHandler::removeByAge('SQL/', $maxSQLAge * 24) . " files from SQL/<br />\n";
echo "Removed " . CacheHandler::removeByAge('page/' . KB_SITE . '/', $maxOtherAge * 24) . " files from page/<br />\n";
echo "Removed " . CacheHandler::removeByAge("templates_c/", $maxOtherAge * 24) . " files from templates_c/<br />\n";
echo "Removed " . CacheHandler::removeByAge("mail/", $maxOtherAge * 24) . " files from mail/<br />\n";
// Let's let people see their latest beautiful creation in the character creator.
echo "Removed " . CacheHandler::removeByAge('img/', $maxImageAge * 24) . " files from img/<br />\n";
//echo "Removed ".CacheHandler::removeBySize('img/', 512 * 24)." files from img/<br />\n";
//echo "Removed ".CacheHandler::removeByAge('store/', 7 * 24)." files from store/<br />\n";
echo "Removed " . CacheHandler::removeBySize('store/', $maxStoreSize) . " files from store/<br />\n";
echo "Removed " . CacheHandler::removeByAge('api/', $maxAPIAge * 24) . " files from api/<br />\n";
//echo "Removed ".CacheHandler::removeByAge('/', 30 * 24, false)." files from entire cache<br />\n";
if ($qcache) {
    echo "<br />\n File query cache re-enabled <br />\n";
    config::set('cfg_qcache', 1);
}
開發者ID:biow0lf,項目名稱:evedev-kb,代碼行數:31,代碼來源:cron_clearup.php


注:本文中的CacheHandler::removeBySize方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。