* @license PHP License * @package WB * @subpackage base */ /** * Caching Control * * * @version 0.1.0 * @package WB * @subpackage base */ class WBCache_Control { public function flush() { $this->flushAllDomains(); } private function flushAllDomains() { // flush domains $domain = array( 'general', 'template', 'css', 'javascript' ); foreach ($domain as $d) { $this->flushDomain($d); } } public function flushDomain($domain) { $cmd = 'find %s/var/cache/%s -type f -delete'; $cmd = sprintf($cmd, WBParam::get('wb/dir/base'), $domain); exec($cmd, $out, $ret); // echo $cmd . "\n"; } }