Make all backends work with the listMailboxes() method. Add todos.
authorGunnar Wrobel <p@rdus.de>
Tue, 14 Dec 2010 17:25:42 +0000 (18:25 +0100)
committerGunnar Wrobel <p@rdus.de>
Tue, 14 Dec 2010 17:26:59 +0000 (18:26 +0100)
framework/Kolab_Storage/TODO
framework/Kolab_Storage/lib/Horde/Kolab/Storage/Cli.php
framework/Kolab_Storage/lib/Horde/Kolab/Storage/Driver/Cclient.php
framework/Kolab_Storage/lib/Horde/Kolab/Storage/Driver/Mock.php
framework/Kolab_Storage/lib/Horde/Kolab/Storage/Driver/Pear.php
framework/Kolab_Storage/lib/Horde/Kolab/Storage/Driver/Rcube.php [new file with mode: 0644]
framework/Kolab_Storage/lib/Horde/Kolab/Storage/Exception/Pear.php [new file with mode: 0644]
framework/Kolab_Storage/lib/Horde/Kolab/Storage/Factory.php
framework/Kolab_Storage/package.xml
framework/Kolab_Storage/test/Horde/Kolab/Storage/Unit/Cli/OptionsTest.php

index 32da9b4..3a5a11e 100644 (file)
    - getNamespace() [DONE]
 
  - replace imap_rfc822 use by Horde_Mail_Rfc822
+
+ - allow cli config file overriden by cli params
+
+ - performance tuning for the whole caching
+
+ - support cache searches in a better way
+
+ - Allow just any cache backend
+
+ - Evaluate redis as caching backend
+
+ - Allow storage of client information in the cache
index b3aae1c..8cc58f2 100644 (file)
@@ -84,12 +84,13 @@ class Horde_Kolab_Storage_Cli
                 '--driver',
                 array(
                     'action' => 'store',
-                    'choices' => array('horde', 'php', 'pear', 'roundcube', 'mock'),
+                    'choices' => array('horde', 'horde-php', 'php', 'pear', 'roundcube', 'mock'),
                     'help'   => Horde_Kolab_Storage_Translation::t(
 "The Kolab backend driver that should be used.
 Choices are:
 
- - horde     [IMAP]: The Horde_Imap_Client driver
+ - horde     [IMAP]: The Horde_Imap_Client driver as pure PHP implementation.
+ - horde-php [IMAP]: The Horde_Imap_Client driver based on c-client in PHP
  - php       [IMAP]: The PHP imap_* functions which are based on c-client
  - pear      [IMAP]: The PEAR-Net_IMAP driver
  - roundcube [IMAP]: The roundcube IMAP driver
@@ -99,7 +100,7 @@ Choices are:
             ),
             new Horde_Argv_Option(
                 '-u',
-                '--user',
+                '--username',
                 array(
                     'action' => 'store',
                     'help'   => Horde_Kolab_Storage_Translation::t('The user accessing the backend.')
@@ -107,7 +108,7 @@ Choices are:
             ),
             new Horde_Argv_Option(
                 '-p',
-                '--pass',
+                '--password',
                 array(
                     'action' => 'store',
                     'help'   => Horde_Kolab_Storage_Translation::t('The password of the user accessing the backend.')
index 97b6ab0..4df47b2 100644 (file)
@@ -29,23 +29,134 @@ class Horde_Kolab_Storage_Driver_Cclient
 extends Horde_Kolab_Storage_Driver_Base
 {
     /**
+     * IMAP resource.
+     *
+     * @var resource
+     */
+    private $_imap;
+
+    /**
+     * Server name.
+     *
+     * @var string
+     */
+    private $_host;
+
+    /**
+     * Basic IMAP connection string.
+     *
+     * @var string
+     */
+    private $_base_mbox;
+
+    /**
+     * Lazy connect to the IMAP server.
+     *
+     * @return resource The IMAP connection.
+     *
+     * @throws Horde_Kolab_Storage_Exception In case the connection failed.
+     */
+    private function _getImap()
+    {
+        if (!isset($this->_imap)) {
+            $result = @imap_open(
+                $this->_getBaseMbox(),
+                $this->getParam('username'),
+                $this->getParam('password'),
+                OP_HALFOPEN
+            );
+            if (!$result) {
+                throw new Horde_Kolab_Storage_Exception(
+                    sprintf(
+                        Horde_Kolab_Storage_Translation::t(
+                            "Connecting to server %s failed. Error: %s"
+                        ),
+                        $this->_getHost(),
+                        @imap_last_error()
+                    )
+                );
+            }
+            $this->_imap = $result;
+        }
+        return $this->_imap;
+    }
+
+    /**
+     * Return the root mailbox of the current user.
+     *
+     * @return string The id of the user that opened the IMAP connection.
+     */
+    private function _getBaseMbox()
+    {
+        if (!isset($this->_base_mbox)) {
+            $this->_base_mbox = '{' . $this->_getHost() . ':143/notls}';
+        }
+        return $this->_base_mbox;
+    }
+
+    /**
      * Return the id of the user currently authenticated.
      *
      * @return string The id of the user that opened the IMAP connection.
      */
     public function getAuth()
     {
-        return $this->_imap->getParam('username');
+        return $this->getParam('username');
+    }
+
+    /**
+     * Return the root mailbox of the current user.
+     *
+     * @return string The id of the user that opened the IMAP connection.
+     */
+    private function _getHost()
+    {
+        if (!isset($this->_host)) {
+            $this->_host = $this->getParam('host');
+            if (empty($this->_host)) {
+                throw new Horde_Kolab_Storage_Exception(
+                    Horde_Kolab_Storage_Translation::t(
+                        "Missing \"host\" parameter!"
+                    )
+                );
+            }
+        }
+        return $this->_host;
     }
 
     /**
      * Retrieves a list of mailboxes on the server.
      *
      * @return array The list of mailboxes.
+     *
+     * @throws Horde_Kolab_Storage_Exception In case listing the folders failed.
      */
     public function getMailboxes()
     {
-        return $this->_imap->listMailboxes('*', Horde_Imap_Client::MBOX_ALL, array('flat' => true));
+        $folders = array();
+
+        $result = @imap_list($this->_getImap(), $this->_getBaseMbox(), '*');
+        if (!$result) {
+            throw new Horde_Kolab_Storage_Exception(
+                sprintf(
+                    Horde_Kolab_Storage_Translation::t(
+                        "Listing folders for %s failed. Error: %s"
+                    ),
+                    $this->_getBaseMbox(),
+                    @imap_last_error()
+                )
+            );
+        }
+
+        $root = $this->_getBaseMbox();
+        $server_len = strlen($root);
+        foreach ($result as $folder) {
+            if (substr($folder, 0, $server_len) == $root) {
+                $folders[] = substr($folder, $server_len);
+            }
+        }
+
+        return $folders;
     }
 
     /**
index b58e604..be73326 100644 (file)
@@ -52,7 +52,7 @@ extends Horde_Kolab_Storage_Driver_Base
     /**
      * Constructor.
      *
-     * @param array $params        Connection parameters.
+     * @param array $params Connection parameters.
      */
     public function __construct($params = array())
     {
@@ -86,7 +86,7 @@ extends Horde_Kolab_Storage_Driver_Base
      */
     public function getAuth()
     {
-        return $this->getParam('user');
+        return $this->getParam('username');
     }
 
     /**
index 2c46d1b..312f960 100644 (file)
@@ -29,17 +29,16 @@ class Horde_Kolab_Storage_Driver_Pear
 extends Horde_Kolab_Storage_Driver_Base
 {
     /**
-     * The group handler for this connection.
+     * The IMAP client.
      *
-     * @var Horde_Group
+     * @var Net_IMAP
      */
-    private $_groups;
+    private $_imap;
 
     /**
      * Constructor.
      *
      * @param Net_IMAP $imap      The IMAP connection handler.
-     * @param Horde_Group $groups The groups handler.
      * @param array $params        Connection parameters.
      */
     public function __construct(
@@ -57,7 +56,7 @@ extends Horde_Kolab_Storage_Driver_Base
      */
     public function getAuth()
     {
-        return $this->_imap->getParam('username');
+        return $this->getParam('username');
     }
 
     /**
@@ -67,7 +66,7 @@ extends Horde_Kolab_Storage_Driver_Base
      */
     public function getMailboxes()
     {
-        return $this->_imap->listMailboxes('*', Horde_Imap_Client::MBOX_ALL, array('flat' => true));
+        return $this->_imap->getMailboxes();
     }
 
     /**
diff --git a/framework/Kolab_Storage/lib/Horde/Kolab/Storage/Driver/Rcube.php b/framework/Kolab_Storage/lib/Horde/Kolab/Storage/Driver/Rcube.php
new file mode 100644 (file)
index 0000000..5f15ced
--- /dev/null
@@ -0,0 +1,434 @@
+<?php
+/**
+ * A Roundcube Imap based Kolab storage driver.
+ *
+ * PHP version 5
+ *
+ * @category Kolab
+ * @package  Kolab_Storage
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Kolab_Storage
+ */
+
+/**
+ * A Roundcube Imap based Kolab storage driver.
+ *
+ * Copyright 2010 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
+ *
+ * @category Kolab
+ * @package  Kolab_Storage
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Kolab_Storage
+ */
+class Horde_Kolab_Storage_Driver_Rcube
+extends Horde_Kolab_Storage_Driver_Base
+{
+    /**
+     * The IMAP client.
+     *
+     * @var rcube_imap_generic
+     */
+    private $_imap;
+
+    /**
+     * Constructor.
+     *
+     * @param rcube_imap_generic $imap   The IMAP connection handler.
+     * @param array              $params Connection parameters.
+     */
+    public function __construct(
+        rcube_imap_generic $imap,
+        $params = array()
+    ) {
+        $this->_imap = $imap;
+        parent::__construct($params);
+    }
+
+    /**
+     * Return the id of the user currently authenticated.
+     *
+     * @return string The id of the user that opened the IMAP connection.
+     */
+    public function getAuth()
+    {
+        return $this->getParam('username');
+    }
+
+    /**
+     * Retrieves a list of mailboxes on the server.
+     *
+     * @return array The list of mailboxes.
+     */
+    public function getMailboxes()
+    {
+        return $this->_imap->listMailboxes('', '*');
+    }
+
+    /**
+     * Opens the given folder.
+     *
+     * @param string $folder  The folder to open
+     *
+     * @return mixed  True in case the folder was opened successfully, a PEAR
+     *                error otherwise.
+     */
+    public function select($folder)
+    {
+        $this->_imap->openMailbox($folder, Horde_Imap_Client::OPEN_AUTO);
+        return true;
+    }
+
+    /**
+     * Does the given folder exist?
+     *
+     * @param string $folder The folder to check.
+     *
+     * @return boolean True in case the folder exists, false otherwise.
+     */
+    public function exists($folder)
+    {
+        $folders = $this->getMailboxes();
+        if (in_array($folder, $folders)) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * Returns the status of the current folder.
+     *
+     * @param string $folder Check the status of this folder.
+     *
+     * @return array  An array that contains 'uidvalidity' and 'uidnext'.
+     */
+    public function status($folder)
+    {
+        return $this->_imap->status($folder,
+                                    Horde_Imap_Client::STATUS_UIDNEXT
+                                    | Horde_Imap_Client::STATUS_UIDVALIDITY);
+    }
+
+    /**
+     * Returns the message ids of the messages in this folder.
+     *
+     * @param string $folder Check the status of this folder.
+     *
+     * @return array  The message ids.
+     */
+    public function getUids($folder)
+    {
+        $search_query = new Horde_Imap_Client_Search_Query();
+        $search_query->flag('DELETED', false);
+        $uidsearch = $this->_imap->search($folder, $search_query);
+        $uids = $uidsearch['match'];
+        return $uids;
+    }
+
+    /**
+     * Create the specified folder.
+     *
+     * @param string $folder The folder to create.
+     *
+     * @return mixed True in case the operation was successfull, a
+     *               PEAR error otherwise.
+     */
+    public function create($folder)
+    {
+        return $this->_imap->createMailbox($folder);
+    }
+
+    /**
+     * Delete the specified folder.
+     *
+     * @param string $folder  The folder to delete.
+     *
+     * @return mixed True in case the operation was successfull, a
+     *               PEAR error otherwise.
+     */
+    public function delete($folder)
+    {
+        return $this->_imap->deleteMailbox($folder);
+    }
+
+    /**
+     * Rename the specified folder.
+     *
+     * @param string $old  The folder to rename.
+     * @param string $new  The new name of the folder.
+     *
+     * @return mixed True in case the operation was successfull, a
+     *               PEAR error otherwise.
+     */
+    public function rename($old, $new)
+    {
+        return $this->_imap->renameMailbox($old, $new);
+    }
+
+    /**
+     * Appends a message to the current folder.
+     *
+     * @param string $mailbox The mailbox to append the message(s) to. Either
+     *                        in UTF7-IMAP or UTF-8.
+     * @param string $msg     The message to append.
+     *
+     * @return mixed  True or a PEAR error in case of an error.
+     */
+    public function appendMessage($mailbox, $msg)
+    {
+        return $this->_imap->append($mailbox, array(array('data' => $msg)));
+    }
+
+    /**
+     * Deletes messages from the current folder.
+     *
+     * @param integer $uids  IMAP message ids.
+     *
+     * @return mixed  True or a PEAR error in case of an error.
+     */
+    public function deleteMessages($mailbox, $uids)
+    {
+        if (!is_array($uids)) {
+            $uids = array($uids);
+        }
+        return $this->_imap->store($mailbox, array('add' => array('\\deleted'), 'ids' => $uids));
+    }
+
+    /**
+     * Moves a message to a new folder.
+     *
+     * @param integer $uid        IMAP message id.
+     * @param string $new_folder  Target folder.
+     *
+     * @return mixed  True or a PEAR error in case of an error.
+     */
+    public function moveMessage($old_folder, $uid, $new_folder)
+    {
+        $options = array('ids' => array($uid), 'move' => true);
+        return $this->_imap->copy($old_folder, $new_folder, $options);
+    }
+
+    /**
+     * Expunges messages in the current folder.
+     *
+     * @param string $mailbox The mailbox to append the message(s) to. Either
+     *                        in UTF7-IMAP or UTF-8.
+     *
+     * @return mixed  True or a PEAR error in case of an error.
+     */
+    public function expunge($mailbox)
+    {
+        return $this->_imap->expunge($mailbox);
+    }
+
+    /**
+     * Retrieves the message headers for a given message id.
+     *
+     * @param string $mailbox The mailbox to append the message(s) to. Either
+     *                        in UTF7-IMAP or UTF-8.
+     * @param int $uid                The message id.
+     * @param boolean $peek_for_body  Prefetch the body.
+     *
+     * @return mixed  The message header or a PEAR error in case of an error.
+     */
+    function getMessageHeader($mailbox, $uid, $peek_for_body = true)
+    {
+        $options = array('ids' => array($uid));
+        $criteria = array(
+            Horde_Imap_Client::FETCH_HEADERTEXT => array(
+                array(
+                )
+            )
+        );
+        $result = $this->_imap->fetch($mailbox, $criteria, $options);
+        return $result[$uid]['headertext'][0];
+    }
+
+    /**
+     * Retrieves the message body for a given message id.
+     *
+     * @param string $mailbox The mailbox to append the message(s) to. Either
+     *                        in UTF7-IMAP or UTF-8.
+     * @param integet $uid  The message id.
+     *
+     * @return mixed  The message body or a PEAR error in case of an error.
+     */
+    function getMessageBody($mailbox, $uid)
+    {
+        $options = array('ids' => array($uid));
+        $criteria = array(
+            Horde_Imap_Client::FETCH_BODYTEXT => array(
+                array(
+                )
+            )
+        );
+        $result = $this->_imap->fetch($mailbox, $criteria, $options);
+        return $result[$uid]['bodytext'][0];
+    }
+
+    /**
+     * Retrieve the access rights for a folder.
+     *
+     * @param Horde_Kolab_Storage_Folder $folder The folder to retrieve the ACL for.
+     *
+     * @return An array of rights.
+     */
+    public function getAcl(Horde_Kolab_Storage_Folder $folder)
+    {
+        //@todo: Separate driver class
+        if ($this->_imap->queryCapability('ACL') === true) {
+            if ($folder->getOwner() == $this->getAuth()) {
+                try {
+                    return $this->_getAcl($folder->getName());
+                } catch (Exception $e) {
+                    return array($this->getAuth() => $this->_getMyAcl($folder->getName()));
+                }
+            } else {
+                $acl = $this->_getMyAcl($folder->getName());
+                if (strpos($acl, 'a')) {
+                    try {
+                        return $this->_getAcl($folder->getName());
+                    } catch (Exception $e) {
+                    }
+                }
+                return array($this->getAuth() => $acl);
+            }
+        } else {
+            return array($this->getAuth() => 'lrid');
+        }
+    }
+
+    /**
+     * Retrieve the access rights for a folder.
+     *
+     * @param string $folder The folder to retrieve the ACL for.
+     *
+     * @return An array of rights.
+     */
+    private function _getAcl($folder)
+    {
+        $acl = $this->_imap->getACL($folder);
+        $result = array();
+        foreach ($acl as $user => $rights) {
+            $result[$user] = join('', $rights);
+        }
+        return $result;
+    }
+    
+    /**
+     * Retrieve the access rights on a folder for the current user.
+     *
+     * @param string $folder The folder to retrieve the ACL for.
+     *
+     * @return An array of rights.
+     */
+    private function _getMyAcl($folder)
+    {
+        return $this->_imap->getMyACLRights($folder);
+    }
+
+    /**
+     * Set the access rights for a folder.
+     *
+     * @param string $folder  The folder to act upon.
+     * @param string $user    The user to set the ACL for.
+     * @param string $acl     The ACL.
+     *
+     * @return NULL
+     */
+    public function setAcl($folder, $user, $acl)
+    {
+        //@todo: Separate driver class
+        if ($this->_imap->queryCapability('ACL') === true) {
+            $this->_imap->setACL($folder, $user, array('rights' => $acl));
+        }
+    }
+
+    /**
+     * Delete the access rights for user on a folder.
+     *
+     * @param string $folder  The folder to act upon.
+     * @param string $user    The user to delete the ACL for
+     *
+     * @return NULL
+     */
+    public function deleteAcl($folder, $user)
+    {
+        //@todo: Separate driver class
+        if ($this->_imap->queryCapability('ACL') === true) {
+            $this->_imap->setACL($folder, $user, array('remove' => true));
+        }
+    }
+
+    /**
+     * Fetches the annotation on a folder.
+     *
+     * @param string $entry         The entry to fetch.
+     * @param string $mailbox_name  The name of the folder.
+     *
+     * @return mixed  The annotation value or a PEAR error in case of an error.
+     */
+    public function getAnnotation($entry, $mailbox_name)
+    {
+        try {
+            $result = $this->_imap->getMetadata($mailbox_name, $entry);
+        } catch (Exception $e) {
+            return '';
+        }
+        return isset($result[$mailbox_name][$entry]) ? $result[$mailbox_name][$entry] : '';
+    }
+
+    /**
+     * Sets the annotation on a folder.
+     *
+     * @param string $entry          The entry to set.
+     * @param array  $value          The values to set
+     * @param string $mailbox_name   The name of the folder.
+     *
+     * @return mixed  True if successfull, a PEAR error otherwise.
+     */
+    public function setAnnotation($entry, $value, $mailbox_name)
+    {
+        return $this->_imap->setMetadata($mailbox_name,
+                                         array($entry => $value));
+    }
+
+
+    /**
+     * Retrieve the namespace information for this connection.
+     *
+     * @return Horde_Kolab_Storage_Driver_Namespace The initialized namespace handler.
+     */
+    public function getNamespace()
+    {
+        if ($this->_imap->hasCapability('NAMESPACE') === true) {
+            $namespaces = array();
+            foreach ($this->_imap->getNamespace() as $type => $elements) {
+                foreach ($elements as $namespace) {
+                    switch ($type) {
+                    case 'personal':
+                        $namespace['type'] = 'personal';
+                        break;
+                    case 'others':
+                        $namespace['type'] = 'other';
+                        break;
+                    case 'shared':
+                        $namespace['type'] = 'shared';
+                        break;
+                    }
+                    $namespace['delimiter'] = $namespace['delimter'];
+                    $namespaces[] = $namespace;
+                }
+            }
+            return new Horde_Kolab_Storage_Driver_Namespace_Imap(
+                $namespaces,
+                $this->getParam('namespaces', array())
+            );
+        }
+        return parent::getNamespace();
+    }
+}
\ No newline at end of file
diff --git a/framework/Kolab_Storage/lib/Horde/Kolab/Storage/Exception/Pear.php b/framework/Kolab_Storage/lib/Horde/Kolab/Storage/Exception/Pear.php
new file mode 100644 (file)
index 0000000..54e6171
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+/**
+ * This class converts PEAR errors into exceptions for the Kolab_Storage
+ * package.
+ *
+ * PHP version 5
+ *
+ * @category Horde
+ * @package  Kolab_Storage
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Kolab_Storage
+ */
+
+/**
+ * This class converts PEAR errors into exceptions for the Kolab_Storage
+ * package.
+ *
+ * Copyright 2010 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
+ *
+ * @category Horde
+ * @package  Kolab_Storage
+ * @author   Gunnar Wrobel <wrobel@pardus.de>
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @link     http://pear.horde.org/index.php?package=Kolab_Storage
+ */
+class Horde_Kolab_Storage_Exception_Pear
+extends Horde_Exception_Pear
+{
+    /**
+     * Exception handling.
+     *
+     * @param mixed $result The result to be checked for a PEAR_Error.
+     *
+     * @return mixed Returns the original result if it was no PEAR_Error.
+     *
+     * @throws Horde_Exception_Pear In case the result was a PEAR_Error.
+     */
+    static public function catchError($result)
+    {
+        self::$_class = __CLASS__;
+        return parent::catchError($result);
+    }
+}
index 3b18cf3..a0319a0 100644 (file)
@@ -85,7 +85,7 @@ class Horde_Kolab_Storage_Factory
             );
         }
         if (isset($params['params'])) {
-            $config = $params['params'];
+            $config = (array) $params['params'];
         } else {
             $config = array();
         }
@@ -93,11 +93,52 @@ class Horde_Kolab_Storage_Factory
         case 'mock':
             $config['data'] = array('user/test' => array());
             return new Horde_Kolab_Storage_Driver_Mock($config);
+        case 'horde':
+            $config['hostspec'] = $config['host'];
+            unset($config['host']);
+            return new Horde_Kolab_Storage_Driver_Imap(
+                new Horde_Imap_Client_Socket(
+                    $config
+                )
+            );
+        case 'horde-php':
+            $config['hostspec'] = $config['host'];
+            unset($config['host']);
+            return new Horde_Kolab_Storage_Driver_Imap(
+                new Horde_Imap_Client_Cclient(
+                    $config
+                )
+            );
+        case 'php':
+            return new Horde_Kolab_Storage_Driver_Cclient($config);
+        case 'pear':
+            $client = new Net_IMAP($config['host']);
+            Horde_Kolab_Storage_Exception_Pear::catchError(
+                $client->login($config['username'], $config['password'])
+            );
+            return new Horde_Kolab_Storage_Driver_Pear(
+                $client, $config
+            );
+        case 'roundcube':
+            $client = new rcube_imap_generic();
+            $client->connect(
+                $config['host'], $config['username'], $config['password'],
+                array(
+                    'debug_mode' => false,
+                    'ssl_mode' => false,
+                    'port' => 143,
+                    'timeout' => 0,
+                    'force_caps' => false,
+                )
+            );
+            return new Horde_Kolab_Storage_Driver_Rcube(
+                $client, $config
+            );
         default:
             throw new Horde_Kolab_Storage_Exception(
                 sprintf(
                     Horde_Kolab_Storage_Translation::t(
-                        'Invalid "driver" parameter "%s". Please use one of "mock", "php", "pear", "horde", "horde-socket", and "roundcube"!'
+                        'Invalid "driver" parameter "%s". Please use one of "mock", "php", "pear", "horde", "horde-php", and "roundcube"!'
                     ),
                     $params['driver']
                 )
index aa6a3e4..deee53c 100644 (file)
@@ -32,7 +32,7 @@
   <active>yes</active>
  </lead>
  <date>2010-12-14</date>
- <time>10:46:22</time>
+ <time>18:18:05</time>
  <version>
   <release>0.4.0</release>
   <api>0.1.0</api>
         <file name="Mock.php" role="php" />
         <file name="Namespace.php" role="php" />
         <file name="Pear.php" role="php" />
+        <file name="Rcube.php" role="php" />
        </dir> <!-- /lib/Horde/Kolab/Storage/Driver -->
+       <dir name="Exception">
+        <file name="Pear.php" role="php" />
+       </dir> <!-- /lib/Horde/Kolab/Storage/Exception -->
        <dir name="Folder">
         <dir name="Decorator">
          <file name="Base.php" role="php" />
        <file name="Exception.php" role="php" />
        <file name="Factory.php" role="php" />
        <file name="Folder.php" role="php" />
+       <file name="Pear.php" role="php" />
        <file name="Translation.php" role="php">
         <tasks:replace from="@data_dir@" to="data_dir" type="pear-config" />
        </file>
     <channel>pear.php.net</channel>
    </package>
    <package>
+    <name>Exception</name>
+    <channel>pear.horde.org</channel>
+   </package>
+   <package>
     <name>HTTP_Request</name>
     <channel>pear.php.net</channel>
    </package>
    <install as="Horde/Kolab/Storage/Exception.php" name="lib/Horde/Kolab/Storage/Exception.php" />
    <install as="Horde/Kolab/Storage/Factory.php" name="lib/Horde/Kolab/Storage/Factory.php" />
    <install as="Horde/Kolab/Storage/Folder.php" name="lib/Horde/Kolab/Storage/Folder.php" />
+   <install as="Horde/Kolab/Storage/Pear.php" name="lib/Horde/Kolab/Storage/Pear.php" />
    <install as="Horde/Kolab/Storage/Translation.php" name="lib/Horde/Kolab/Storage/Translation.php" />
    <install as="Horde/Kolab/Storage/Driver/Base.php" name="lib/Horde/Kolab/Storage/Driver/Base.php" />
    <install as="Horde/Kolab/Storage/Driver/Cclient.php" name="lib/Horde/Kolab/Storage/Driver/Cclient.php" />
    <install as="Horde/Kolab/Storage/Driver/Mock.php" name="lib/Horde/Kolab/Storage/Driver/Mock.php" />
    <install as="Horde/Kolab/Storage/Driver/Namespace.php" name="lib/Horde/Kolab/Storage/Driver/Namespace.php" />
    <install as="Horde/Kolab/Storage/Driver/Pear.php" name="lib/Horde/Kolab/Storage/Driver/Pear.php" />
+   <install as="Horde/Kolab/Storage/Driver/Rcube.php" name="lib/Horde/Kolab/Storage/Driver/Rcube.php" />
    <install as="Horde/Kolab/Storage/Driver/Decorator/Base.php" name="lib/Horde/Kolab/Storage/Driver/Decorator/Base.php" />
    <install as="Horde/Kolab/Storage/Driver/Decorator/Log.php" name="lib/Horde/Kolab/Storage/Driver/Decorator/Log.php" />
    <install as="Horde/Kolab/Storage/Driver/Namespace/Config.php" name="lib/Horde/Kolab/Storage/Driver/Namespace/Config.php" />
    <install as="Horde/Kolab/Storage/Driver/Namespace/Element/Personal.php" name="lib/Horde/Kolab/Storage/Driver/Namespace/Element/Personal.php" />
    <install as="Horde/Kolab/Storage/Driver/Namespace/Element/Shared.php" name="lib/Horde/Kolab/Storage/Driver/Namespace/Element/Shared.php" />
    <install as="Horde/Kolab/Storage/Driver/Namespace/Element/SharedWithPrefix.php" name="lib/Horde/Kolab/Storage/Driver/Namespace/Element/SharedWithPrefix.php" />
+   <install as="Horde/Kolab/Storage/Exception/Pear.php" name="lib/Horde/Kolab/Storage/Exception/Pear.php" />
    <install as="Horde/Kolab/Storage/Folder/Base.php" name="lib/Horde/Kolab/Storage/Folder/Base.php" />
    <install as="Horde/Kolab/Storage/Folder/Permission.php" name="lib/Horde/Kolab/Storage/Folder/Permission.php" />
    <install as="Horde/Kolab/Storage/Folder/Decorator/Base.php" name="lib/Horde/Kolab/Storage/Folder/Decorator/Base.php" />
index 2dcc45e..ef047f7 100644 (file)
@@ -63,7 +63,7 @@ extends Horde_Kolab_Storage_TestCase
             'kolab-storage'
         );
         $this->assertRegExp(
-            '/-u[ ]*USER,[ ]*--user=USER/',
+            '/-u[ ]*USERNAME,[ ]*--username=USERNAME/',
             $this->runCli()
         );
     }
@@ -74,7 +74,7 @@ extends Horde_Kolab_Storage_TestCase
             'kolab-storage'
         );
         $this->assertRegExp(
-            '/-p[ ]*PASS,[ ]*--pass=PASS/',
+            '/-p[ ]*PASSWORD,[ ]*--password=PASSWORD/',
             $this->runCli()
         );
     }