method __construct documentation in bbn\Cache

Constructor - this is a singleton: it can't be called more then once.

function(string $engine = NULL) { /** @todo APC doesn't work */ $engine = 'files'; if (self::$is_init) { throw new Exception( X::_("Only one cache object can be called. Use static function Cache::getEngine()") ); } if ((!$engine || ($engine === 'apc')) && function_exists('apc_clear_cache')) { self::_set_type('apc'); } elseif ((!$engine || ($engine === 'memcache')) && class_exists("Memcache")) { $this->obj = new \Memcache(); if ($this->obj->connect("127.0.0.1", 11211)) { self::_set_type('memcache'); } } elseif ($this->path = Mvc::getCachePath()) { self::_set_type('files'); $this->fs = new File\System(); } }

Constructor - this is a singleton: it can't be called more then once. BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way

This website uses cookies to ensure you get the best experience on our website.