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