Exemple #1
0
 private function init_viewcache($options = array())
 {
     $this->_di->set('viewCache', function () {
         $frontCache = new Phalcon\Cache\Frontend\Output(array("lifetime" => $this->_conf->viewcache->lifetime));
         /* $cache = new Rpp\Extend\Memcache($frontCache, array(
               "host" => $this->_conf->viewcache->memcache->host,
               "port" => $this->_conf->viewcache->memcache->port,
               "prefix" => $this->_conf->viewcache->memcache->prefix,
               "statsKey" => $this->_conf->viewcache->memcache->stats,
                                                      )
            );*/
         $cache = new Rpp\Extend\Libmemcached($frontCache, array("servers" => array(array('host' => $this->_conf->viewcache->memcache->host, 'port' => $this->_conf->viewcache->memcache->port, 'weight' => 1)), "prefix" => $this->_conf->viewcache->memcache->prefix, "statsKey" => $this->_conf->viewcache->memcache->stats));
         $cache->localconnect();
         return $cache;
     });
 }
Exemple #2
0
}));
$view->setVar("trackurl", true);
$view->setVar("host", $conf->server->host);
$view->setVar("eversion", $conf->estaticos->version);
$view->setVar("ehost", $conf->estaticos->host);
$di->set('view', $view);
$di->set('viewCache', function () use($conf) {
    $frontCache = new Phalcon\Cache\Frontend\Output(array("lifetime" => $conf->viewcache->lifetime));
    /*$cache = new Rpp\Extend\Publish\MemcacheView($frontCache, array(
         "host" => $conf->viewcache->memcache->host,
         "port" => $conf->viewcache->memcache->port,
         "prefix" => $conf->viewcache->memcache->prefix,
         "statsKey" => $conf->viewcache->memcache->stats,
                                                )
      );*/
    $cache = new Rpp\Extend\Libmemcached($frontCache, array("servers" => array(array('host' => $conf->viewcache->memcache->host, 'port' => $conf->viewcache->memcache->port, 'weight' => 1)), "prefix" => $conf->viewcache->memcache->prefix, "statsKey" => $conf->viewcache->memcache->stats));
    $cache->localconnect();
    return $cache;
});
$di->set('redis', function () use($conf) {
    $redis = new \Redis();
    $redis->connect($conf->redis->host, $conf->redis->port);
    return $redis;
}, true);
//Create a console application
$console = new ConsoleApp();
$console->setDI($di);
/**
 * Process the console arguments
 */
$arguments = array();