private static function driver() { $cacheType = strtolower(Configure::get('cache', 'type')); if ($cacheType == 'apc') { $cacheDriver = new ApcCache(); return $cacheDriver; } if ($cacheType == 'memcache') { $redisConfigure = Configure::get('cache', 'memcache'); $memcache = new Memcache(); $memcache->connect($redisConfigure['host'], $redisConfigure['port']); $cacheDriver = new MemcacheCache(); $cacheDriver->setMemcache($memcache); return $cacheDriver; } if ($cacheType == 'xcache') { $cacheDriver = new XcacheCache(); return $cacheDriver; } if ($cacheType == 'redis') { $redisConfigure = Configure::get('cache', 'redis'); $redis = new Redis(); $redis->connect($redisConfigure['host'], $redisConfigure['port']); $cacheDriver = new RedisCache(); $cacheDriver->setRedis($redis); return $cacheDriver; } }
public function __construct() { parent::__construct(); $redisHost = Configure::get('redis', 'host'); $redisPort = Configure::get('redis', 'port'); $this->connect($redisHost, $redisPort); }
function autoloadLibrary($className) { $className = str_replace('\\', '/', $className); $library = Configure::get('library', $className); if ($library) { require_once APPLICATION_ROOT . '/library/' . $library; return; } }
public function __construct() { parent::__construct(); $databaseType = Configure::get('database', 'type'); $database = Configure::get('database', $databaseType); $database['driver'] = $databaseType; $this->addConnection($database); $this->setAsGlobal(); $this->bootEloquent(); }
public static function init() { $databaseType = Configure::get('database.type'); if ($databaseType == 'mysql') { $databaseConfigure = Configure::get('database.mysql'); self::setup('mysql:host=' . $databaseConfigure['host'] . ';dbname=' . $databaseConfigure['databasename'], $databaseConfigure['account'], $databaseConfigure['password']); //for both mysql or mariaDB } else { self::setup(); } }
protected function configure() { echo Configure::get('database', 'mysql.host'); }
public static function init() { $routeType = Configure::get('route', 'type'); if ($routeType == 'symfony') { self::symfony(); } else { if ($routeType == 'map') { self::map(); } else { self::pathInfo(); } } }
public function test() { echo Configure::get('database.type'); }