private function init($namespace)
{
$prefix = self::$namespacePrefix;
$namespace = "{$prefix}:{$namespace}";
$type = 0;
if (static::$TYPE_PREFER_DEFAULT == 0) {
if (isset(static::$_TYPE)) {
$type = static::$_TYPE;
} else {
$type = static::$TYPE_DEFAULT;
}
} else {
$type = static::$TYPE_PREFER_DEFAULT;
}
if ($type == static::$TYPE_APC) {
$this->_cacheImplement = new ApcCache();
} else {
if ($type == static::$TYPE_MEMCACHE) {
$m = new MemcacheCache();
$memcache = new \Memcache();
$memcache->connect('localhost', 11211);
$m->setMemcache($memcache);
$this->_cacheImplement = $m;
} else {
if ($type == static::$TYPE_XCACHE) {
$this->_cacheImplement = new XcacheCache();
} else {
$this->_cacheImplement = new ArrayCache();
}
}
}
$this->_cacheImplement->setNamespace($namespace);
}