DebugKit\Cache\Engine\DebugEngine::init PHP Method

init() public method

Initialize the proxied Cache Engine
public init ( array $config = [] ) : boolean
$config array Array of setting for the engine.
return boolean True, this engine cannot fail to initialize.
    public function init(array $config = [])
    {
        if (is_object($this->_config)) {
            $this->_engine = $this->_config;
            return true;
        }
        $registry = new CacheRegistry();
        $this->_engine = $registry->load('spies', $this->_config);
        unset($registry);
        return true;
    }

Usage Example

Example #1
0
 /**
  * Test that the normal errors bubble up still.
  *
  * @expectedException BadMethodCallException
  * @return void
  */
 public function testInitErrorOnInvalidConfig()
 {
     $engine = new DebugEngine(['className' => 'Derpy', 'path' => TMP]);
     $engine->init();
 }