Esempio n. 1
0
 public function __construct()
 {
     parent::__construct();
     $redisHost = Config::get('redis.host');
     $redisPort = Config::get('redis.port');
     $this->connect($redisHost, $redisPort);
 }
Esempio n. 2
0
 private static function driver()
 {
     $cacheType = strtolower(Config::get('cache.type'));
     if ($cacheType == 'apc') {
         $cacheDriver = new ApcCache();
         return $cacheDriver;
     }
     if ($cacheType == 'memcache') {
         $memcacheConfig = Config::get('cache.memcache');
         $memcache = new Memcache();
         $memcache->connect($memcacheConfig['host'], $memcacheConfig['port']);
         $cacheDriver = new MemcacheCache();
         $cacheDriver->setMemcache($memcache);
         return $cacheDriver;
     }
     if ($cacheType == 'xcache') {
         $cacheDriver = new XcacheCache();
         return $cacheDriver;
     }
     if ($cacheType == 'redis') {
         $redisConfig = Config::get('cache.redis');
         $redis = new Redis();
         $redis->connect($redisConfig['host'], $redisConfig['port']);
         $cacheDriver = new RedisCache();
         $cacheDriver->setRedis($redis);
         return $cacheDriver;
     }
     return null;
 }
Esempio n. 3
0
function autoloadLibrary($className)
{
    $className = str_replace('\\', '/', $className);
    $library = Config::get('library.' . $className);
    if ($library) {
        require_once APPLICATION_ROOT . '/library/' . $library;
        return;
    }
}
Esempio n. 4
0
 public static function init()
 {
     $routeType = Config::get('route.type');
     if ($routeType == 'symfony') {
         self::symfony();
     } else {
         if ($routeType == 'map') {
             self::map();
         } else {
             self::pathInfo();
         }
     }
 }
Esempio n. 5
0
 protected function config()
 {
     echo Config::get('database.mysql.host');
 }