Esempio n. 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);
 }
Esempio n. 2
0
 public function testPageTitle()
 {
     $controller = $this->getTestController();
     $controller->addPageTitle('Phwoolcon');
     $controller->addPageTitle('Test Title');
     $controller->render('test', 'controller-render');
     $this->assertEquals('Test Title - Phwoolcon', View::getPageTitle());
 }
Esempio n. 3
0
 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'));
 }
Esempio n. 4
0
 public function setUp()
 {
     parent::setUp();
     Router::register($this->di);
     View::register($this->di);
 }
Esempio n. 5
0
 public static function generateErrorPage($template, $pateTitle)
 {
     return View::make('errors', $template, ['page_title' => $pateTitle]);
 }
Esempio n. 6
0
use Phalcon\Version;
use Phwoolcon\Aliases;
use Phwoolcon\Cache;
use Phwoolcon\Config;
use Phwoolcon\Cookies;
use Phwoolcon\Db;
use Phwoolcon\DiFix;
use Phwoolcon\Events;
use Phwoolcon\I18n;
use Phwoolcon\Log;
use Phwoolcon\Queue;
use Phwoolcon\Router;
use Phwoolcon\Session;
use Phwoolcon\Util\Counter;
use Phwoolcon\View;
$_SERVER['PHWOOLCON_PHALCON_VERSION'] = Version::getId();
Events::register($di);
DiFix::register($di);
Db::register($di);
Cache::register($di);
Log::register($di);
Config::register($di);
Counter::register($di);
Aliases::register($di);
Router::register($di);
I18n::register($di);
Cookies::register($di);
Session::register($di);
View::register($di);
Queue::register($di);
$loader->registerNamespaces(Config::get('app.autoload.namespaces', []), true);