public function __construct() { parent::__construct(); $redisHost = Config::get('redis.host'); $redisPort = Config::get('redis.port'); $this->connect($redisHost, $redisPort); }
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; }
function autoloadLibrary($className) { $className = str_replace('\\', '/', $className); $library = Config::get('library.' . $className); if ($library) { require_once APPLICATION_ROOT . '/library/' . $library; return; } }
public static function init() { $routeType = Config::get('route.type'); if ($routeType == 'symfony') { self::symfony(); } else { if ($routeType == 'map') { self::map(); } else { self::pathInfo(); } } }
protected function config() { echo Config::get('database.mysql.host'); }