コード例 #1
0
 public function fire()
 {
     $clearAll = true;
     if ($this->input->getOption('config-only')) {
         $clearAll = false;
         Config::clearCache();
         $this->info('Config cache cleared.');
     }
     if ($this->input->getOption('meta-only')) {
         $clearAll = false;
         Db::clearMetadata();
         $this->info('Model metadata cleared.');
     }
     if ($this->input->getOption('locale-only')) {
         $clearAll = false;
         I18n::clearCache();
         $this->info('Locale cache cleared.');
     }
     if ($this->input->getOption('assets-only')) {
         $clearAll = false;
         View::clearAssetsCache();
         $this->info('Assets cache cleared.');
     }
     if ($clearAll) {
         Cache::flush();
         Config::clearCache();
         $this->info('Cache cleared.');
     }
     Events::fire('cache:after_clear', $this);
 }
コード例 #2
0
ファイル: TestCase.php プロジェクト: phwoolcon/bootstrap
 public function setUp()
 {
     $_SERVER['SCRIPT_NAME'] = '/index.php';
     $this->di = Di::getDefault();
     Cache::flush();
     Config::clearCache();
     PHPUnit_Framework_TestCase::setUp();
     $class = get_class($this);
     Log::debug("Running {$class}::{$this->getName()}() ...");
 }
コード例 #3
0
ファイル: ConfigTrait.php プロジェクト: phwoolcon/phwoolcon
 protected function submitConfig($key, $data)
 {
     if (is_string($data)) {
         $data = json_decode($data, true);
         if (json_last_error() != JSON_ERROR_NONE) {
             throw new ValidationException(json_last_error_msg(), json_last_error());
         }
     }
     $value = $this->filterConfig($key, $data);
     ConfigModel::saveConfig($key, $value);
     Config::clearCache();
     return $value;
 }
コード例 #4
0
ファイル: TestCase.php プロジェクト: phwoolcon/phwoolcon
 public function setUp()
 {
     $_SERVER['SCRIPT_NAME'] = '/index.php';
     $_SERVER['PHWOOLCON_PHALCON_VERSION'] = Version::getId();
     /* @var Di $di */
     $di = $this->di = Di::getDefault();
     Events::register($di);
     DiFix::register($di);
     Db::register($di);
     Cache::register($di);
     Log::register($di);
     Config::register($di);
     Counter::register($this->di);
     Aliases::register($di);
     I18n::register($di);
     Cookies::register($di);
     Session::register($di);
     Cache::flush();
     Config::clearCache();
     parent::setUp();
     $class = get_class($this);
     Log::debug("================== Running {$class}::{$this->getName()}() ... ==================");
     Timer::start();
 }