/** * Check and setup Redis server * * @param array $settings * @throws ConfigurationException */ public function __construct($settings = array()) { $this->handler = Proxy\Cache::getInstance(); if ($this->handler instanceof Nil) { throw new ConfigurationException("Cache configuration is missed or disabled. Please check 'cache' configuration section"); } }
<?php /** * Build list of routers * * @author Anton Shevchuk * @created 12.06.12 12:27 */ /** * @namespace */ namespace Application; use Bluz\Common\Nil; use Bluz\Proxy\Cache; use Bluz\Proxy\Messages; return function () { /** * @var Bootstrap $this */ if (!Cache::getInstance() instanceof Nil) { Cache::flush(); Messages::addSuccess("Cache is flushed"); } else { Messages::addNotice("Cache is disabled"); } };
<?php /** * Build list of routers * * @author Anton Shevchuk * @created 12.06.12 12:27 */ /** * @namespace */ namespace Application; use Bluz\Common\Nil; use Bluz\Proxy\Cache; use Bluz\Proxy\Layout; use Bluz\Proxy\Messages; return function () use($view) { /** * @var Bootstrap $this * @var \Bluz\View\View $view */ Layout::setTemplate('dashboard.phtml'); Layout::breadCrumbs([$view->ahref('Dashboard', ['dashboard', 'index']), $view->ahref('Cache', ['cache', 'index']), __('Statistics')]); if (!Cache::getInstance() instanceof Nil) { $view->adapter = Cache::getInstance()->getAdapter(); } else { Messages::addNotice("Cache is disabled"); $this->redirectTo('cache', 'index'); } };
<?php /** * Build list of routers * * @author Anton Shevchuk * @created 12.06.12 12:27 */ /** * @namespace */ namespace Application; use Bluz\Common\Nil; use Bluz\Proxy\Cache; use Bluz\Proxy\Layout; use Bluz\Proxy\Messages; return function () use($view) { /** * @var Bootstrap $this * @var \Bluz\View\View $view */ Layout::setTemplate('dashboard.phtml'); Layout::breadCrumbs([$view->ahref('Dashboard', ['dashboard', 'index']), __('Cache')]); if (!Cache::getInstance() instanceof Nil) { $view->adapter = get_class(Cache::getInstance()->getAdapter()); } else { $view->adapter = null; Messages::addNotice("Cache is disabled"); } };
*/ /** * @namespace */ namespace Application; use Bluz\Common\Nil; use Bluz\Controller\Controller; use Bluz\Proxy\Cache; use Bluz\Proxy\Layout; use Bluz\Proxy\Messages; use Bluz\Proxy\Response; /** * Statistics * * @privilege Management * @return void */ return function () { /** * @var Controller $this */ Layout::setTemplate('dashboard.phtml'); Layout::breadCrumbs([Layout::ahref('Dashboard', ['dashboard', 'index']), Layout::ahref('Cache', ['cache', 'index']), __('Statistics')]); if (!Cache::getInstance() instanceof Nil) { $this->assign('adapter', Cache::getInstance()->getAdapter()); } else { Messages::addNotice("Cache is disabled"); Response::redirectTo('cache', 'index'); } };