Create the storage backend driver.
public createDriver ( array $params = [] ) : Horde_Kolab_Storage_Driver | ||
$params | array | Any parameters that should overwrite the default parameters provided in the factory constructor. |
return | Horde_Kolab_Storage_Driver | The storage handler. |
/** * Get a folder list object for a "system" user. * * @param string $type The type of system user. * * @return Horde_Kolab_Storage_List The handler for the list of folders * present in the Kolab backend. */ public function getSystemList($type) { if (!isset($this->_params['system'][$type])) { if (!isset($this->_params['system'][''])) { throw new Horde_Kolab_Storage_Exception('No system users are available!'); } else { $params = $this->_params['system']['']; } } else { $params = $this->_params['system'][$type]; } return $this->getList($this->_factory->createDriver(array('params' => $params))); }
public function testTimerDecoration() { $logger = $this->getMockLogger(); $factory = new Horde_Kolab_Storage_Factory(array('driver' => 'mock', 'logger' => $logger, 'log' => array('driver_time'))); $this->assertInstanceOf('Horde_Kolab_Storage_Driver_Decorator_Timer', $factory->createDriver()); }
private function _getBrokenStore($params = array()) { $default_params = array('cache' => new Horde_Cache(new Horde_Cache_Storage_Mock()), 'driver' => 'mock', 'params' => array('username' => 'test', 'host' => 'localhost', 'port' => 143, 'data' => $this->getMockData(array('user/test' => null, 'user/test/Notes' => array('t' => 'note.default', 'm' => array(1 => array('stream' => fopen(__DIR__ . '/../../fixtures/broken_note.eml', 'r')))))))); $params = array_merge($default_params, $params); $factory = new Horde_Kolab_Storage_Factory($params); $driver = $factory->createDriver(); $storage = $this->createStorage($driver, $factory); return $storage->getData('INBOX/Notes'); }