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); }
public function testAssets() { /* @var View $view */ $view = $this->di->getShared('view'); $view->isAdmin(false); $view->cache(true); View::clearAssetsCache(); $this->assertStringStartsWith('<script type="text/javascript" ', View::generateHeadJs()); // Test assets cache $this->assertStringStartsWith('<script type="text/javascript" ', View::generateHeadJs()); $this->assertStringStartsWith('<link rel="stylesheet" type="text/css" ', View::generateHeadCss()); $this->assertStringStartsWith('<link rel="stylesheet" type="text/css" ', View::generateIeHack()); $this->assertStringStartsWith('<script type="text/javascript" ', View::generateBodyJs()); $this->assertStringStartsWith('<script type="text/javascript" ', View::generateIeHackBodyJs()); $this->assertStringStartsWith('<script type="text/javascript" ', View::assets('non-existing-remote-js')); }