From 6db502748dbb4452496d556d30396a0767ef50ab Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Mon, 23 Aug 2010 16:09:15 +0200 Subject: [PATCH] Driver -> Transport --- ingo/config/backends.php.dist | 48 ++++++++++++++-------------- ingo/docs/CHANGES | 4 ++- ingo/lib/Application.php | 4 +-- ingo/lib/Ingo.php | 18 +++++------ ingo/lib/Script/Maildrop/Recipe.php | 6 ++-- ingo/lib/{Driver.php => Transport.php} | 6 ++-- ingo/lib/{Driver => Transport}/Ldap.php | 4 +-- ingo/lib/{Driver => Transport}/Null.php | 4 +-- ingo/lib/{Driver => Transport}/Sivtest.php | 4 +-- ingo/lib/{Driver => Transport}/Timsieved.php | 6 ++-- ingo/lib/{Driver => Transport}/Vfs.php | 4 +-- 11 files changed, 55 insertions(+), 53 deletions(-) rename ingo/lib/{Driver.php => Transport.php} (92%) rename ingo/lib/{Driver => Transport}/Ldap.php (98%) rename ingo/lib/{Driver => Transport}/Null.php (78%) rename ingo/lib/{Driver => Transport}/Sivtest.php (97%) rename ingo/lib/{Driver => Transport}/Timsieved.php (95%) rename ingo/lib/{Driver => Transport}/Vfs.php (97%) diff --git a/ingo/config/backends.php.dist b/ingo/config/backends.php.dist index 4306b9272..873b7365e 100644 --- a/ingo/config/backends.php.dist +++ b/ingo/config/backends.php.dist @@ -3,12 +3,12 @@ * Ingo works purely on a preferred mechanism for server selection. There are * a number of properties that you can set for each backend: * - * driver: (string) The Ingo_Driver:: driver to use to store the script on - * the backend server. Valid options: - * 'ldap' - LDAP server - * 'null' - No backend server - * 'timsieved' - Cyrus timsieved server - * 'vfs' - Use Horde VFS + * transport: (string) The Ingo_Transport driver to use to store the script on + * the backend server. Valid options: + * - 'ldap': LDAP server + * - 'null': No backend server + * - 'timsieved': Timsieved (managesieve) server + * - 'vfs': Use Horde VFS * * preferred: (string) This is the field that is used to choose which server * is used. The value for this field may be a single string or an @@ -16,24 +16,24 @@ * server. * * hordeauth: (mixed) One of the following: - * true - Ingo will attempt to use the user's existing credentials - * (the username/password they used to log in to Horde) to - * login to this source. (DEFAULT) - * 'full' - The username will be used unmodified. + * - true: Ingo will attempt to use the user's existing + * credentials (the username/password they used to log in + * to Horde) to login to this source. (DEFAULT) + * - 'full': The username will be used unmodified. * * params: (array) An array containing any additional information that the - * Ingo_Driver:: class needs. + * Ingo_Transport class needs. * * script: (string) The type of Ingo_Script driver this server uses. * Valid options: - * 'imap' - IMAP client side filtering (POP3 servers NOT - supported) - * 'maildrop' - Maildrop scripts - * 'procmail' - Procmail scripts - * 'sieve' - Sieve scripts + * - 'imap': IMAP client side filtering (POP3 servers NOT + * supported) + * - 'maildrop': Maildrop scripts + * - 'procmail': Procmail scripts + * - 'sieve': Sieve scripts * * scriptparams: (array) An array containing any additional information that - * the Ingo_Script:: driver needs. + * the Ingo_Script driver needs. * * shares: (boolean) Some drivers support sharing filter rules with other * users. Users can then configure filters for each other if they @@ -45,7 +45,7 @@ /* IMAP Example */ $backends['imap'] = array( - 'driver' => 'null', + 'transport' => 'null', 'preferred' => 'example.com', 'hordeauth' => true, 'params' => array(), @@ -56,7 +56,7 @@ $backends['imap'] = array( /* Maildrop Example */ $backends['maildrop'] = array( - 'driver' => 'vfs', + 'transport' => 'vfs', 'preferred' => 'example.com', 'hordeauth' => true, 'params' => array( @@ -114,7 +114,7 @@ $backends['maildrop'] = array( /* Procmail Example */ $backends['procmail'] = array( - 'driver' => 'vfs', + 'transport' => 'vfs', 'preferred' => 'example.com', 'hordeauth' => true, 'params' => array( @@ -187,7 +187,7 @@ $backends['procmail'] = array( /* Sieve Example */ $backends['sieve'] = array( - 'driver' => 'timsieved', + 'transport' => 'timsieved', 'preferred' => 'example.com', 'hordeauth' => true, 'params' => array( @@ -223,7 +223,7 @@ $backends['sieve'] = array( /* sivtest Example */ $backends['sivtest'] = array( - 'driver' => 'sivtest', + 'transport' => 'sivtest', 'preferred' => 'example.com', 'hordeauth' => true, 'params' => array( @@ -250,7 +250,7 @@ $backends['sivtest'] = array( /* Sun ONE/JES Example (LDAP/Sieve) */ $backends['ldapsieve'] = array( - 'driver' => 'ldap', + 'transport' => 'ldap', 'preferred' => 'example.com', 'hordeauth' => false, 'params' => array( @@ -319,7 +319,7 @@ if ($GLOBALS['conf']['kolab']['enabled']) { } $backends['kolab'] = array( - 'driver' => 'timsieved', + 'transport' => 'timsieved', 'preferred' => '', 'hordeauth' => 'full', 'params' => array( diff --git a/ingo/docs/CHANGES b/ingo/docs/CHANGES index 24330e491..0fc8960bd 100644 --- a/ingo/docs/CHANGES +++ b/ingo/docs/CHANGES @@ -2,8 +2,10 @@ v2.0-git -------- +[jan] Rename 'driver' configuration and classes to 'transport' to avoid + confusion with script and storage drivers. [mms] Use IMP API for IMAP actions. -[mms] Convert to Horde 5 standards. +[mms] Convert to Horde 4 standards. ---------- diff --git a/ingo/lib/Application.php b/ingo/lib/Application.php index 94042fc80..e750fe432 100644 --- a/ingo/lib/Application.php +++ b/ingo/lib/Application.php @@ -62,8 +62,8 @@ class Ingo_Application extends Horde_Registry_Application Ingo::createSession(); // Create shares if necessary. - $driver = Ingo::getDriver(); - if ($driver->supportShares()) { + $transport = Ingo::getTransport(); + if ($transport->supportShares()) { $GLOBALS['ingo_shares'] = $GLOBALS['injector']->getInstance('Horde_Share')->getScope(); $GLOBALS['all_rulesets'] = Ingo::listRulesets(); diff --git a/ingo/lib/Ingo.php b/ingo/lib/Ingo.php index 90039b5d8..9f31b8850 100644 --- a/ingo/lib/Ingo.php +++ b/ingo/lib/Ingo.php @@ -212,10 +212,10 @@ class Ingo */ static public function activateScript($script, $deactivate = false) { - $driver = self::getDriver(); + $transport = self::getTransport(); try { - $res = $driver->setScriptActive($script); + $res = $transport->setScriptActive($script); } catch (Ingo_Exception $e) { $msg = ($deactivate) ? _("There was an error deactivating the script.") @@ -243,7 +243,7 @@ class Ingo */ static public function getScript() { - return self::getDriver()->getScript(); + return self::getTransport()->getScript(); } /** @@ -311,8 +311,8 @@ class Ingo if (empty($backend['script'])) { throw new Ingo_Exception(sprintf(_("No \"%s\" element found in backend configuration."), 'script')); - } elseif (empty($backend['driver'])) { - throw new Ingo_Exception(sprintf(_("No \"%s\" element found in backend configuration."), 'driver')); + } elseif (empty($backend['transport'])) { + throw new Ingo_Exception(sprintf(_("No \"%s\" element found in backend configuration."), 'transport')); } /* Make sure the 'params' entry exists. */ @@ -336,12 +336,12 @@ class Ingo } /** - * Returns an instance of the configured driver. + * Returns an instance of the configured transport driver. * - * @return Ingo_Driver The configured driver. + * @return Ingo_Transport The configured driver. * @throws Ingo_Exception */ - static public function getDriver() + static public function getTransport() { $params = $_SESSION['ingo']['backend']['params']; @@ -358,7 +358,7 @@ class Ingo $params['password'] = $GLOBALS['registry']->getAuthCredential('password'); } - return Ingo_Driver::factory($_SESSION['ingo']['backend']['driver'], $params); + return Ingo_Transport::factory($_SESSION['ingo']['backend']['transport'], $params); } /** diff --git a/ingo/lib/Script/Maildrop/Recipe.php b/ingo/lib/Script/Maildrop/Recipe.php index 4e8d3679d..c4859e923 100644 --- a/ingo/lib/Script/Maildrop/Recipe.php +++ b/ingo/lib/Script/Maildrop/Recipe.php @@ -129,9 +129,9 @@ class Ingo_Script_Maildrop_Recipe // Writing vacation.msg file $reason = Horde_Mime::encode($params['action-value']['reason'], $scriptparams['charset']); - $driver = Ingo::getDriver(); - $driver->_connect(); - $result = $driver->_vfs->writeData($driver->_params['vfs_path'], 'vacation.msg', $reason, true); + $transport = Ingo::getTransport(); + $transport->_connect(); + $result = $transport->_vfs->writeData($transport->_params['vfs_path'], 'vacation.msg', $reason, true); // Rule : Do not send responses to bulk or list messages if ($params['action-value']['ignorelist'] == 1) { diff --git a/ingo/lib/Driver.php b/ingo/lib/Transport.php similarity index 92% rename from ingo/lib/Driver.php rename to ingo/lib/Transport.php index 96482c0f3..a97ad93da 100644 --- a/ingo/lib/Driver.php +++ b/ingo/lib/Transport.php @@ -1,6 +1,6 @@ * @package Ingo */ -class Ingo_Driver +class Ingo_Transport { /** * Driver specific parameters @@ -34,7 +34,7 @@ class Ingo_Driver * @param array $params A hash containing any additional configuration * or connection parameters a subclass might need. * - * @return Ingo_Driver The newly created concrete instance. + * @return Ingo_Transport The newly created concrete instance. * @throws Ingo_Exception */ static public function factory($driver, $params = array()) diff --git a/ingo/lib/Driver/Ldap.php b/ingo/lib/Transport/Ldap.php similarity index 98% rename from ingo/lib/Driver/Ldap.php rename to ingo/lib/Transport/Ldap.php index f4ec454e4..13263cf82 100644 --- a/ingo/lib/Driver/Ldap.php +++ b/ingo/lib/Transport/Ldap.php @@ -1,6 +1,6 @@ * @package Ingo */ -class Ingo_Driver_Ldap extends Ingo_Driver +class Ingo_Transport_Ldap extends Ingo_Transport { /** * Constructor. diff --git a/ingo/lib/Driver/Null.php b/ingo/lib/Transport/Null.php similarity index 78% rename from ingo/lib/Driver/Null.php rename to ingo/lib/Transport/Null.php index 231b6d8d0..ea501c0c2 100644 --- a/ingo/lib/Driver/Null.php +++ b/ingo/lib/Transport/Null.php @@ -1,6 +1,6 @@ * @package Ingo */ -class Ingo_Driver_Sivtest extends Ingo_Driver +class Ingo_Transport_Sivtest extends Ingo_Transport { /** * The Net_Sieve object. diff --git a/ingo/lib/Driver/Timsieved.php b/ingo/lib/Transport/Timsieved.php similarity index 95% rename from ingo/lib/Driver/Timsieved.php rename to ingo/lib/Transport/Timsieved.php index 42b33e782..6b187e0ab 100644 --- a/ingo/lib/Driver/Timsieved.php +++ b/ingo/lib/Transport/Timsieved.php @@ -1,7 +1,7 @@ * @package Ingo */ -class Ingo_Driver_Timsieved extends Ingo_Driver +class Ingo_Transport_Timsieved extends Ingo_Transport { /** * The Net_Sieve object. diff --git a/ingo/lib/Driver/Vfs.php b/ingo/lib/Transport/Vfs.php similarity index 97% rename from ingo/lib/Driver/Vfs.php rename to ingo/lib/Transport/Vfs.php index 7bd9f4133..c128bde11 100644 --- a/ingo/lib/Driver/Vfs.php +++ b/ingo/lib/Transport/Vfs.php @@ -1,6 +1,6 @@ * @package Ingo */ -class Ingo_Driver_Vfs extends Ingo_Driver +class Ingo_Transport_Vfs extends Ingo_Transport { /** * Constructs a new VFS-based storage driver. -- 2.11.0