예제 #1
0
파일: Cache.php 프로젝트: dezvell/mm.local
 /**
  * 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");
     }
 }
예제 #2
0
파일: flush.php 프로젝트: dezvell/skeleton
<?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");
    }
};
예제 #3
0
파일: stats.php 프로젝트: dezvell/skeleton
<?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');
    }
};
예제 #4
0
파일: index.php 프로젝트: dezvell/skeleton
<?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");
    }
};
예제 #5
0
파일: stats.php 프로젝트: bluzphp/skeleton
 */
/**
 * @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');
    }
};