'secure' => true
);
- $master = Horde_Kolab_Storage_Driver::factory(
- 'Imap',
- $params
+ $imap = Horde_Imap_Client::factory('socket', $params);
+
+ $master = new Horde_Kolab_Storage_Driver_Imap(
+ $imap
);
return new Horde_Kolab_Storage(
$master,
- 'Imap',
$params
);
}
protected $connections = array();
/**
- * The driver type for the base connection.
- *
- * @var string
- */
- private $_driver;
-
- /**
* The parameters for the base connection.
*
* @var array
*/
public function __construct(
Horde_Kolab_Storage_Driver $master,
- $driver, $params = array()
+ $params = array()
) {
$this->_master = $master;
- $this->_driver = $driver;
$this->_params = $params;
if (isset($this->_params['owner'])) {
abstract class Horde_Kolab_Storage_Driver
{
/**
- * Factory.
- *
- * @param string $driver The driver type used for the storage connection.
- * @param array $params Additional connection parameters.
- *
- * @return Horde_Kolab_Storage_List A concrete list instance.
- */
- static public function &factory($driver, $params = array())
- {
- $class = 'Horde_Kolab_Storage_Driver_' . ucfirst(basename($driver));
- if (class_exists($class)) {
- $driver = new $class($params);
- return $driver;
- }
- throw new Horde_Kolab_Storage_Exception(
- 'Driver type definition "' . $class . '" missing.');
- }
-
- /**
* Retrieve the namespace information for this connection.
*
* @return Horde_Kolab_Storage_Namespace The initialized namespace handler.
*
* @param array $params Connection parameters.
*/
- public function __construct($params = array())
- {
- if (isset($params['driver'])) {
- $driver = $params['driver'];
- unset($params['driver']);
- } else {
- $driver = 'socket';
- }
-
- $this->_imap = Horde_Imap_Client::factory($driver, $params);
+ public function __construct(
+ Horde_Imap_Client_Base $imap
+ ) {
+ $this->_imap = $imap;
}
/**