From 0b950af7b46d5cb5998ddb74a7e6d97f4846355c Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Wed, 26 Jan 2011 12:20:45 -0700 Subject: [PATCH] Move app Injector/Factory to just Factory/ Mirrors use of Horde_Core_Factory. Additionally, these factory injectors don't extend any Horde_Injector class. --- ansel/lib/Application.php | 8 ++-- ansel/lib/{Injector => }/Factory/Faces.php | 4 +- ansel/lib/{Injector => }/Factory/Storage.php | 2 +- ansel/lib/{Injector => }/Factory/Styles.php | 4 +- hermes/lib/Application.php | 2 +- hermes/lib/{Injector => }/Factory/Driver.php | 2 +- imp/bin/query_imap_cache | 2 +- imp/compose-dimp.php | 2 +- imp/compose-mimp.php | 4 +- imp/compose.php | 4 +- imp/config/hooks.php.dist | 2 +- imp/folders-mimp.php | 2 +- imp/folders.php | 6 +-- imp/lib/Ajax/Application.php | 34 ++++++++--------- imp/lib/Api.php | 6 +-- imp/lib/Application.php | 28 +++++++------- imp/lib/Auth.php | 8 ++-- imp/lib/Block/Newmail.php | 2 +- imp/lib/Compose.php | 22 +++++------ imp/lib/Contents.php | 18 ++++----- imp/lib/{Injector => }/Factory/AuthImap.php | 2 +- imp/lib/{Injector => }/Factory/Compose.php | 2 +- imp/lib/{Injector => }/Factory/Contents.php | 2 +- imp/lib/{Injector => }/Factory/Flags.php | 2 +- imp/lib/{Injector => }/Factory/Identity.php | 2 +- imp/lib/{Injector => }/Factory/Imap.php | 2 +- imp/lib/{Injector => }/Factory/Imaptree.php | 2 +- imp/lib/{Injector => }/Factory/Mail.php | 4 +- imp/lib/{Injector => }/Factory/MailboxList.php | 2 +- imp/lib/{Injector => }/Factory/MimeViewer.php | 2 +- imp/lib/{Injector => }/Factory/Pgp.php | 2 +- imp/lib/{Injector => }/Factory/Quota.php | 4 +- imp/lib/{Injector => }/Factory/Search.php | 2 +- imp/lib/{Injector => }/Factory/Sentmail.php | 2 +- imp/lib/{Injector => }/Factory/Smime.php | 2 +- imp/lib/Filter.php | 4 +- imp/lib/Flag/User.php | 2 +- imp/lib/Flags.php | 2 +- imp/lib/Folder.php | 18 ++++----- imp/lib/IMP.php | 6 +-- imp/lib/Imap/Acl.php | 8 ++-- imp/lib/Imap/Tree.php | 12 +++--- imp/lib/Imap/Tree/Element.php | 2 +- imp/lib/Indices.php | 4 +- .../LoginTasks/SystemTask/UpgradeFromImp4Auth.php | 2 +- imp/lib/Mailbox/List.php | 14 +++---- imp/lib/Message.php | 20 +++++----- imp/lib/Mime/Viewer/Partial.php | 2 +- imp/lib/Notification/Handler/Decorator/Imap.php | 2 +- imp/lib/Prefs/Identity.php | 2 +- imp/lib/Prefs/Ui.php | 14 +++---- imp/lib/Quota/Mdaemon.php | 2 +- imp/lib/Search.php | 2 +- imp/lib/Spam.php | 6 +-- imp/lib/Ui/Block.php | 2 +- imp/lib/Ui/Compose.php | 2 +- imp/lib/Ui/Message.php | 2 +- imp/lib/Views/Compose.php | 4 +- imp/lib/Views/ListMessages.php | 4 +- imp/lib/Views/ShowMessage.php | 4 +- imp/mailbox-mimp.php | 4 +- imp/mailbox.php | 4 +- imp/message-dimp.php | 2 +- imp/message-mimp.php | 10 ++--- imp/message.php | 14 +++---- imp/mobile.php | 2 +- imp/pgp.php | 2 +- imp/rss.php | 2 +- imp/saveimage.php | 2 +- imp/smime.php | 2 +- imp/templates/dimp/index.inc | 2 +- imp/thread.php | 6 +-- imp/view.php | 4 +- jonah/lib/Application.php | 2 +- jonah/lib/{Injector => }/Factory/Driver.php | 8 ++-- kronolith/lib/Ajax/Application.php | 2 +- kronolith/lib/Application.php | 2 +- kronolith/lib/{Injector => }/Factory/Driver.php | 4 +- kronolith/lib/{Injector => }/Factory/Geo.php | 4 +- kronolith/lib/{Injector => }/Factory/Storage.php | 4 +- kronolith/lib/FreeBusy.php | 2 +- kronolith/lib/Kronolith.php | 2 +- turba/add.php | 2 +- turba/contact.php | 2 +- turba/data.php | 6 +-- turba/delete.php | 2 +- turba/deletefile.php | 2 +- turba/edit.php | 2 +- turba/lib/Api.php | 44 +++++++++++----------- turba/lib/Application.php | 4 +- turba/lib/Driver/Share.php | 2 +- turba/lib/Driver/Vbook.php | 2 +- turba/lib/{Injector => }/Factory/Driver.php | 2 +- turba/lib/Form/CreateAddressBook.php | 2 +- turba/lib/Form/DeleteAddressBook.php | 2 +- turba/lib/List.php | 2 +- turba/lib/LoginTasks/SystemTask/UpgradeLists.php | 2 +- turba/lib/Object/Group.php | 4 +- turba/lib/Turba.php | 4 +- turba/lib/View/Browse.php | 10 ++--- turba/lib/View/List.php | 4 +- turba/lib/tests/KolabTest.php | 8 ++-- turba/merge.php | 2 +- turba/minisearch.php | 2 +- turba/scripts/import_squirrelmail_file_abook.php | 2 +- turba/scripts/import_squirrelmail_sql_abook.php | 2 +- turba/scripts/upgrades/public_to_horde_share.php | 2 +- turba/search.php | 2 +- turba/vcard.php | 2 +- turba/view.php | 2 +- 110 files changed, 274 insertions(+), 274 deletions(-) rename ansel/lib/{Injector => }/Factory/Faces.php (92%) rename ansel/lib/{Injector => }/Factory/Storage.php (97%) rename ansel/lib/{Injector => }/Factory/Styles.php (97%) rename hermes/lib/{Injector => }/Factory/Driver.php (97%) rename imp/lib/{Injector => }/Factory/AuthImap.php (98%) rename imp/lib/{Injector => }/Factory/Compose.php (98%) rename imp/lib/{Injector => }/Factory/Contents.php (97%) rename imp/lib/{Injector => }/Factory/Flags.php (98%) rename imp/lib/{Injector => }/Factory/Identity.php (96%) rename imp/lib/{Injector => }/Factory/Imap.php (98%) rename imp/lib/{Injector => }/Factory/Imaptree.php (98%) rename imp/lib/{Injector => }/Factory/Mail.php (94%) rename imp/lib/{Injector => }/Factory/MailboxList.php (98%) rename imp/lib/{Injector => }/Factory/MimeViewer.php (98%) rename imp/lib/{Injector => }/Factory/Pgp.php (97%) rename imp/lib/{Injector => }/Factory/Quota.php (95%) rename imp/lib/{Injector => }/Factory/Search.php (98%) rename imp/lib/{Injector => }/Factory/Sentmail.php (97%) rename imp/lib/{Injector => }/Factory/Smime.php (97%) rename jonah/lib/{Injector => }/Factory/Driver.php (97%) rename kronolith/lib/{Injector => }/Factory/Driver.php (97%) rename kronolith/lib/{Injector => }/Factory/Geo.php (96%) rename kronolith/lib/{Injector => }/Factory/Storage.php (97%) rename turba/lib/{Injector => }/Factory/Driver.php (99%) diff --git a/ansel/lib/Application.php b/ansel/lib/Application.php index c1f16b94e..4cb6e8e50 100644 --- a/ansel/lib/Application.php +++ b/ansel/lib/Application.php @@ -66,12 +66,12 @@ class Ansel_Application extends Horde_Registry_Application } $factories = array( - 'Ansel_Styles' => array('Ansel_Injector_Factory_Styles', 'create'), - 'Ansel_Faces' => array('Ansel_Injector_Factory_Faces', 'create'), - 'Ansel_Storage' => array('Ansel_Injector_Factory_Storage', 'create'), + 'Ansel_Styles' => 'Ansel_Factory_Styles', + 'Ansel_Faces' => 'Ansel_Factory_Faces', + 'Ansel_Storage' => 'Ansel_Factory_Storage', ); foreach ($factories as $interface => $v) { - $GLOBALS['injector']->bindFactory($interface, $v[0], $v[1]); + $GLOBALS['injector']->bindFactory($interface, $v, 'create'); } // Create db, share, and vfs instances. diff --git a/ansel/lib/Injector/Factory/Faces.php b/ansel/lib/Factory/Faces.php similarity index 92% rename from ansel/lib/Injector/Factory/Faces.php rename to ansel/lib/Factory/Faces.php index 513c676e2..4d013dd5b 100644 --- a/ansel/lib/Injector/Factory/Faces.php +++ b/ansel/lib/Factory/Faces.php @@ -7,7 +7,7 @@ * @license http://www.fsf.org/copyleft/gpl.html GPL * @package Ansel */ -class Ansel_Injector_Factory_Faces +class Ansel_Factory_Faces { public function create (Horde_Injector $injector) { @@ -18,4 +18,4 @@ class Ansel_Injector_Factory_Faces return new $class_name($params); } -} \ No newline at end of file +} diff --git a/ansel/lib/Injector/Factory/Storage.php b/ansel/lib/Factory/Storage.php similarity index 97% rename from ansel/lib/Injector/Factory/Storage.php rename to ansel/lib/Factory/Storage.php index c22cfb3b7..fca1a53b6 100644 --- a/ansel/lib/Injector/Factory/Storage.php +++ b/ansel/lib/Factory/Storage.php @@ -9,7 +9,7 @@ * @license http://www.fsf.org/copyleft/gpl.html GPL * @package Ansel */ -class Ansel_Injector_Factory_Storage +class Ansel_Factory_Storage { /** * Array of already instantiated instances diff --git a/ansel/lib/Injector/Factory/Styles.php b/ansel/lib/Factory/Styles.php similarity index 97% rename from ansel/lib/Injector/Factory/Styles.php rename to ansel/lib/Factory/Styles.php index d4527cdd7..72c012950 100644 --- a/ansel/lib/Injector/Factory/Styles.php +++ b/ansel/lib/Factory/Styles.php @@ -7,7 +7,7 @@ * @license http://www.fsf.org/copyleft/gpl.html GPL * @package Ansel */ -class Ansel_Injector_Factory_Styles +class Ansel_Factory_Styles { public function create (Horde_Injector $injector) { @@ -43,4 +43,4 @@ class Ansel_Injector_Factory_Styles return $styles; } -} \ No newline at end of file +} diff --git a/hermes/lib/Application.php b/hermes/lib/Application.php index f3df91c6b..d1ca70c55 100644 --- a/hermes/lib/Application.php +++ b/hermes/lib/Application.php @@ -51,7 +51,7 @@ class Hermes_Application extends Horde_Registry_Application */ protected function _init() { - $GLOBALS['injector']->bindFactory('Hermes_Driver', 'Hermes_Injector_Factory_Driver', 'create'); + $GLOBALS['injector']->bindFactory('Hermes_Driver', 'Hermes_Factory_Driver', 'create'); } /** diff --git a/hermes/lib/Injector/Factory/Driver.php b/hermes/lib/Factory/Driver.php similarity index 97% rename from hermes/lib/Injector/Factory/Driver.php rename to hermes/lib/Factory/Driver.php index 46c55f70e..ffa5b1d26 100644 --- a/hermes/lib/Injector/Factory/Driver.php +++ b/hermes/lib/Factory/Driver.php @@ -7,7 +7,7 @@ * @license http://www.fsf.org/copyleft/gpl.html GPL * @package Hermes */ -class Hermes_Injector_Factory_Driver +class Hermes_Factory_Driver { /** * diff --git a/imp/bin/query_imap_cache b/imp/bin/query_imap_cache index c135123ef..93c2e02fb 100755 --- a/imp/bin/query_imap_cache +++ b/imp/bin/query_imap_cache @@ -46,7 +46,7 @@ foreach ($options[0] as $val) { } } -$imp_imap = $injector->getInstance('IMP_Injector_Factory_Imap')->create(); +$imp_imap = $injector->getInstance('IMP_Factory_Imap')->create(); if (is_null($server)) { /* Set first entry to 1, not 0. */ diff --git a/imp/compose-dimp.php b/imp/compose-dimp.php index de83f3d80..62c349ecd 100644 --- a/imp/compose-dimp.php +++ b/imp/compose-dimp.php @@ -62,7 +62,7 @@ if (!$prefs->isLocked('default_identity') && isset($vars->identity)) { } /* Init objects. */ -$imp_compose = $injector->getInstance('IMP_Injector_Factory_Compose')->create(); +$imp_compose = $injector->getInstance('IMP_Factory_Compose')->create(); $imp_ui = new IMP_Ui_Compose(); $show_editor = false; diff --git a/imp/compose-mimp.php b/imp/compose-mimp.php index 16f5c8dd6..306a8f03a 100644 --- a/imp/compose-mimp.php +++ b/imp/compose-mimp.php @@ -64,7 +64,7 @@ $sent_mail_folder = $identity->getValue('sent_mail_folder'); /* Determine if mailboxes are readonly. */ $readonly_drafts = false; -$imp_imap = $injector->getInstance('IMP_Injector_Factory_Imap')->create(); +$imp_imap = $injector->getInstance('IMP_Factory_Imap')->create(); if (!empty($draft)) { $draft = IMP::folderPref($draft, true); $readonly_drafts = $imp_folder->exists($draft) && @@ -78,7 +78,7 @@ $save_sent_mail = ($imp_folder->exists($sent_mail_folder) && $imp_imap->isReadOn $compose_disable = !IMP::canCompose(); /* Initialize objects. */ -$imp_compose = $injector->getInstance('IMP_Injector_Factory_Compose')->create($vars->composeCache); +$imp_compose = $injector->getInstance('IMP_Factory_Compose')->create($vars->composeCache); $imp_ui = new IMP_Ui_Compose(); foreach (array_keys($display_hdrs) as $val) { diff --git a/imp/compose.php b/imp/compose.php index a878b8ca4..3a1c63d94 100644 --- a/imp/compose.php +++ b/imp/compose.php @@ -101,7 +101,7 @@ $compose_disable = !IMP::canCompose(); $imp_folder = $injector->getInstance('IMP_Folder'); $readonly_drafts = $readonly_sentmail = false; $draft = $prefs->getValue('drafts_folder'); -$imp_imap = $injector->getInstance('IMP_Injector_Factory_Imap')->create(); +$imp_imap = $injector->getInstance('IMP_Factory_Imap')->create(); if (!empty($draft)) { $draft = IMP::folderPref($draft, true); $readonly_drafts = $imp_folder->exists($draft) && @@ -114,7 +114,7 @@ if ($readonly_sentmail) { } /* Initialize the IMP_Compose:: object. */ -$imp_compose = $injector->getInstance('IMP_Injector_Factory_Compose')->create($vars->composeCache); +$imp_compose = $injector->getInstance('IMP_Factory_Compose')->create($vars->composeCache); $imp_compose->pgpAttachPubkey((bool) $vars->pgp_attach_pubkey); $imp_compose->userLinkAttachments((bool) $vars->link_attachments); diff --git a/imp/config/hooks.php.dist b/imp/config/hooks.php.dist index 4d2ab828e..cea61efc8 100644 --- a/imp/config/hooks.php.dist +++ b/imp/config/hooks.php.dist @@ -651,7 +651,7 @@ class IMP_Hooks // // Requires the 'command' parameter to be defined in backends.php, // // which defines the quota reporting function to run on the SSH // // host. -// $imap_ob = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create(); +// $imap_ob = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create(); // $host = $imap_ob->ob->getParam('hostspec'); // $user = $params['host']; // $pass = $imap_ob->ob->getParam('password'); diff --git a/imp/folders-mimp.php b/imp/folders-mimp.php index 927f99ad9..f12dc5ed0 100644 --- a/imp/folders-mimp.php +++ b/imp/folders-mimp.php @@ -22,7 +22,7 @@ require_once dirname(__FILE__) . '/lib/Application.php'; Horde_Registry::appInit('imp', array('impmode' => 'mimp')); /* Redirect back to the mailbox if folder use is not allowed. */ -if (!$injector->getInstance('IMP_Injector_Factory_Imap')->create()->allowFolders()) { +if (!$injector->getInstance('IMP_Factory_Imap')->create()->allowFolders()) { $notification->push(_("Folder use is not enabled."), 'horde.error'); Horde::url('mailbox-mimp.php', true)->redirect(); } diff --git a/imp/folders.php b/imp/folders.php index 9fd5f5ef3..061e0bd06 100644 --- a/imp/folders.php +++ b/imp/folders.php @@ -23,7 +23,7 @@ Horde_Registry::appInit('imp', array( Horde::addScriptFile('folders.js', 'imp'); /* Redirect back to the mailbox if folder use is not allowed. */ -$imp_imap = $injector->getInstance('IMP_Injector_Factory_Imap')->create(); +$imp_imap = $injector->getInstance('IMP_Factory_Imap')->create(); if (!$imp_imap->allowFolders()) { $notification->push(_("Folder use is not enabled."), 'horde.error'); Horde::url('mailbox.php', true)->redirect(); @@ -251,7 +251,7 @@ case 'folders_empty_mailbox_confirm': } try { - $elt_info = $injector->getInstance('IMP_Injector_Factory_Imap')->create()->status($val, Horde_Imap_Client::STATUS_MESSAGES); + $elt_info = $injector->getInstance('IMP_Factory_Imap')->create()->status($val, Horde_Imap_Client::STATUS_MESSAGES); } catch (Horde_Imap_Client_Exception $e) { $elt_info = null; } @@ -427,7 +427,7 @@ if (!empty($imaptree->recent)) { /* Open the mailbox R/W so we ensure the 'recent' flags are cleared from * the current mailbox. */ foreach ($imaptree->recent as $mbox => $nm) { - $injector->getInstance('IMP_Injector_Factory_Imap')->create()->openMailbox($mbox, Horde_Imap_Client::OPEN_READWRITE); + $injector->getInstance('IMP_Factory_Imap')->create()->openMailbox($mbox, Horde_Imap_Client::OPEN_READWRITE); } IMP::newmailAlerts($imaptree->recent); diff --git a/imp/lib/Ajax/Application.php b/imp/lib/Ajax/Application.php index 0d1f2d37a..8080c4ebb 100644 --- a/imp/lib/Ajax/Application.php +++ b/imp/lib/Ajax/Application.php @@ -500,7 +500,7 @@ class IMP_Ajax_Application extends Horde_Core_Ajax_Application if ($this->_vars->add) { $imptree->addPollList($this->_vars->mbox); try { - if ($info = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->status($this->_vars->mbox, Horde_Imap_Client::STATUS_UNSEEN)) { + if ($info = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->status($this->_vars->mbox, Horde_Imap_Client::STATUS_UNSEEN)) { $result->poll = array($this->_vars->mbox => intval($info['unseen'])); } } catch (Horde_Imap_Client_Exception $e) {} @@ -739,7 +739,7 @@ class IMP_Ajax_Application extends Horde_Core_Ajax_Application $result->ViewPort = $this->_viewPortData(true); } else { $result->ViewPort = new stdClass; - $result->ViewPort->updatecacheid = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_MailboxList')->create($this->_vars->view)->getCacheID($this->_vars->view); + $result->ViewPort->updatecacheid = $GLOBALS['injector']->getInstance('IMP_Factory_MailboxList')->create($this->_vars->view)->getCacheID($this->_vars->view); $result->ViewPort->view = $this->_vars->view; } @@ -986,7 +986,7 @@ class IMP_Ajax_Application extends Horde_Core_Ajax_Application $result = $this->_checkUidvalidity($result); } elseif (!$change) { /* Only update cacheid info if it changed. */ - $cacheid = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_MailboxList')->create($this->_vars->view)->getCacheID($this->_vars->view); + $cacheid = $GLOBALS['injector']->getInstance('IMP_Factory_MailboxList')->create($this->_vars->view)->getCacheID($this->_vars->view); if ($cacheid != $this->_vars->cacheid) { $result->ViewPort = new stdClass; $result->ViewPort->updatecacheid = $cacheid; @@ -1272,7 +1272,7 @@ class IMP_Ajax_Application extends Horde_Core_Ajax_Application */ public function cancelCompose() { - $imp_compose = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Compose')->create($this->_vars->imp_compose); + $imp_compose = $GLOBALS['injector']->getInstance('IMP_Factory_Compose')->create($this->_vars->imp_compose); $imp_compose->destroy('cancel'); return true; @@ -1325,7 +1325,7 @@ class IMP_Ajax_Application extends Horde_Core_Ajax_Application */ public function deleteDraft() { - $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Compose')->create($this->_vars->imp_compose)->destroy('cancel'); + $GLOBALS['injector']->getInstance('IMP_Factory_Compose')->create($this->_vars->imp_compose)->destroy('cancel'); return true; } @@ -1343,7 +1343,7 @@ class IMP_Ajax_Application extends Horde_Core_Ajax_Application public function deleteAttach() { if (isset($this->_vars->atc_indices)) { - $imp_compose = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Compose')->create($this->_vars->imp_compose); + $imp_compose = $GLOBALS['injector']->getInstance('IMP_Factory_Compose')->create($this->_vars->imp_compose); foreach ($this->_vars->atc_indices as $val) { $GLOBALS['notification']->push(sprintf(_("Deleted attachment \"%s\"."), Horde_Mime::decode($imp_compose[$val]['part']->getName(true))), 'horde.success'); unset($imp_compose[$val]); @@ -1494,7 +1494,7 @@ class IMP_Ajax_Application extends Horde_Core_Ajax_Application } try { - $fetch_ret = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->fetch($this->_vars->folder, array( + $fetch_ret = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->fetch($this->_vars->folder, array( Horde_Imap_Client::FETCH_HEADERTEXT => array(array('parse' => true, 'peek' => false)) ), array('ids' => array($this->_vars->uid))); } catch (Horde_Imap_Client_Exception $e) { @@ -1578,7 +1578,7 @@ class IMP_Ajax_Application extends Horde_Core_Ajax_Application */ public function addAttachment() { - $imp_compose = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Compose')->create($this->_vars->composeCache); + $imp_compose = $GLOBALS['injector']->getInstance('IMP_Factory_Compose')->create($this->_vars->composeCache); $result = new stdClass; $result->action = 'addAttachment'; @@ -1783,7 +1783,7 @@ class IMP_Ajax_Application extends Horde_Core_Ajax_Application $result->success = 1; try { - $imp_compose = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Compose')->create($this->_vars->composeCache); + $imp_compose = $GLOBALS['injector']->getInstance('IMP_Factory_Compose')->create($this->_vars->composeCache); $imp_compose->sendRedirectMessage($this->_vars->redirect_to); $result->mbox = $imp_compose->getMetadata('mailbox'); @@ -1864,7 +1864,7 @@ class IMP_Ajax_Application extends Horde_Core_Ajax_Application if (is_null($mbox)) { $result = array(); - foreach ($GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->statusMultiple($imaptree->getPollList(), Horde_Imap_Client::STATUS_UNSEEN) as $key => $val) { + foreach ($GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->statusMultiple($imaptree->getPollList(), Horde_Imap_Client::STATUS_UNSEEN) as $key => $val) { $result[$key] = intval($val['unseen']); } return $result; @@ -1929,7 +1929,7 @@ class IMP_Ajax_Application extends Horde_Core_Ajax_Application } $headers['subject'] = $this->_vars->subject; - $imp_compose = $injector->getInstance('IMP_Injector_Factory_Compose')->create($this->_vars->composeCache); + $imp_compose = $injector->getInstance('IMP_Factory_Compose')->create($this->_vars->composeCache); return array($result, $imp_compose, $headers, $identity); } @@ -1939,10 +1939,10 @@ class IMP_Ajax_Application extends Horde_Core_Ajax_Application */ protected function _initCompose() { - $imp_compose = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Compose')->create($this->_vars->imp_compose); + $imp_compose = $GLOBALS['injector']->getInstance('IMP_Factory_Compose')->create($this->_vars->imp_compose); if (!($imp_contents = $imp_compose->getContentsOb())) { $imp_contents = $this->_vars->uid - ? $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Contents')->create(new IMP_Indices($this->_vars->uid)) + ? $GLOBALS['injector']->getInstance('IMP_Factory_Contents')->create(new IMP_Indices($this->_vars->uid)) : null; } @@ -2007,7 +2007,7 @@ class IMP_Ajax_Application extends Horde_Core_Ajax_Application protected function _checkUidvalidity($result = false) { try { - $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->checkUidvalidity($this->_vars->view); + $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->checkUidvalidity($this->_vars->view); } catch (IMP_Exception $e) { if (!is_object($result)) { $result = new stdClass; @@ -2062,7 +2062,7 @@ class IMP_Ajax_Application extends Horde_Core_Ajax_Application $result->ViewPort = $this->_viewPortData(true); } else { $result->ViewPort = new stdClass; - $result->ViewPort->updatecacheid = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_MailboxList')->create($this->_vars->view)->getCacheID($this->_vars->view); + $result->ViewPort->updatecacheid = $GLOBALS['injector']->getInstance('IMP_Factory_MailboxList')->create($this->_vars->view)->getCacheID($this->_vars->view); $result->ViewPort->view = $this->_vars->view; } @@ -2103,7 +2103,7 @@ class IMP_Ajax_Application extends Horde_Core_Ajax_Application * on the IMAP server (saves some STATUS calls). */ if (!is_null($rw)) { try { - $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->openMailbox($this->_vars->view, $rw ? Horde_Imap_Client::OPEN_READWRITE : Horde_Imap_Client::OPEN_AUTO); + $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->openMailbox($this->_vars->view, $rw ? Horde_Imap_Client::OPEN_READWRITE : Horde_Imap_Client::OPEN_AUTO); } catch (Horde_Imap_Client_Exception $e) { if ($e->getCode() == Horde_Imap_Client_Exception::MAILBOX_NOOPEN) { $GLOBALS['notification']->push(sprintf(_("Could not open mailbox \"%s\"."), $this->_vars->view), 'horde.error'); @@ -2114,7 +2114,7 @@ class IMP_Ajax_Application extends Horde_Core_Ajax_Application } } - return ($GLOBALS['injector']->getInstance('IMP_Injector_Factory_MailboxList')->create($this->_vars->view)->getCacheID($this->_vars->view) != $this->_vars->cacheid); + return ($GLOBALS['injector']->getInstance('IMP_Factory_MailboxList')->create($this->_vars->view)->getCacheID($this->_vars->view) != $this->_vars->cacheid); } /** diff --git a/imp/lib/Api.php b/imp/lib/Api.php index e787edfc8..1afd38d05 100644 --- a/imp/lib/Api.php +++ b/imp/lib/Api.php @@ -88,7 +88,7 @@ class IMP_Api extends Horde_Registry_Api */ public function createFolder($folder) { - $fname = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->appendNamespace($folder); + $fname = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->appendNamespace($folder); return $GLOBALS['injector']->getInstance('IMP_Folder')->create($fname, $GLOBALS['prefs']->getValue('subscribe')) ? $fname : false; @@ -181,7 +181,7 @@ class IMP_Api extends Horde_Registry_Api */ public function server() { - $imap_ob = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create(); + $imap_ob = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create(); return array( 'hostspec' => $imap_ob->ob->getParam('hostspec'), @@ -214,7 +214,7 @@ class IMP_Api extends Horde_Registry_Api */ public function imapOb() { - return $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->ob; + return $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->ob; } /** diff --git a/imp/lib/Application.php b/imp/lib/Application.php index a4cb88bc4..b3342783d 100644 --- a/imp/lib/Application.php +++ b/imp/lib/Application.php @@ -86,7 +86,7 @@ class IMP_Application extends Horde_Registry_Application { if (($e->getCode() == Horde_Registry::AUTH_FAILURE) && Horde_Util::getFormData('composeCache')) { - $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Compose')->create()->sessionExpireDraft(Horde_Variables::getDefaultVariables()); + $GLOBALS['injector']->getInstance('IMP_Factory_Compose')->create()->sessionExpireDraft(Horde_Variables::getDefaultVariables()); } } @@ -97,16 +97,16 @@ class IMP_Application extends Horde_Registry_Application { /* Add IMP-specific factories. */ $factories = array( - 'IMP_AuthImap' => 'IMP_Injector_Factory_AuthImap', - 'IMP_Crypt_Pgp' => 'IMP_Injector_Factory_Pgp', - 'IMP_Crypt_Smime' => 'IMP_Injector_Factory_Smime', - 'IMP_Flags' => 'IMP_Injector_Factory_Flags', - 'IMP_Identity' => 'IMP_Injector_Factory_Identity', - 'IMP_Imap_Tree' => 'IMP_Injector_Factory_Imaptree', - 'IMP_Mail' => 'IMP_Injector_Factory_Mail', - 'IMP_Quota' => 'IMP_Injector_Factory_Quota', - 'IMP_Search' => 'IMP_Injector_Factory_Search', - 'IMP_Sentmail' => 'IMP_Injector_Factory_Sentmail' + 'IMP_AuthImap' => 'IMP_Factory_AuthImap', + 'IMP_Crypt_Pgp' => 'IMP_Factory_Pgp', + 'IMP_Crypt_Smime' => 'IMP_Factory_Smime', + 'IMP_Flags' => 'IMP_Factory_Flags', + 'IMP_Identity' => 'IMP_Factory_Identity', + 'IMP_Imap_Tree' => 'IMP_Factory_Imaptree', + 'IMP_Mail' => 'IMP_Factory_Mail', + 'IMP_Quota' => 'IMP_Factory_Quota', + 'IMP_Search' => 'IMP_Factory_Search', + 'IMP_Sentmail' => 'IMP_Factory_Sentmail' ); foreach ($factories as $key => $val) { @@ -162,7 +162,7 @@ class IMP_Application extends Horde_Registry_Application { /* Clean up dangling IMP_Compose objects. */ foreach (array_keys($GLOBALS['session']->get('imp', 'compose_cache', Horde_Session::TYPE_ARRAY)) as $key) { - $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Compose')->create($key)->destroy('cancel'); + $GLOBALS['injector']->getInstance('IMP_Factory_Compose')->create($key)->destroy('cancel'); } /* No need to keep Tree object in cache - it will be recreated next @@ -260,7 +260,7 @@ class IMP_Application extends Horde_Registry_Application $trash_folder = IMP::folderPref($trash_folder, true); if ($injector->getInstance('IMP_Search')->isVTrash($trash_folder) || - !$injector->getInstance('IMP_Injector_Factory_Imap')->create()->isReadOnly($trash_folder)) { + !$injector->getInstance('IMP_Factory_Imap')->create()->isReadOnly($trash_folder)) { $menu->addArray(array( 'class' => '__noselection', 'icon' => 'empty_trash.png', @@ -292,7 +292,7 @@ class IMP_Application extends Horde_Registry_Application )); } - if ($injector->getInstance('IMP_Injector_Factory_Imap')->create()->allowFolders()) { + if ($injector->getInstance('IMP_Factory_Imap')->create()->allowFolders()) { $menu->addArray(array( 'icon' => 'folders/folder.png', 'text' => _("_Folders"), diff --git a/imp/lib/Auth.php b/imp/lib/Auth.php index 1e684f5c4..e78ce04bd 100644 --- a/imp/lib/Auth.php +++ b/imp/lib/Auth.php @@ -80,7 +80,7 @@ class IMP_Auth $credentials['server'] = self::getAutoLoginServer(); } - $imp_imap = $injector->getInstance('IMP_Injector_Factory_Imap')->create($credentials['server']); + $imp_imap = $injector->getInstance('IMP_Factory_Imap')->create($credentials['server']); // Check for valid IMAP Client object. if (!$imp_imap->ob) { @@ -264,7 +264,7 @@ class IMP_Auth */ static protected function _canAutoLogin($server_key = null, $force = false) { - if (($servers = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->loadServerConfig()) === false) { + if (($servers = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->loadServerConfig()) === false) { return false; } @@ -351,7 +351,7 @@ class IMP_Auth { global $browser, $conf, $injector, $prefs, $registry, $session; - $imp_imap = $injector->getInstance('IMP_Injector_Factory_Imap')->create(null, true); + $imp_imap = $injector->getInstance('IMP_Factory_Imap')->create(null, true); $ptr = $imp_imap->loadServerConfig($session->get('imp', 'server_key')); if ($ptr === false) { throw new Horde_Auth_Exception('', Horde_Auth::REASON_FAILED); @@ -487,7 +487,7 @@ class IMP_Auth } /* Check for drafts due to session timeouts. */ - $imp_compose = $injector->getInstance('IMP_Injector_Factory_Compose')->create()->recoverSessionExpireDraft(); + $imp_compose = $injector->getInstance('IMP_Factory_Compose')->create()->recoverSessionExpireDraft(); self::_logMessage(true, $imp_imap); } diff --git a/imp/lib/Block/Newmail.php b/imp/lib/Block/Newmail.php index 4f69d6ce5..62acd0282 100644 --- a/imp/lib/Block/Newmail.php +++ b/imp/lib/Block/Newmail.php @@ -39,7 +39,7 @@ class IMP_Block_Newmail extends Horde_Block : $this->_params['msgs_shown']; try { - $fetch_ret = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->fetch('INBOX', array( + $fetch_ret = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->fetch('INBOX', array( Horde_Imap_Client::FETCH_ENVELOPE => true ), array('ids' => array_slice($indices, 0, $shown))); reset($fetch_ret); diff --git a/imp/lib/Compose.php b/imp/lib/Compose.php index 5a823a00c..c8d6e2560 100644 --- a/imp/lib/Compose.php +++ b/imp/lib/Compose.php @@ -219,7 +219,7 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator /* Add information necessary to log replies/forwards when finally * sent. */ if ($this->getMetadata('reply_type')) { - $imp_imap = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create(); + $imp_imap = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create(); try { $imap_url = $imp_imap->getUtils()->createUrl(array( 'type' => $GLOBALS['session']->get('imp', 'protocol'), @@ -287,7 +287,7 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator /* Add the message to the mailbox. */ try { - $ids = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->append($drafts_mbox, array(array('data' => $data, 'flags' => $append_flags))); + $ids = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->append($drafts_mbox, array(array('data' => $data, 'flags' => $append_flags))); if ($old_uid) { $GLOBALS['injector']->getInstance('IMP_Message')->delete($old_uid, array('nuke' => true)); @@ -322,7 +322,7 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator global $injector, $prefs; try { - $contents = $injector->getInstance('IMP_Injector_Factory_Contents')->create($indices); + $contents = $injector->getInstance('IMP_Factory_Contents')->create($indices); } catch (IMP_Exception $e) { throw new IMP_Compose_Exception($e); } @@ -419,7 +419,7 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator } if ($val) { - $imp_imap = $injector->getInstance('IMP_Injector_Factory_Imap')->create(); + $imp_imap = $injector->getInstance('IMP_Factory_Imap')->create(); $imap_url = $imp_imap->getUtils()->parseUrl(rtrim(ltrim($val, '<'), '>')); try { @@ -429,7 +429,7 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator // even though the server is the same. UIDVALIDITY should // catch any true server/backend changes. ($imp_imap->checkUidvalidity($imap_url['mailbox']) == $imap_url['uidvalidity']) && - $injector->getInstance('IMP_Injector_Factory_Contents')->create(new IMP_Indices($imap_url['mailbox'], $imap_url['uid']))) { + $injector->getInstance('IMP_Factory_Contents')->create(new IMP_Indices($imap_url['mailbox'], $imap_url['uid']))) { $this->_metadata['mailbox'] = $imap_url['mailbox']; $this->_metadata['reply_type'] = $reply_type; $this->_metadata['uid'] = $imap_url['uid']; @@ -678,7 +678,7 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator } try { - $injector->getInstance('IMP_Injector_Factory_Imap')->create()->append($opts['sent_folder'], array(array('data' => $fcc, 'flags' => $flags))); + $injector->getInstance('IMP_Factory_Imap')->create()->append($opts['sent_folder'], array(array('data' => $fcc, 'flags' => $flags))); } catch (Horde_Imap_Client_Exception $e) { $notification->push(sprintf(_("Message sent successfully, but not saved to %s"), IMP::displayFolder($opts['sent_folder']))); $sent_saved = false; @@ -1381,7 +1381,7 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator $subject = $h->getValue('subject'); $header['subject'] = empty($subject) ? 'Re: ' - : 'Re: ' . $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->getUtils()->getBaseSubject($subject, array('keepblob' => true)); + : 'Re: ' . $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->getUtils()->getBaseSubject($subject, array('keepblob' => true)); $force = false; if (in_array($type, array('reply', 'reply_auto', '*'))) { @@ -1665,7 +1665,7 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator $header['subject'] = $h->getValue('subject'); if (!empty($header['subject'])) { - $subject = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->getUtils()->getBaseSubject($header['subject'], array('keepblob' => true)); + $subject = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->getUtils()->getBaseSubject($header['subject'], array('keepblob' => true)); $header['title'] = _("Forward") . ': ' . $subject; $header['subject'] = 'Fwd: ' . $subject; } else { @@ -1861,7 +1861,7 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator $attached = 0; foreach ($indices as $mbox => $idx) { ++$attached; - $contents = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Contents')->create(new IMP_Indices($mbox, $idx)); + $contents = $GLOBALS['injector']->getInstance('IMP_Factory_Contents')->create(new IMP_Indices($mbox, $idx)); $headerob = $contents->getHeaderOb(); $part = new Horde_Mime_Part(); @@ -1880,7 +1880,7 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator } else { $name = Horde_String::truncate($name, 80); } - return 'Fwd: ' . $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->getUtils()->getBaseSubject($name, array('keepblob' => true)); + return 'Fwd: ' . $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->getUtils()->getBaseSubject($name, array('keepblob' => true)); } return 'Fwd: ' . sprintf(_("%u Forwarded Messages"), $attached); @@ -2753,7 +2753,7 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator public function getContentsOb() { return $this->getMetadata('reply_type') - ? $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Contents')->create(new IMP_Indices($this->getMetadata('mailbox'), $this->getMetadata('uid'))) + ? $GLOBALS['injector']->getInstance('IMP_Factory_Contents')->create(new IMP_Indices($this->getMetadata('mailbox'), $this->getMetadata('uid'))) : null; } diff --git a/imp/lib/Contents.php b/imp/lib/Contents.php index 40ac98445..c9c0a149d 100644 --- a/imp/lib/Contents.php +++ b/imp/lib/Contents.php @@ -99,7 +99,7 @@ class IMP_Contents /* Get the Horde_Mime_Part object for the given UID. */ try { - $ret = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->fetch($this->_mailbox, array( + $ret = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->fetch($this->_mailbox, array( Horde_Imap_Client::FETCH_STRUCTURE => array('parse' => true) ), array('ids' => array($this->_uid))); } catch (Horde_Imap_Client_Exception $e) { @@ -153,7 +153,7 @@ class IMP_Contents } try { - $res = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->fetch($this->_mailbox, array( + $res = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->fetch($this->_mailbox, array( Horde_Imap_Client::FETCH_BODYTEXT => array(array('peek' => true, 'stream' => !empty($options['stream']))) ), array('ids' => array($this->_uid))); return $res[$this->_uid]['bodytext'][0]; @@ -212,7 +212,7 @@ class IMP_Contents } try { - $res = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->fetch($this->_mailbox, $query, array('ids' => array($this->_uid))); + $res = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->fetch($this->_mailbox, $query, array('ids' => array($this->_uid))); if (empty($options['mimeheaders'])) { if (!empty($res[$this->_uid]['bodypartdecode'][$id])) { $this->lastBodyPartDecode = $res[$this->_uid]['bodypartdecode'][$id]; @@ -250,7 +250,7 @@ class IMP_Contents } try { - $res = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->fetch($this->_mailbox, array( + $res = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->fetch($this->_mailbox, array( Horde_Imap_Client::FETCH_HEADERTEXT => array(array('peek' => true)), Horde_Imap_Client::FETCH_BODYTEXT => array(array('peek' => true, 'stream' => !empty($options['stream']))) ), array('ids' => array($this->_uid))); @@ -284,7 +284,7 @@ class IMP_Contents } try { - $res = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->fetch($this->_mailbox, array( + $res = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->fetch($this->_mailbox, array( Horde_Imap_Client::FETCH_HEADERTEXT => array(array('parse' => $parse, 'peek' => true)) ), array('ids' => array($this->_uid))); return $res[$this->_uid]['headertext'][0]; @@ -385,7 +385,7 @@ class IMP_Contents ? null : $options['type']; - $viewer = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_MimeViewer')->create($mime_part, $this, $type); + $viewer = $GLOBALS['injector']->getInstance('IMP_Factory_MimeViewer')->create($mime_part, $this, $type); switch ($mode) { case self::RENDER_FULL: @@ -678,7 +678,7 @@ class IMP_Contents if ($is_atc && $download_zip && ($part['bytes'] > 204800)) { - $viewer = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_MimeViewer')->create($mime_part, $this, $mime_type); + $viewer = $GLOBALS['injector']->getInstance('IMP_Factory_MimeViewer')->create($mime_part, $this, $mime_type); if (!$viewer->getMetadata('compressed')) { $part['download_zip'] = $this->linkView($mime_part, 'download_attach', null, array('class' => 'iconImg downloadZipAtc', 'dload' => true, 'jstext' => sprintf(_("Download %s in .zip Format"), $mime_part->getDescription(true)), 'params' => array('zip' => 1))); } @@ -896,7 +896,7 @@ class IMP_Contents $last_id = null; $mime_part = $this->getMIMEPart($id, array('nocontents' => true)); - $viewer = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_MimeViewer')->create($mime_part, $this); + $viewer = $GLOBALS['injector']->getInstance('IMP_Factory_MimeViewer')->create($mime_part, $this); if ($viewer->embeddedMimeParts()) { $mime_part = $this->getMIMEPart($id); $viewer->setMIMEPart($mime_part); @@ -931,7 +931,7 @@ class IMP_Contents if (!is_object($part)) { $part = $this->getMIMEPart($part, array('nocontents' => true)); } - $viewer = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_MimeViewer')->create($part, $this, $type); + $viewer = $GLOBALS['injector']->getInstance('IMP_Factory_MimeViewer')->create($part, $this, $type); if ($mask & self::RENDER_INLINE_AUTO) { $mask |= self::RENDER_INLINE | self::RENDER_INFO; diff --git a/imp/lib/Injector/Factory/AuthImap.php b/imp/lib/Factory/AuthImap.php similarity index 98% rename from imp/lib/Injector/Factory/AuthImap.php rename to imp/lib/Factory/AuthImap.php index 02331606f..8cf74770b 100644 --- a/imp/lib/Injector/Factory/AuthImap.php +++ b/imp/lib/Factory/AuthImap.php @@ -25,7 +25,7 @@ * @link http://pear.horde.org/index.php?package=IMP * @package IMP */ -class IMP_Injector_Factory_AuthImap +class IMP_Factory_AuthImap { /** * Return the Horde_Auth_Imap:: instance that uses IMP configuration. diff --git a/imp/lib/Injector/Factory/Compose.php b/imp/lib/Factory/Compose.php similarity index 98% rename from imp/lib/Injector/Factory/Compose.php rename to imp/lib/Factory/Compose.php index 3b19517a1..5a5f7fadf 100644 --- a/imp/lib/Injector/Factory/Compose.php +++ b/imp/lib/Factory/Compose.php @@ -25,7 +25,7 @@ * @link http://pear.horde.org/index.php?package=IMP * @package IMP */ -class IMP_Injector_Factory_Compose +class IMP_Factory_Compose { /** * Instances. diff --git a/imp/lib/Injector/Factory/Contents.php b/imp/lib/Factory/Contents.php similarity index 97% rename from imp/lib/Injector/Factory/Contents.php rename to imp/lib/Factory/Contents.php index 5447df689..51610079a 100644 --- a/imp/lib/Injector/Factory/Contents.php +++ b/imp/lib/Factory/Contents.php @@ -25,7 +25,7 @@ * @link http://pear.horde.org/index.php?package=IMP * @package IMP */ -class IMP_Injector_Factory_Contents +class IMP_Factory_Contents { /** * Instances. diff --git a/imp/lib/Injector/Factory/Flags.php b/imp/lib/Factory/Flags.php similarity index 98% rename from imp/lib/Injector/Factory/Flags.php rename to imp/lib/Factory/Flags.php index f4f255ebf..e454465a0 100644 --- a/imp/lib/Injector/Factory/Flags.php +++ b/imp/lib/Factory/Flags.php @@ -25,7 +25,7 @@ * @link http://pear.horde.org/index.php?package=IMP * @package IMP */ -class IMP_Injector_Factory_Flags +class IMP_Factory_Flags { /** * Return the IMP_Flags instance. diff --git a/imp/lib/Injector/Factory/Identity.php b/imp/lib/Factory/Identity.php similarity index 96% rename from imp/lib/Injector/Factory/Identity.php rename to imp/lib/Factory/Identity.php index 16fd85fac..41b69c426 100644 --- a/imp/lib/Injector/Factory/Identity.php +++ b/imp/lib/Factory/Identity.php @@ -25,7 +25,7 @@ * @link http://pear.horde.org/index.php?package=IMP * @package IMP */ -class IMP_Injector_Factory_Identity +class IMP_Factory_Identity { /** * Return the IMP identity instance. diff --git a/imp/lib/Injector/Factory/Imap.php b/imp/lib/Factory/Imap.php similarity index 98% rename from imp/lib/Injector/Factory/Imap.php rename to imp/lib/Factory/Imap.php index c5389d0e2..9a21b8afa 100644 --- a/imp/lib/Injector/Factory/Imap.php +++ b/imp/lib/Factory/Imap.php @@ -25,7 +25,7 @@ * @link http://pear.horde.org/index.php?package=IMP * @package IMP */ -class IMP_Injector_Factory_Imap +class IMP_Factory_Imap { /** * Instances. diff --git a/imp/lib/Injector/Factory/Imaptree.php b/imp/lib/Factory/Imaptree.php similarity index 98% rename from imp/lib/Injector/Factory/Imaptree.php rename to imp/lib/Factory/Imaptree.php index af544786c..73082cbf1 100644 --- a/imp/lib/Injector/Factory/Imaptree.php +++ b/imp/lib/Factory/Imaptree.php @@ -25,7 +25,7 @@ * @link http://pear.horde.org/index.php?package=IMP * @package IMP */ -class IMP_Injector_Factory_Imaptree +class IMP_Factory_Imaptree { /** * Return the IMP_Imap_Tree object. diff --git a/imp/lib/Injector/Factory/Mail.php b/imp/lib/Factory/Mail.php similarity index 94% rename from imp/lib/Injector/Factory/Mail.php rename to imp/lib/Factory/Mail.php index 39ab5a52b..ebe350d6a 100644 --- a/imp/lib/Injector/Factory/Mail.php +++ b/imp/lib/Factory/Mail.php @@ -25,7 +25,7 @@ * @link http://pear.horde.org/index.php?package=IMP * @package IMP */ -class IMP_Injector_Factory_Mail +class IMP_Factory_Mail { /** * Return the Horde_Mail instance. @@ -51,7 +51,7 @@ class IMP_Injector_Factory_Mail * current IMAP / POP3 connection are valid for SMTP authentication as * well. */ if (!empty($params['auth']) && empty($params['username'])) { - $imap_ob = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create(); + $imap_ob = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create(); $params['username'] = $imap_ob->getParam('username'); $params['password'] = $imap_ob->getParam('password'); } diff --git a/imp/lib/Injector/Factory/MailboxList.php b/imp/lib/Factory/MailboxList.php similarity index 98% rename from imp/lib/Injector/Factory/MailboxList.php rename to imp/lib/Factory/MailboxList.php index 406db4666..14cc786ee 100644 --- a/imp/lib/Injector/Factory/MailboxList.php +++ b/imp/lib/Factory/MailboxList.php @@ -25,7 +25,7 @@ * @link http://pear.horde.org/index.php?package=IMP * @package IMP */ -class IMP_Injector_Factory_MailboxList +class IMP_Factory_MailboxList { /** * Instances. diff --git a/imp/lib/Injector/Factory/MimeViewer.php b/imp/lib/Factory/MimeViewer.php similarity index 98% rename from imp/lib/Injector/Factory/MimeViewer.php rename to imp/lib/Factory/MimeViewer.php index 3be02276f..7998c0101 100644 --- a/imp/lib/Injector/Factory/MimeViewer.php +++ b/imp/lib/Factory/MimeViewer.php @@ -25,7 +25,7 @@ * @license http://www.fsf.org/copyleft/gpl.html GPL * @link http://pear.horde.org/index.php?package=IMP */ -class IMP_Injector_Factory_MimeViewer +class IMP_Factory_MimeViewer { /** * The injector. diff --git a/imp/lib/Injector/Factory/Pgp.php b/imp/lib/Factory/Pgp.php similarity index 97% rename from imp/lib/Injector/Factory/Pgp.php rename to imp/lib/Factory/Pgp.php index 6a5f41c3d..205ffb72b 100644 --- a/imp/lib/Injector/Factory/Pgp.php +++ b/imp/lib/Factory/Pgp.php @@ -25,7 +25,7 @@ * @link http://pear.horde.org/index.php?package=IMP * @package IMP */ -class IMP_Injector_Factory_Pgp +class IMP_Factory_Pgp { /** * Return the IMP_Crypt_Pgp instance. diff --git a/imp/lib/Injector/Factory/Quota.php b/imp/lib/Factory/Quota.php similarity index 95% rename from imp/lib/Injector/Factory/Quota.php rename to imp/lib/Factory/Quota.php index f5f6c264f..a526eecf8 100644 --- a/imp/lib/Injector/Factory/Quota.php +++ b/imp/lib/Factory/Quota.php @@ -25,7 +25,7 @@ * @link http://pear.horde.org/index.php?package=IMP * @package IMP */ -class IMP_Injector_Factory_Quota +class IMP_Factory_Quota { /** * Return the IMP_Quota instance. @@ -52,7 +52,7 @@ class IMP_Injector_Factory_Quota $params['password'] = $secret->read($secret->getKey('imp'), $params['password']); } - $imap_ob = $injector->getInstance('IMP_Injector_Factory_Imap')->create(); + $imap_ob = $injector->getInstance('IMP_Factory_Imap')->create(); switch (Horde_String::lower($driver)) { case 'imap': diff --git a/imp/lib/Injector/Factory/Search.php b/imp/lib/Factory/Search.php similarity index 98% rename from imp/lib/Injector/Factory/Search.php rename to imp/lib/Factory/Search.php index 17bcaea8f..12677a0f9 100644 --- a/imp/lib/Injector/Factory/Search.php +++ b/imp/lib/Factory/Search.php @@ -25,7 +25,7 @@ * @link http://pear.horde.org/index.php?package=IMP * @package IMP */ -class IMP_Injector_Factory_Search +class IMP_Factory_Search { /** * Return the IMP_Search instance. diff --git a/imp/lib/Injector/Factory/Sentmail.php b/imp/lib/Factory/Sentmail.php similarity index 97% rename from imp/lib/Injector/Factory/Sentmail.php rename to imp/lib/Factory/Sentmail.php index a31505822..e2333f2b1 100644 --- a/imp/lib/Injector/Factory/Sentmail.php +++ b/imp/lib/Factory/Sentmail.php @@ -25,7 +25,7 @@ * @link http://pear.horde.org/index.php?package=IMP * @package IMP */ -class IMP_Injector_Factory_Sentmail +class IMP_Factory_Sentmail { /** * Return the IMP_Sentmail instance. diff --git a/imp/lib/Injector/Factory/Smime.php b/imp/lib/Factory/Smime.php similarity index 97% rename from imp/lib/Injector/Factory/Smime.php rename to imp/lib/Factory/Smime.php index bb49da5c0..1e3c75268 100644 --- a/imp/lib/Injector/Factory/Smime.php +++ b/imp/lib/Factory/Smime.php @@ -25,7 +25,7 @@ * @link http://pear.horde.org/index.php?package=IMP * @package IMP */ -class IMP_Injector_Factory_Smime +class IMP_Factory_Smime { /** * Return the IMP_Crypt_Smime instance. diff --git a/imp/lib/Filter.php b/imp/lib/Filter.php index b9affcef9..ca3fac58d 100644 --- a/imp/lib/Filter.php +++ b/imp/lib/Filter.php @@ -111,7 +111,7 @@ class IMP_Filter } $addr = array(); - $imp_imap = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create(); + $imp_imap = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create(); foreach (array_keys($indices) as $mbox) { $imp_imap->checkUidvalidity($mbox); @@ -119,7 +119,7 @@ class IMP_Filter /* Get the list of from addresses. */ foreach ($indices as $mbox => $idx) { - $contents = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Contents')->create(new IMP_Indices($mbox, $idx)); + $contents = $GLOBALS['injector']->getInstance('IMP_Factory_Contents')->create(new IMP_Indices($mbox, $idx)); $hdr = $contents->getHeaderOb(); $addr[] = Horde_Mime_Address::bareAddress($hdr->getValue('from')); } diff --git a/imp/lib/Flag/User.php b/imp/lib/Flag/User.php index b2b6e2324..a00e2560d 100644 --- a/imp/lib/Flag/User.php +++ b/imp/lib/Flag/User.php @@ -55,7 +55,7 @@ class IMP_Flag_User extends IMP_Flag_Imap case 'imapflag': /* IMAP keywords must conform to RFC 3501 [9] (flag-keyword). * Convert whitespace to underscore. */ - $this->_imapflag = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->getUtils()->stripNonAtomChars(Horde_String::convertCharset(strtr($value, ' ', '_'), 'UTF-8', 'UTF7-IMAP')); + $this->_imapflag = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->getUtils()->stripNonAtomChars(Horde_String::convertCharset(strtr($value, ' ', '_'), 'UTF-8', 'UTF7-IMAP')); break; case 'label': diff --git a/imp/lib/Flags.php b/imp/lib/Flags.php index 371ccf0a6..6f2d4681b 100644 --- a/imp/lib/Flags.php +++ b/imp/lib/Flags.php @@ -117,7 +117,7 @@ class IMP_Flags implements ArrayAccess, Serializable try { /* Make sure we are in R/W mailbox mode (SELECT). No flags are * allowed in EXAMINE mode. */ - $imp_imap = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create(); + $imp_imap = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create(); $imp_imap->openMailbox($opts['mailbox'], Horde_Imap_Client::OPEN_READWRITE); $status = $imp_imap->status($opts['mailbox'], Horde_Imap_Client::STATUS_PERMFLAGS); } catch (Horde_Imap_Client_Exception $e) { diff --git a/imp/lib/Folder.php b/imp/lib/Folder.php index 3d6eedaaf..6f95a6e4c 100644 --- a/imp/lib/Folder.php +++ b/imp/lib/Folder.php @@ -55,7 +55,7 @@ class IMP_Folder } try { - $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->deleteMailbox($folder); + $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->deleteMailbox($folder); $notification->push(sprintf(_("The folder \"%s\" was successfully deleted."), IMP::displayFolder($folder)), 'horde.success'); $deleted[] = $folder; } catch (Horde_Imap_Client_Exception $e) { @@ -143,7 +143,7 @@ class IMP_Folder /* Attempt to create the mailbox. */ try { - $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->createMailbox($folder, array('special_use' => $special_use)); + $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->createMailbox($folder, array('special_use' => $special_use)); } catch (Horde_Imap_Client_Exception $e) { $notification->push(sprintf(_("The folder \"%s\" was not created. This is what the server said"), IMP::displayFolder($folder)) . ': ' . $e->getMessage(), 'horde.error'); return false; @@ -177,7 +177,7 @@ class IMP_Folder } try { - $ret = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->listMailboxes($folder, array('flat' => true)); + $ret = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->listMailboxes($folder, array('flat' => true)); return !empty($ret); } catch (Horde_Imap_Client_Exception $e) { return false; @@ -214,7 +214,7 @@ class IMP_Folder $all_folders = $this->getAllSubfolders($old); try { - $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->renameMailbox($old, $new); + $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->renameMailbox($old, $new); } catch (Horde_Imap_Client_Exception $e) { $GLOBALS['notification']->push(sprintf(_("Renaming \"%s\" to \"%s\" failed. This is what the server said"), IMP::displayFolder($old), IMP::displayFolder($new)) . ': ' . $e->getMessage(), 'horde.error'); return false; @@ -258,7 +258,7 @@ class IMP_Folder foreach (array_filter($folders) as $folder) { try { - $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->subscribeMailbox($folder, true); + $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->subscribeMailbox($folder, true); $notification->push(sprintf(_("You were successfully subscribed to \"%s\""), IMP::displayFolder($folder)), 'horde.success'); $subscribed[] = $folder; } catch (Horde_Imap_Client_Exception $e) { @@ -298,7 +298,7 @@ class IMP_Folder $notification->push(sprintf(_("You cannot unsubscribe from \"%s\"."), IMP::displayFolder($folder)), 'horde.error'); } else { try { - $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->subscribeMailbox($folder, false); + $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->subscribeMailbox($folder, false); $notification->push(sprintf(_("You were successfully unsubscribed from \"%s\""), IMP::displayFolder($folder)), 'horde.success'); $unsubscribed[] = $folder; } catch (Horde_Imap_Client_Exception $e) { @@ -339,7 +339,7 @@ class IMP_Folder foreach ($folder_list as $folder) { try { - $status = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->status($folder, Horde_Imap_Client::STATUS_MESSAGES); + $status = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->status($folder, Horde_Imap_Client::STATUS_MESSAGES); } catch (Horde_Imap_Client_Exception $e) { continue; } @@ -347,7 +347,7 @@ class IMP_Folder /* Download one message at a time to save on memory * overhead. */ try { - $res = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->fetch($folder, array( + $res = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->fetch($folder, array( Horde_Imap_Client::FETCH_FULLMSG => array('peek' => true, 'stream' => true), Horde_Imap_Client::FETCH_ENVELOPE => true, Horde_Imap_Client::FETCH_DATE => true, @@ -392,7 +392,7 @@ class IMP_Folder { $message = ''; $msgcount = 0; - $imp_imap = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create(); + $imp_imap = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create(); $fd = fopen($mbox, 'r'); while (!feof($fd)) { diff --git a/imp/lib/IMP.php b/imp/lib/IMP.php index 53d8c33a4..38ee2301d 100644 --- a/imp/lib/IMP.php +++ b/imp/lib/IMP.php @@ -348,7 +348,7 @@ class IMP return $cache[$folder]; } - $ns_info = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->getNamespace($folder); + $ns_info = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->getNamespace($folder); $delimiter = is_null($ns_info) ? '' : $ns_info['delimiter']; /* Substitute any translated prefix text. */ @@ -418,7 +418,7 @@ class IMP { $t = $GLOBALS['injector']->createInstance('Horde_Template'); $t->set('forminput', Horde_Util::formInput()); - $t->set('use_folders', $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->allowFolders(), true); + $t->set('use_folders', $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->allowFolders(), true); if ($t->get('use_folders')) { Horde::addScriptFile('imp.js', 'imp'); $menu_view = $GLOBALS['prefs']->getValue('menu_view'); @@ -547,7 +547,7 @@ class IMP */ static public function folderPref($folder, $append) { - $imp_imap = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create(); + $imp_imap = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create(); $def_ns = $imp_imap->defaultNamespace(); $empty_ns = $imp_imap->getNamespace(''); diff --git a/imp/lib/Imap/Acl.php b/imp/lib/Imap/Acl.php index d565dadd9..a6a4425c4 100644 --- a/imp/lib/Imap/Acl.php +++ b/imp/lib/Imap/Acl.php @@ -45,7 +45,7 @@ class IMP_Imap_Acl throw new IMP_Exception(_("ACLs not configured for this server.")); } - $imp_imap = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create(); + $imp_imap = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create(); if (!$imp_imap->queryCapability('ACL')) { throw new IMP_Exception(_("IMAP server does not support ACLs.")); } @@ -129,7 +129,7 @@ class IMP_Imap_Acl public function getACL($mbox) { try { - return $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->getACL($mbox); + return $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->getACL($mbox); } catch (Horde_Imap_Client_Exception $e) { throw new IMP_Exception(_("Could not retrieve ACL")); } @@ -147,7 +147,7 @@ class IMP_Imap_Acl public function editACL($mbox, $user, $acl) { try { - $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->setACL($mbox, $user, array('remove' => empty($acl), 'rights' => implode('', $acl))); + $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->setACL($mbox, $user, array('remove' => empty($acl), 'rights' => implode('', $acl))); } catch (Horde_Imap_Client_Exception $e) { throw new IMP_Exception(sprintf(_("Couldn't give user \"%s\" the following rights for the folder \"%s\": %s"), $user, $mbox, implode('', $acl))); } @@ -164,7 +164,7 @@ class IMP_Imap_Acl public function canEdit($mbox, $user) { try { - $rights = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->listACLRights($mbox, $user); + $rights = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->listACLRights($mbox, $user); $rights = array_merge($rights['required'], $rights['optional']); foreach ($rights as $val) { if (strpos($val, 'a') !== false) { diff --git a/imp/lib/Imap/Tree.php b/imp/lib/Imap/Tree.php index fdd795999..ec19652df 100644 --- a/imp/lib/Imap/Tree.php +++ b/imp/lib/Imap/Tree.php @@ -187,7 +187,7 @@ class IMP_Imap_Tree implements ArrayAccess, Iterator, Serializable unset($this->_cache['fulllist'], $this->_cache['subscribed']); /* Do IMAP specific initialization. */ - $imp_imap = $injector->getInstance('IMP_Injector_Factory_Imap')->create(); + $imp_imap = $injector->getInstance('IMP_Factory_Imap')->create(); if ($session->get('imp', 'protocol') == 'imap') { $ns = $imp_imap->getNamespaceList(); $ptr = reset($ns); @@ -264,7 +264,7 @@ class IMP_Imap_Tree implements ArrayAccess, Iterator, Serializable } try { - $imp_imap = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create(); + $imp_imap = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create(); $result = $imp_imap->listMailboxes($searches, $showunsub ? Horde_Imap_Client::MBOX_ALL : Horde_Imap_Client::MBOX_SUBSCRIBED_EXISTS, array('attributes' => true, 'delimiter' => true, 'sort' => true)); /* INBOX must always appear. */ @@ -470,7 +470,7 @@ class IMP_Imap_Tree implements ArrayAccess, Iterator, Serializable if (!empty($id)) { try { - $this->_insert($GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->listMailboxes($id, Horde_Imap_Client::MBOX_ALL, array('attributes' => true, 'delimiter' => true, 'sort' => true))); + $this->_insert($GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->listMailboxes($id, Horde_Imap_Client::MBOX_ALL, array('attributes' => true, 'delimiter' => true, 'sort' => true))); } catch (Horde_Imap_Client_Exception $e) {} } } @@ -1262,7 +1262,7 @@ class IMP_Imap_Tree implements ArrayAccess, Iterator, Serializable { if (!in_array($mailbox, array(self::OTHER_KEY, self::SHARED_KEY, self::VFOLDER_KEY)) && (strpos($mailbox, self::VFOLDER_KEY . $this->_delimiter) !== 0)) { - return $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->getNamespace($mailbox); + return $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->getNamespace($mailbox); } return null; } @@ -1324,7 +1324,7 @@ class IMP_Imap_Tree implements ArrayAccess, Iterator, Serializable $this->changed = true; } - if (!$GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->allowFolders()) { + if (!$GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->allowFolders()) { return; } @@ -1429,7 +1429,7 @@ class IMP_Imap_Tree implements ArrayAccess, Iterator, Serializable public function createMailboxName($parent, $new) { $ns_info = empty($parent) - ? $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->defaultNamespace() + ? $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->defaultNamespace() : $this->_getNamespace($parent); if (is_null($ns_info)) { diff --git a/imp/lib/Imap/Tree/Element.php b/imp/lib/Imap/Tree/Element.php index 3c6485c97..7a1874b95 100644 --- a/imp/lib/Imap/Tree/Element.php +++ b/imp/lib/Imap/Tree/Element.php @@ -157,7 +157,7 @@ class IMP_Imap_Tree_Element $info->unseen = 0; try { - if ($msgs_info = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->status($this->value, Horde_Imap_Client::STATUS_RECENT | Horde_Imap_Client::STATUS_UNSEEN | Horde_Imap_Client::STATUS_MESSAGES)) { + if ($msgs_info = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->status($this->value, Horde_Imap_Client::STATUS_RECENT | Horde_Imap_Client::STATUS_UNSEEN | Horde_Imap_Client::STATUS_MESSAGES)) { if (!empty($msgs_info['recent'])) { $info->recent = intval($msgs_info['recent']); } diff --git a/imp/lib/Indices.php b/imp/lib/Indices.php index f24a12f5d..44903d82b 100644 --- a/imp/lib/Indices.php +++ b/imp/lib/Indices.php @@ -81,7 +81,7 @@ class IMP_Indices implements Countable, Iterator } } } elseif (is_string($data)) { - $indices = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->getUtils()->fromSequenceString($data); + $indices = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->getUtils()->fromSequenceString($data); } elseif ($data instanceof IMP_Compose) { $indices = array( $data->getMetadata('mailbox') => array($data->getMetadata('uid')) @@ -184,7 +184,7 @@ class IMP_Indices implements Countable, Iterator */ public function __toString() { - return $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->getUtils()->toSequenceString($this->_indices, array('mailbox' => true)); + return $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->getUtils()->toSequenceString($this->_indices, array('mailbox' => true)); } /* Iterator methods. */ diff --git a/imp/lib/LoginTasks/SystemTask/UpgradeFromImp4Auth.php b/imp/lib/LoginTasks/SystemTask/UpgradeFromImp4Auth.php index 4c6920ede..9d8bbe71a 100644 --- a/imp/lib/LoginTasks/SystemTask/UpgradeFromImp4Auth.php +++ b/imp/lib/LoginTasks/SystemTask/UpgradeFromImp4Auth.php @@ -40,7 +40,7 @@ class IMP_LoginTasks_SystemTask_UpgradeFromImp4Auth extends Horde_LoginTasks_Sys protected function _upgradeExpireImapCache() { try { - $ob = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->ob; + $ob = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->ob; if ($cache = $ob->getCache()) { $ob->login(); diff --git a/imp/lib/Mailbox/List.php b/imp/lib/Mailbox/List.php index bcfd92702..fb3447588 100644 --- a/imp/lib/Mailbox/List.php +++ b/imp/lib/Mailbox/List.php @@ -164,7 +164,7 @@ class IMP_Mailbox_List implements Countable, Serializable )); } - $imp_imap = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create(); + $imp_imap = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create(); if (empty($options['preview'])) { $cache = null; @@ -201,7 +201,7 @@ class IMP_Mailbox_List implements Countable, Serializable !in_array('\\seen', $v['flags'])))) { if (empty($preview_info[$k])) { try { - $imp_contents = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Contents')->create(new IMP_Indices($mbox, $k)); + $imp_contents = $GLOBALS['injector']->getInstance('IMP_Factory_Contents')->create(new IMP_Indices($mbox, $k)); $prev = $imp_contents->generatePreview(); $preview_info[$k] = array('IMPpreview' => $prev['text'], 'IMPpreviewc' => $prev['cut']); if (!is_null($cache)) { @@ -352,7 +352,7 @@ class IMP_Mailbox_List implements Countable, Serializable } $criteria = new Horde_Imap_Client_Search_Query(); - $imp_imap = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create(); + $imp_imap = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create(); if (IMP::hideDeletedMsgs($this->_mailbox)) { $criteria->flag('\\deleted', false); @@ -455,7 +455,7 @@ class IMP_Mailbox_List implements Countable, Serializable $ret['anymsg'] = true; if (!$ret['msgcount'] && !$this->_searchmbox) { try { - $status = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->status($this->_mailbox, Horde_Imap_Client::STATUS_MESSAGES); + $status = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->status($this->_mailbox, Horde_Imap_Client::STATUS_MESSAGES); $ret['anymsg'] = (bool)$status['messages']; } catch (Horde_Imap_Client_Exception $e) { $ret['anymsg'] = false; @@ -496,7 +496,7 @@ class IMP_Mailbox_List implements Countable, Serializable * information is returned via a SELECT/EXAMINE call. */ if ($sortpref['by'] == Horde_Imap_Client::SORT_SEQUENCE) { try { - $res = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->status($this->_mailbox, Horde_Imap_Client::STATUS_FIRSTUNSEEN); + $res = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->status($this->_mailbox, Horde_Imap_Client::STATUS_FIRSTUNSEEN); if (!is_null($res['firstunseen'])) { return $res['firstunseen']; } @@ -528,7 +528,7 @@ class IMP_Mailbox_List implements Countable, Serializable { if (is_null($this->_threadob)) { try { - $this->_threadob = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->thread($this->_mailbox, array('criteria' => $GLOBALS['session']->get('imp', 'imap_thread'))); + $this->_threadob = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->thread($this->_mailbox, array('criteria' => $GLOBALS['session']->get('imp', 'imap_thread'))); } catch (Horde_Imap_Client_Exception $e) { $GLOBALS['notification']->push($e); return new Horde_Imap_Client_Thread(array(), 'uid'); @@ -665,7 +665,7 @@ class IMP_Mailbox_List implements Countable, Serializable if (!$this->_searchmbox) { $sortpref = IMP::getSort($this->_mailbox, true); try { - return $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->getCacheId($this->_mailbox, array($sortpref['by'], $sortpref['dir'])); + return $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->getCacheId($this->_mailbox, array($sortpref['by'], $sortpref['dir'])); } catch (Horde_Imap_Client_Exception $e) {} } diff --git a/imp/lib/Message.php b/imp/lib/Message.php index 0f359b3cb..980968728 100644 --- a/imp/lib/Message.php +++ b/imp/lib/Message.php @@ -100,7 +100,7 @@ class IMP_Message break; } - $imp_imap = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create(); + $imp_imap = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create(); foreach ($indices->indices() as $mbox => $msgIndices) { $error = null; @@ -202,7 +202,7 @@ class IMP_Message } } - $imp_imap = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create(); + $imp_imap = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create(); foreach ($indices->indices() as $mbox => $msgIndices) { $error = null; @@ -330,7 +330,7 @@ class IMP_Message foreach ($indices as $folder => $index) { /* Fetch the message contents. */ - $imp_contents = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Contents')->create(new IMP_Indices($folder, $index)); + $imp_contents = $GLOBALS['injector']->getInstance('IMP_Factory_Contents')->create(new IMP_Indices($folder, $index)); /* Fetch the message headers. */ $imp_headers = $imp_contents->getHeaderOb(); @@ -477,7 +477,7 @@ class IMP_Message return; } - $imp_imap = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create(); + $imp_imap = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create(); if ($imp_imap->isReadOnly($mbox)) { throw new IMP_Exception(_("Cannot strip the MIME part as the mailbox is read-only.")); @@ -485,7 +485,7 @@ class IMP_Message $uidvalidity = $imp_imap->checkUidvalidity($mbox); - $contents = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Contents')->create($indices); + $contents = $GLOBALS['injector']->getInstance('IMP_Factory_Contents')->create($indices); $message = $contents->getMIMEMessage(); $boundary = trim($message->getContentTypeParameter('boundary'), '"'); @@ -615,7 +615,7 @@ class IMP_Message $action_array = $action ? array('add' => $flags) : array('remove' => $flags); - $imp_imap = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create(); + $imp_imap = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create(); foreach ($indices->indices() as $mbox => $msgIndices) { $error = null; @@ -670,7 +670,7 @@ class IMP_Message $action_array = $action ? array('add' => $flags) : array('remove' => $flags); - $imp_imap = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create(); + $imp_imap = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create(); foreach ($mboxes as $val) { try { @@ -710,7 +710,7 @@ class IMP_Message return $msg_list ? new IMP_Indices() : null; } - $imp_imap = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create(); + $imp_imap = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create(); $imp_search = $GLOBALS['injector']->getInstance('IMP_Search'); $process_list = $update_list = array(); @@ -761,7 +761,7 @@ class IMP_Message { global $notification, $prefs; - $imp_imap = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create(); + $imp_imap = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create(); $imp_search = $GLOBALS['injector']->getInstance('IMP_Search'); $trash_folder = ($prefs->getValue('use_trash')) ? IMP::folderPref($prefs->getValue('trash_folder'), true) @@ -815,7 +815,7 @@ class IMP_Message public function sizeMailbox($mbox, $formatted = true) { try { - $res = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->fetch($mbox, array(Horde_Imap_Client::FETCH_SIZE => true), array('sequence' => true)); + $res = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->fetch($mbox, array(Horde_Imap_Client::FETCH_SIZE => true), array('sequence' => true)); $size = 0; reset($res); diff --git a/imp/lib/Mime/Viewer/Partial.php b/imp/lib/Mime/Viewer/Partial.php index 245f6170d..877626424 100644 --- a/imp/lib/Mime/Viewer/Partial.php +++ b/imp/lib/Mime/Viewer/Partial.php @@ -109,7 +109,7 @@ class IMP_Mime_Viewer_Partial extends Horde_Mime_Viewer_Base if ($val == $number) { $parts[$number] = $this->_mimepart->getContents(); } else { - $ic = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Contents')->create(new IMP_Indices($mbox, $val)); + $ic = $GLOBALS['injector']->getInstance('IMP_Factory_Contents')->create(new IMP_Indices($mbox, $val)); $parts[$ic->getMIMEMessage()->getContentTypeParameter('number')] = $ic->getBody(); } } diff --git a/imp/lib/Notification/Handler/Decorator/Imap.php b/imp/lib/Notification/Handler/Decorator/Imap.php index bc090ccb8..7d5765dca 100644 --- a/imp/lib/Notification/Handler/Decorator/Imap.php +++ b/imp/lib/Notification/Handler/Decorator/Imap.php @@ -25,7 +25,7 @@ extends Horde_Notification_Handler_Decorator_Base public function notify($options) { if (in_array('status', $options['listeners']) && - ($ob = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()) && + ($ob = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()) && $ob->ob) { /* Display IMAP alerts. */ foreach ($ob->alerts() as $alert) { diff --git a/imp/lib/Prefs/Identity.php b/imp/lib/Prefs/Identity.php index 40ff5e4df..c14053939 100644 --- a/imp/lib/Prefs/Identity.php +++ b/imp/lib/Prefs/Identity.php @@ -563,7 +563,7 @@ class Imp_Prefs_Identity extends Horde_Core_Prefs_Identity */ public function saveSentmail($ident = null) { - return $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->allowFolders() + return $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->allowFolders() ? $this->getValue('save_sent_mail', $ident) : false; } diff --git a/imp/lib/Prefs/Ui.php b/imp/lib/Prefs/Ui.php index cac8e9848..b48a56f5d 100644 --- a/imp/lib/Prefs/Ui.php +++ b/imp/lib/Prefs/Ui.php @@ -66,7 +66,7 @@ class IMP_Prefs_Ui $ui->suppressGroups[] = 'smime'; } - if (!$injector->getInstance('IMP_Injector_Factory_Imap')->create()->allowFolders()) { + if (!$injector->getInstance('IMP_Factory_Imap')->create()->allowFolders()) { $ui->suppressGroups[] = 'searches'; } @@ -129,7 +129,7 @@ class IMP_Prefs_Ui case 'alternative_display': $mock_part = new Horde_Mime_Part(); $mock_part->setType('text/html'); - $v = $injector->getInstance('IMP_Injector_Factory_MimeViewer')->create($mock_part); + $v = $injector->getInstance('IMP_Factory_MimeViewer')->create($mock_part); if (!$v->canRender('inline')) { $ui->suppress[] = 'alternative_display'; @@ -1020,7 +1020,7 @@ class IMP_Prefs_Ui $t = $injector->createInstance('Horde_Template'); $t->setOption('gettext', true); - if (!$injector->getInstance('IMP_Injector_Factory_Imap')->create()->allowFolders()) { + if (!$injector->getInstance('IMP_Factory_Imap')->create()->allowFolders()) { $t->set('nofolder', true); } else { $mailbox_selected = $prefs->getValue('initial_page'); @@ -1441,7 +1441,7 @@ class IMP_Prefs_Ui { global $injector, $prefs; - $imp_imap = $injector->getInstance('IMP_Injector_Factory_Imap')->create(); + $imp_imap = $injector->getInstance('IMP_Factory_Imap')->create(); if (!$imp_imap->allowFolders() || $prefs->isLocked('sent_mail_folder')) { @@ -1932,7 +1932,7 @@ class IMP_Prefs_Ui { global $injector, $prefs; - $imp_imap = $injector->getInstance('IMP_Injector_Factory_Imap')->create(); + $imp_imap = $injector->getInstance('IMP_Factory_Imap')->create(); if (!$imp_imap->allowFolders() || $prefs->isLocked($pref)) { @@ -1947,7 +1947,7 @@ class IMP_Prefs_Ui $folder = substr($folder, strlen(self::PREF_SPECIALUSE)); } elseif (!empty($new)) { $new = Horde_String::convertCharset($new, 'UTF-8', 'UTF7-IMAP'); - $folder = $injector->getInstance('IMP_Injector_Factory_Imap')->create()->appendNamespace($new); + $folder = $injector->getInstance('IMP_Factory_Imap')->create()->appendNamespace($new); if (!$injector->getInstance('IMP_Folder')->create($folder, $prefs->getValue('subscribe'), array($type => true))) { $folder = null; } @@ -1968,7 +1968,7 @@ class IMP_Prefs_Ui protected function _getSpecialUse($use) { if (is_null($this->_cache)) { - $this->_cache = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->listMailboxes('*', Horde_Imap_Client::MBOX_ALL, array( + $this->_cache = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->listMailboxes('*', Horde_Imap_Client::MBOX_ALL, array( 'attributes' => true, 'special_use' => true, 'sort' => true diff --git a/imp/lib/Quota/Mdaemon.php b/imp/lib/Quota/Mdaemon.php index fb7721df2..c5fd11489 100644 --- a/imp/lib/Quota/Mdaemon.php +++ b/imp/lib/Quota/Mdaemon.php @@ -43,7 +43,7 @@ class IMP_Quota_Mdaemon extends IMP_Quota_Base */ public function getQuota() { - $imap_ob = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create(); + $imap_ob = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create(); $userDetails = $this->_getUserDetails( $this->_params['username'], $GLOBALS['session']->get('imp', 'maildomain') diff --git a/imp/lib/Search.php b/imp/lib/Search.php index 70fcc1bcf..37f308280 100644 --- a/imp/lib/Search.php +++ b/imp/lib/Search.php @@ -154,7 +154,7 @@ class IMP_Search implements ArrayAccess, Iterator, Serializable */ public function imapSearch($mailbox, $query, $opts = array()) { - $imp_imap = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create(); + $imp_imap = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create(); /* If doing a from/to search, use display sorting if possible. * Although there is a fallback to a PHP-based display sort, for diff --git a/imp/lib/Spam.php b/imp/lib/Spam.php index d00bcce84..be3b55417 100644 --- a/imp/lib/Spam.php +++ b/imp/lib/Spam.php @@ -43,7 +43,7 @@ class IMP_Spam return 0; } - $imp_imap = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create(); + $imp_imap = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create(); $report_count = $result = 0; foreach ($indices->indices() as $mbox => $msgIndices) { @@ -57,7 +57,7 @@ class IMP_Spam /* Fetch the raw message contents (headers and complete * body). */ try { - $imp_contents = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Contents')->create(new IMP_Indices($mbox, $idx)); + $imp_contents = $GLOBALS['injector']->getInstance('IMP_Factory_Contents')->create(new IMP_Indices($mbox, $idx)); } catch (IMP_Exception $e) { continue; } @@ -119,7 +119,7 @@ class IMP_Spam } if (!isset($imp_compose)) { - $imp_compose = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Compose')->create(); + $imp_compose = $GLOBALS['injector']->getInstance('IMP_Factory_Compose')->create(); try { $from_line = $GLOBALS['injector']->getInstance('IMP_Identity')->getFromLine(); } catch (Horde_Exception $e) { diff --git a/imp/lib/Ui/Block.php b/imp/lib/Ui/Block.php index c52c155dc..80c547031 100644 --- a/imp/lib/Ui/Block.php +++ b/imp/lib/Ui/Block.php @@ -32,7 +32,7 @@ class IMP_Ui_Block $GLOBALS['injector']->getInstance('IMP_Filter')->filter('INBOX'); } - $imp_imap = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create(); + $imp_imap = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create(); /* Get list of mailboxes to poll. */ $poll = $GLOBALS['injector']->getInstance('IMP_Imap_Tree')->getPollList(true); diff --git a/imp/lib/Ui/Compose.php b/imp/lib/Ui/Compose.php index e0fc95738..fe03fb6e2 100644 --- a/imp/lib/Ui/Compose.php +++ b/imp/lib/Ui/Compose.php @@ -171,7 +171,7 @@ class IMP_Ui_Compose if (!is_null($indices)) { try { - $ob = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Contents')->create($indices); + $ob = $GLOBALS['injector']->getInstance('IMP_Factory_Contents')->create($indices); } catch (Horde_Exception $e) {} } diff --git a/imp/lib/Ui/Message.php b/imp/lib/Ui/Message.php index dc06cc1e5..196b21c16 100644 --- a/imp/lib/Ui/Message.php +++ b/imp/lib/Ui/Message.php @@ -70,7 +70,7 @@ class IMP_Ui_Message */ public function MDNCheck($mailbox, $uid, $headers, $confirmed = false) { - $imp_imap = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create(); + $imp_imap = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create(); $pref_val = $GLOBALS['prefs']->getValue('send_mdn'); if (!$pref_val || $imp_imap->isReadOnly($mailbox)) { diff --git a/imp/lib/Views/Compose.php b/imp/lib/Views/Compose.php index 342e11eb6..a8cf8060e 100644 --- a/imp/lib/Views/Compose.php +++ b/imp/lib/Views/Compose.php @@ -45,7 +45,7 @@ class IMP_Views_Compose $t->setOption('gettext', true); if (!empty($args['composeCache'])) { - $imp_compose = $injector->getInstance('IMP_Injector_Factory_Compose')->create($args['composeCache']); + $imp_compose = $injector->getInstance('IMP_Factory_Compose')->create($args['composeCache']); $t->set('composeCache', $args['composeCache']); } @@ -140,7 +140,7 @@ class IMP_Views_Compose $t->set('read_receipt_set', ($d_read != 'ask')); } - $imp_imap = $injector->getInstance('IMP_Injector_Factory_Imap')->create(); + $imp_imap = $injector->getInstance('IMP_Factory_Imap')->create(); $t->set('save_sent_mail', ($imp_imap->allowFolders() && !$prefs->isLocked('save_sent_mail'))); $t->set('priority', $prefs->getValue('set_priority')); if (!$prefs->isLocked('default_encrypt') && diff --git a/imp/lib/Views/ListMessages.php b/imp/lib/Views/ListMessages.php index 71db09491..4622eaa59 100644 --- a/imp/lib/Views/ListMessages.php +++ b/imp/lib/Views/ListMessages.php @@ -106,7 +106,7 @@ class IMP_Views_ListMessages } /* Generate the sorted mailbox list now. */ - $imp_mailbox = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_MailboxList')->create($mbox); + $imp_mailbox = $GLOBALS['injector']->getInstance('IMP_Factory_MailboxList')->create($mbox); $sorted_list = $imp_mailbox->getSortedList(); $msgcount = count($sorted_list['s']); @@ -173,7 +173,7 @@ class IMP_Views_ListMessages } } - $imp_imap = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create(); + $imp_imap = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create(); /* These entries may change during a session, so always need to * update them. */ diff --git a/imp/lib/Views/ShowMessage.php b/imp/lib/Views/ShowMessage.php index 3a4d31bef..2465e5447 100644 --- a/imp/lib/Views/ShowMessage.php +++ b/imp/lib/Views/ShowMessage.php @@ -110,14 +110,14 @@ class IMP_Views_ShowMessage * view. */ $imp_contents = null; try { - $fetch_ret = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Imap')->create()->fetch($mailbox, array( + $fetch_ret = $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->fetch($mailbox, array( Horde_Imap_Client::FETCH_ENVELOPE => true, Horde_Imap_Client::FETCH_HEADERTEXT => array(array('parse' => true, 'peek' => false)) ), array('ids' => array($uid))); if (isset($fetch_ret[$uid]['headertext'])) { /* Parse MIME info and create the body of the message. */ - $imp_contents = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Contents')->create(new IMP_Indices($mailbox, $uid)); + $imp_contents = $GLOBALS['injector']->getInstance('IMP_Factory_Contents')->create(new IMP_Indices($mailbox, $uid)); } } catch (Horde_Imap_Client_Exception $e) { } catch (IMP_Exception $e) {} diff --git a/imp/mailbox-mimp.php b/imp/mailbox-mimp.php index 24fb4fe41..fc2cb13eb 100644 --- a/imp/mailbox-mimp.php +++ b/imp/mailbox-mimp.php @@ -37,7 +37,7 @@ $t = $injector->createInstance('Horde_Template'); $t->setOption('gettext', true); /* Determine if mailbox is readonly. */ -$imp_imap = $injector->getInstance('IMP_Injector_Factory_Imap')->create(); +$imp_imap = $injector->getInstance('IMP_Factory_Imap')->create(); $readonly = $imp_imap->isReadOnly(IMP::$mailbox); /* Get the base URL for this page. */ @@ -125,7 +125,7 @@ case 'rs': } /* Build the list of messages in the mailbox. */ -$imp_mailbox = $injector->getInstance('IMP_Injector_Factory_MailboxList')->create(IMP::$mailbox); +$imp_mailbox = $injector->getInstance('IMP_Factory_MailboxList')->create(IMP::$mailbox); $pageOb = $imp_mailbox->buildMailboxPage($vars->p, $vars->s); /* Generate page title. */ diff --git a/imp/mailbox.php b/imp/mailbox.php index 3ae3c5193..d22c92730 100644 --- a/imp/mailbox.php +++ b/imp/mailbox.php @@ -65,7 +65,7 @@ if (!Horde_Util::nonInputVar('from_message_page')) { $do_filter = false; $imp_flags = $injector->getInstance('IMP_Flags'); -$imp_imap = $injector->getInstance('IMP_Injector_Factory_Imap')->create(); +$imp_imap = $injector->getInstance('IMP_Factory_Imap')->create(); $indices = new IMP_Indices($vars->indices); /* Run through the action handlers */ @@ -235,7 +235,7 @@ if ($imp_imap->allowFolders()) { } /* Build the list of messages in the mailbox. */ -$imp_mailbox = $injector->getInstance('IMP_Injector_Factory_MailboxList')->create(IMP::$mailbox); +$imp_mailbox = $injector->getInstance('IMP_Factory_MailboxList')->create(IMP::$mailbox); $pageOb = $imp_mailbox->buildMailboxPage($vars->page, $start); $show_preview = $prefs->getValue('preview_enabled'); diff --git a/imp/message-dimp.php b/imp/message-dimp.php index 618caf1af..bc2e9f3e4 100644 --- a/imp/message-dimp.php +++ b/imp/message-dimp.php @@ -23,7 +23,7 @@ if (!$vars->uid || !$vars->folder) { $imp_ui = new IMP_Ui_Message(); $js_onload = $js_vars = array(); -$readonly = $injector->getInstance('IMP_Injector_Factory_Imap')->create()->isReadOnly($vars->folder); +$readonly = $injector->getInstance('IMP_Factory_Imap')->create()->isReadOnly($vars->folder); switch ($vars->actionID) { case 'strip_attachment': diff --git a/imp/message-mimp.php b/imp/message-mimp.php index bc76cf6f1..f2d737059 100644 --- a/imp/message-mimp.php +++ b/imp/message-mimp.php @@ -29,12 +29,12 @@ Horde_Registry::appInit('imp', array( $vars = Horde_Variables::getDefaultVariables(); /* Make sure we have a valid index. */ -$imp_mailbox = $injector->getInstance('IMP_Injector_Factory_MailboxList')->create(IMP::$mailbox, new IMP_Indices(IMP::$thismailbox, IMP::$uid)); +$imp_mailbox = $injector->getInstance('IMP_Factory_MailboxList')->create(IMP::$mailbox, new IMP_Indices(IMP::$thismailbox, IMP::$uid)); if (!$imp_mailbox->isValidIndex()) { IMP::generateIMPUrl('mailbox-mimp.php', IMP::$mailbox)->add('a', 'm')->redirect(); } -$readonly = $injector->getInstance('IMP_Injector_Factory_Imap')->create()->isReadOnly(IMP::$mailbox); +$readonly = $injector->getInstance('IMP_Factory_Imap')->create()->isReadOnly(IMP::$mailbox); $imp_ui_mimp = $injector->getInstance('IMP_Ui_Mimp'); $imp_hdr_ui = new IMP_Ui_Headers(); @@ -100,10 +100,10 @@ $uid = $index_ob['uid']; try { /* Need to fetch flags before HEADERTEXT, because SEEN flag might be set * before we can grab it. */ - $flags_ret = $injector->getInstance('IMP_Injector_Factory_Imap')->create()->fetch($mailbox_name, array( + $flags_ret = $injector->getInstance('IMP_Factory_Imap')->create()->fetch($mailbox_name, array( Horde_Imap_Client::FETCH_FLAGS => true, ), array('ids' => array($uid))); - $fetch_ret = $injector->getInstance('IMP_Injector_Factory_Imap')->create()->fetch($mailbox_name, array( + $fetch_ret = $injector->getInstance('IMP_Factory_Imap')->create()->fetch($mailbox_name, array( Horde_Imap_Client::FETCH_ENVELOPE => true, Horde_Imap_Client::FETCH_HEADERTEXT => array(array('parse' => true, 'peek' => $readonly)) ), array('ids' => array($uid))); @@ -118,7 +118,7 @@ $use_pop = ($session->get('imp', 'protocol') == 'pop'); /* Parse the message. */ try { - $imp_contents = $injector->getInstance('IMP_Injector_Factory_Contents')->create(new IMP_Indices($imp_mailbox)); + $imp_contents = $injector->getInstance('IMP_Factory_Contents')->create(new IMP_Indices($imp_mailbox)); } catch (IMP_Exception $e) { IMP::generateIMPUrl('mailbox-mimp.php', $mailbox_name)->add('a', 'm')->redirect(); } diff --git a/imp/message.php b/imp/message.php index 1b1e0e785..07ff984ac 100644 --- a/imp/message.php +++ b/imp/message.php @@ -32,11 +32,11 @@ $registry->setTimeZone(); * select it on the IMAP server (saves some STATUS calls). Open R/W to clear * the RECENT flag. */ if (!($search_mbox = $injector->getInstance('IMP_Search')->isSearchMbox(IMP::$mailbox))) { - $injector->getInstance('IMP_Injector_Factory_Imap')->create()->openMailbox(IMP::$mailbox, Horde_Imap_Client::OPEN_READWRITE); + $injector->getInstance('IMP_Factory_Imap')->create()->openMailbox(IMP::$mailbox, Horde_Imap_Client::OPEN_READWRITE); } /* Make sure we have a valid index. */ -$imp_mailbox = $injector->getInstance('IMP_Injector_Factory_MailboxList')->create(IMP::$mailbox, new IMP_Indices(IMP::$thismailbox, IMP::$uid)); +$imp_mailbox = $injector->getInstance('IMP_Factory_MailboxList')->create(IMP::$mailbox, new IMP_Indices(IMP::$thismailbox, IMP::$uid)); if (!$imp_mailbox->isValidIndex()) { _returnToMailbox(null, 'message_missing'); require IMP_BASE . '/mailbox.php'; @@ -61,7 +61,7 @@ if ($vars->actionID) { } /* Determine if mailbox is readonly. */ -$peek = $readonly = $injector->getInstance('IMP_Injector_Factory_Imap')->create()->isReadOnly(IMP::$mailbox); +$peek = $readonly = $injector->getInstance('IMP_Factory_Imap')->create()->isReadOnly(IMP::$mailbox); /* Get mailbox/UID of message. */ $index_array = $imp_mailbox->getIMAPIndex(); @@ -211,7 +211,7 @@ $uid = $index_array['uid']; /* Parse the message. */ try { - $imp_contents = $injector->getInstance('IMP_Injector_Factory_Contents')->create(new IMP_Indices($imp_mailbox)); + $imp_contents = $injector->getInstance('IMP_Factory_Contents')->create(new IMP_Indices($imp_mailbox)); } catch (IMP_Exception $e) { $imp_mailbox->removeMsgs(true); _returnToMailbox(null, 'message_missing'); @@ -223,10 +223,10 @@ try { try { /* Need to fetch flags before HEADERTEXT, because SEEN flag might be set * before we can grab it. */ - $flags_ret = $injector->getInstance('IMP_Injector_Factory_Imap')->create()->fetch($mailbox_name, array( + $flags_ret = $injector->getInstance('IMP_Factory_Imap')->create()->fetch($mailbox_name, array( Horde_Imap_Client::FETCH_FLAGS => true, ), array('ids' => array($uid))); - $fetch_ret = $injector->getInstance('IMP_Injector_Factory_Imap')->create()->fetch($mailbox_name, array( + $fetch_ret = $injector->getInstance('IMP_Factory_Imap')->create()->fetch($mailbox_name, array( Horde_Imap_Client::FETCH_ENVELOPE => true, Horde_Imap_Client::FETCH_HEADERTEXT => array(array('parse' => true, 'peek' => $peek)) ), array('ids' => array($uid))); @@ -473,7 +473,7 @@ if (!$use_pop) { $n_template->set('flaglist_set', $form_set); $n_template->set('flaglist_unset', $form_unset); - if ($injector->getInstance('IMP_Injector_Factory_Imap')->create()->allowFolders()) { + if ($injector->getInstance('IMP_Factory_Imap')->create()->allowFolders()) { $n_template->set('move', Horde::widget('#', _("Move to folder"), 'widget moveAction', '', '', _("Move"), true)); $n_template->set('copy', Horde::widget('#', _("Copy to folder"), 'widget copyAction', '', '', _("Copy"), true)); $n_template->set('options', IMP::flistSelect(array('heading' => _("This message to"), 'new_folder' => true, 'inc_tasklists' => true, 'inc_notepads' => true))); diff --git a/imp/mobile.php b/imp/mobile.php index 48330fee1..ada77aebb 100644 --- a/imp/mobile.php +++ b/imp/mobile.php @@ -22,7 +22,7 @@ require $registry->get('templates', 'horde') . '/common-header-mobile.inc'; $view = new Horde_View(array('templatePath' => IMP_TEMPLATES . '/mobile')); new Horde_View_Helper_Text($view); -if (!$injector->getInstance('IMP_Injector_Factory_Imap')->create()->allowFolders()) { +if (!$injector->getInstance('IMP_Factory_Imap')->create()->allowFolders()) { $view->allowFolders = false; } else { $view->allowFolders = true; diff --git a/imp/pgp.php b/imp/pgp.php index 4cc7eb7e8..eb44e1f56 100644 --- a/imp/pgp.php +++ b/imp/pgp.php @@ -158,7 +158,7 @@ case 'info_personal_private_key': case 'save_attachment_public_key': /* Retrieve the key from the message. */ - $contents = $injector->getInstance('IMP_Injector_Factory_Contents')->create(new IMP_Indices($vars->mailbox, $vars->uid)); + $contents = $injector->getInstance('IMP_Factory_Contents')->create(new IMP_Indices($vars->mailbox, $vars->uid)); $mime_part = $contents->getMIMEPart($vars->mime_id); if (empty($mime_part)) { throw new IMP_Exception('Cannot retrieve public key from message.'); diff --git a/imp/rss.php b/imp/rss.php index b5cc21bab..cf6d8c03c 100644 --- a/imp/rss.php +++ b/imp/rss.php @@ -46,7 +46,7 @@ if (!empty($request)) { $new_mail = (isset($request_parts[1]) && ($request_parts[1] === 'new')); } -$imp_mailbox = $injector->getInstance('IMP_Injector_Factory_MailboxList')->create($mailbox); +$imp_mailbox = $injector->getInstance('IMP_Factory_MailboxList')->create($mailbox); $imp_search = $injector->getInstance('IMP_Search'); /* Obtain some information describing the mailbox state. */ diff --git a/imp/saveimage.php b/imp/saveimage.php index 1cb8cf566..11be59db6 100644 --- a/imp/saveimage.php +++ b/imp/saveimage.php @@ -21,7 +21,7 @@ $vars = Horde_Variables::getDefaultVariables(); /* Run through the action handlers. */ switch ($vars->actionID) { case 'save_image': - $contents = $injector->getInstance('IMP_Injector_Factory_Contents')->create(new IMP_Indices($vars->mbox, $vars->uid)); + $contents = $injector->getInstance('IMP_Factory_Contents')->create(new IMP_Indices($vars->mbox, $vars->uid)); $mime_part = $contents->getMIMEPart($vars->id); $image_data = array( 'data' => $mime_part->getContents(), diff --git a/imp/smime.php b/imp/smime.php index 6175c704f..3249ade86 100644 --- a/imp/smime.php +++ b/imp/smime.php @@ -102,7 +102,7 @@ case 'process_import_personal_certs': case 'save_attachment_public_key': /* Retrieve the key from the message. */ - $contents = $injector->getInstance('IMP_Injector_Factory_Contents')->create(new IMP_Indices($vars->mailbox, $vars->uid)); + $contents = $injector->getInstance('IMP_Factory_Contents')->create(new IMP_Indices($vars->mailbox, $vars->uid)); $mime_part = $contents->getMIMEPart($vars->mime_id); if (empty($mime_part)) { throw new IMP_Exception(_("Cannot retrieve public key from message.")); diff --git a/imp/templates/dimp/index.inc b/imp/templates/dimp/index.inc index 575d1ad00..11af1db1b 100644 --- a/imp/templates/dimp/index.inc +++ b/imp/templates/dimp/index.inc @@ -14,7 +14,7 @@ $use_trash = $prefs->getValue('use_trash'); $has_blacklist = $registry->hasMethod('mail/blacklistFrom'); $has_whitelist = $registry->hasMethod('mail/whitelistFrom'); -$imp_imap = $injector->getInstance('IMP_Injector_Factory_Imap')->create(); +$imp_imap = $injector->getInstance('IMP_Factory_Imap')->create(); // Quota information $show_quota = $session->get('imp', 'imap_quota') diff --git a/imp/thread.php b/imp/thread.php index 895f01c5c..1a4b31037 100644 --- a/imp/thread.php +++ b/imp/thread.php @@ -28,8 +28,8 @@ $mode = $vars->mode ? $vars->mode : 'thread'; -$imp_imap = $injector->getInstance('IMP_Injector_Factory_Imap')->create(); -$imp_mailbox = $injector->getInstance('IMP_Injector_Factory_MailboxList')->create(IMP::$mailbox, new IMP_Indices(IMP::$thismailbox, IMP::$uid)); +$imp_imap = $injector->getInstance('IMP_Factory_Imap')->create(); +$imp_mailbox = $injector->getInstance('IMP_Factory_MailboxList')->create(IMP::$mailbox, new IMP_Indices(IMP::$thismailbox, IMP::$uid)); $error = false; if ($mode == 'thread') { @@ -95,7 +95,7 @@ foreach ($imp_indices->indices() as $mbox => $idxlist) { /* Get the body of the message. */ $curr_msg = $curr_tree = array(); - $contents = $injector->getInstance('IMP_Injector_Factory_Contents')->create(new IMP_Indices($mbox, $idx)); + $contents = $injector->getInstance('IMP_Factory_Contents')->create(new IMP_Indices($mbox, $idx)); $mime_id = $contents->findBody(); if ($contents->canDisplay($mime_id, IMP_Contents::RENDER_INLINE)) { $ret = $contents->renderMIMEPart($mime_id, IMP_Contents::RENDER_INLINE); diff --git a/imp/view.php b/imp/view.php index 1fc717e88..619767aa1 100644 --- a/imp/view.php +++ b/imp/view.php @@ -57,7 +57,7 @@ Horde_Registry::appInit('imp', array( * message data. Rather, we must use the IMP_Compose object to get the * necessary data for Horde_Mime_Part. */ if ($vars->actionID == 'compose_attach_preview') { - $imp_compose = $injector->getInstance('IMP_Injector_Factory_Compose')->create($vars->composeCache); + $imp_compose = $injector->getInstance('IMP_Factory_Compose')->create($vars->composeCache); $mime = $imp_compose->buildAttachment($vars->id); $mime->setMimeId($vars->id); @@ -68,7 +68,7 @@ if ($vars->actionID == 'compose_attach_preview') { if (!$vars->uid || !$vars->mailbox) { exit; } - $contents = $injector->getInstance('IMP_Injector_Factory_Contents')->create(new IMP_Indices($vars->mailbox, $vars->uid)); + $contents = $injector->getInstance('IMP_Factory_Contents')->create(new IMP_Indices($vars->mailbox, $vars->uid)); } /* Run through action handlers */ diff --git a/jonah/lib/Application.php b/jonah/lib/Application.php index 1506cd805..feff5318b 100644 --- a/jonah/lib/Application.php +++ b/jonah/lib/Application.php @@ -35,7 +35,7 @@ class Jonah_Application extends Horde_Registry_Application */ protected function _init() { - $GLOBALS['injector']->bindFactory('Jonah_Driver', 'Jonah_Injector_Factory_Driver', 'create'); + $GLOBALS['injector']->bindFactory('Jonah_Driver', 'Jonah_Factory_Driver', 'create'); if ($channel_id = Horde_Util::getFormData('channel_id')) { $url = Horde::url('delivery/rss.php', true, -1) diff --git a/jonah/lib/Injector/Factory/Driver.php b/jonah/lib/Factory/Driver.php similarity index 97% rename from jonah/lib/Injector/Factory/Driver.php rename to jonah/lib/Factory/Driver.php index aba88bf8e..b760dc526 100644 --- a/jonah/lib/Injector/Factory/Driver.php +++ b/jonah/lib/Factory/Driver.php @@ -1,7 +1,7 @@ * @package Jonah */ -class Jonah_Injector_Factory_Driver +class Jonah_Factory_Driver { /** * Instances. @@ -26,7 +26,7 @@ class Jonah_Injector_Factory_Driver * @var Horde_Injector */ private $_injector; - + /** * Constructor. * @@ -67,4 +67,4 @@ class Jonah_Injector_Factory_Driver return $this->_instances[$sig]; } -} \ No newline at end of file +} diff --git a/kronolith/lib/Ajax/Application.php b/kronolith/lib/Ajax/Application.php index bff402dc7..97e07fb4e 100644 --- a/kronolith/lib/Ajax/Application.php +++ b/kronolith/lib/Ajax/Application.php @@ -850,7 +850,7 @@ class Kronolith_Ajax_Application extends Horde_Core_Ajax_Application $result = new stdClass; try { - $driver = $GLOBALS['injector']->getInstance('Kronolith_Injector_Factory_Driver')->create('Ical', $params); + $driver = $GLOBALS['injector']->getInstance('Kronolith_Factory_Driver')->create('Ical', $params); $driver->open($this->_vars->url); $ical = $driver->getRemoteCalendar(false); $result->success = true; diff --git a/kronolith/lib/Application.php b/kronolith/lib/Application.php index 08b182b32..950141870 100644 --- a/kronolith/lib/Application.php +++ b/kronolith/lib/Application.php @@ -72,7 +72,7 @@ class Kronolith_Application extends Horde_Registry_Application throw new Horde_Exception('The Content_Tagger class could not be found. Make sure the registry entry for the Content system is present.'); } - $GLOBALS['injector']->bindFactory('Kronolith_Geo', 'Kronolith_Injector_Factory_Geo', 'create'); + $GLOBALS['injector']->bindFactory('Kronolith_Geo', 'Kronolith_Factory_Geo', 'create'); /* Set the timezone variable, if available. */ $GLOBALS['registry']->setTimeZone(); diff --git a/kronolith/lib/Injector/Factory/Driver.php b/kronolith/lib/Factory/Driver.php similarity index 97% rename from kronolith/lib/Injector/Factory/Driver.php rename to kronolith/lib/Factory/Driver.php index d8ea70f1d..ac67b5563 100644 --- a/kronolith/lib/Injector/Factory/Driver.php +++ b/kronolith/lib/Factory/Driver.php @@ -2,7 +2,7 @@ /** * Horde_Injector based factory for Kronolith_Driver */ -class Kronolith_Injector_Factory_Driver +class Kronolith_Factory_Driver { /** * Instances. @@ -60,4 +60,4 @@ class Kronolith_Injector_Factory_Driver return $driver; } -} \ No newline at end of file +} diff --git a/kronolith/lib/Injector/Factory/Geo.php b/kronolith/lib/Factory/Geo.php similarity index 96% rename from kronolith/lib/Injector/Factory/Geo.php rename to kronolith/lib/Factory/Geo.php index 56e8e4abc..73fe6243d 100644 --- a/kronolith/lib/Injector/Factory/Geo.php +++ b/kronolith/lib/Factory/Geo.php @@ -5,7 +5,7 @@ * @author Michael J Rubinsky * @package Kronolith */ -class Kronolith_Injector_Factory_Geo +class Kronolith_Factory_Geo { /** * Instances. @@ -35,4 +35,4 @@ class Kronolith_Injector_Factory_Geo return $this->_instances[$GLOBALS['conf']['maps']['geodriver']]; } -} \ No newline at end of file +} diff --git a/kronolith/lib/Injector/Factory/Storage.php b/kronolith/lib/Factory/Storage.php similarity index 97% rename from kronolith/lib/Injector/Factory/Storage.php rename to kronolith/lib/Factory/Storage.php index b2174a4cc..ba88b4281 100644 --- a/kronolith/lib/Injector/Factory/Storage.php +++ b/kronolith/lib/Factory/Storage.php @@ -1,6 +1,6 @@ getInstance('Kronolith_Injector_Factory_Storage')->create(); + $storage = $GLOBALS['injector']->getInstance('Kronolith_Factory_Storage')->create(); try { $fb = $storage->search($email); diff --git a/kronolith/lib/Kronolith.php b/kronolith/lib/Kronolith.php index 670b5e695..0fe7c1c21 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -2753,7 +2753,7 @@ class Kronolith break; } - self::$_instances[$driver] = $GLOBALS['injector']->getInstance('Kronolith_Injector_Factory_Driver')->create($driver, $params); + self::$_instances[$driver] = $GLOBALS['injector']->getInstance('Kronolith_Factory_Driver')->create($driver, $params); } if (!is_null($calendar)) { diff --git a/turba/add.php b/turba/add.php index 734200e6b..d6dbf8976 100644 --- a/turba/add.php +++ b/turba/add.php @@ -34,7 +34,7 @@ if (!$addSources) { /* A source has been selected, connect and set up the fields. */ if ($source) { try { - $driver = $injector->getInstance('Turba_Injector_Factory_Driver')->create($source); + $driver = $injector->getInstance('Turba_Factory_Driver')->create($source); } catch (Turba_Exception $e) { $notification->push($e, 'horde.error'); $driver = null; diff --git a/turba/contact.php b/turba/contact.php index 56c747af3..6f3342180 100644 --- a/turba/contact.php +++ b/turba/contact.php @@ -22,7 +22,7 @@ if (!isset($GLOBALS['cfgSources'][$source])) { /* Set the contact from the key requested. */ try { - $driver = $injector->getInstance('Turba_Injector_Factory_Driver')->create($source); + $driver = $injector->getInstance('Turba_Factory_Driver')->create($source); } catch (Turba_Exception $e) { $notification->push($e, 'horde.error'); Horde::url($prefs->getValue('initial_page'), true)->redirect(); diff --git a/turba/data.php b/turba/data.php index e635a3036..eee4ec084 100644 --- a/turba/data.php +++ b/turba/data.php @@ -242,7 +242,7 @@ case 'export': foreach ($sources as $source => $objectkeys) { /* Create a Turba storage instance. */ try { - $driver = $injector->getInstance('Turba_Injector_Factory_Driver')->create($source); + $driver = $injector->getInstance('Turba_Factory_Driver')->create($source); } catch (Turba_Exception $e) { $notification->push($e, 'horde.error'); $error = true; @@ -335,7 +335,7 @@ case 'export': case Horde_Data::IMPORT_FILE: $dest = Horde_Util::getFormData('dest'); try { - $driver = $injector->getInstance('Turba_Injector_Factory_Driver')->create($dest); + $driver = $injector->getInstance('Turba_Factory_Driver')->create($dest); } catch (Turba_Exception $e) { $notification->push($e, 'horde.error'); $error = true; @@ -423,7 +423,7 @@ if (is_array($next_step)) { /* Create a Turba storage instance. */ $dest = $session->get('horde', 'import_data/target'); try { - $driver = $injector->getInstance('Turba_Injector_Factory_Driver')->create($dest); + $driver = $injector->getInstance('Turba_Factory_Driver')->create($dest); } catch (Turba_Exception $e) { $notification->push($e, 'horde.error'); $driver = null; diff --git a/turba/delete.php b/turba/delete.php index 8f37d8649..4628413ea 100644 --- a/turba/delete.php +++ b/turba/delete.php @@ -18,7 +18,7 @@ Horde_Registry::appInit('turba'); $source = Horde_Util::getFormData('source'); $key = Horde_Util::getFormData('key'); -$driver = $injector->getInstance('Turba_Injector_Factory_Driver')->create($source); +$driver = $injector->getInstance('Turba_Factory_Driver')->create($source); if ($conf['documents']['type'] != 'none') { try { diff --git a/turba/deletefile.php b/turba/deletefile.php index 778499ee9..ff4d495d5 100644 --- a/turba/deletefile.php +++ b/turba/deletefile.php @@ -23,7 +23,7 @@ if ($source === null || !isset($cfgSources[$source])) { Horde::url($prefs->getValue('initial_page'), true)->redirect(); } -$driver = $injector->getInstance('Turba_Injector_Factory_Driver')->create($source); +$driver = $injector->getInstance('Turba_Factory_Driver')->create($source); try { $contact = $driver->getObject(Horde_Util::getPost('key')); diff --git a/turba/edit.php b/turba/edit.php index b60ccfb29..d0335e963 100644 --- a/turba/edit.php +++ b/turba/edit.php @@ -45,7 +45,7 @@ if ($source === null || !isset($cfgSources[$source])) { $url->redirect(); } -$driver = $injector->getInstance('Turba_Injector_Factory_Driver')->create($source); +$driver = $injector->getInstance('Turba_Factory_Driver')->create($source); /* Set the contact from the requested key. */ try { diff --git a/turba/lib/Api.php b/turba/lib/Api.php index f23e902df..bc6ae861f 100644 --- a/turba/lib/Api.php +++ b/turba/lib/Api.php @@ -51,7 +51,7 @@ class Turba_Api extends Horde_Registry_Api @list($source, $key) = explode('.', $id, 2); if (isset($GLOBALS['cfgSources'][$source]) && $key) { try { - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($source); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($source); $object = $driver->getObject($key)->getValue('name'); } catch (Turba_Exception $e) {} } @@ -134,7 +134,7 @@ class Turba_Api extends Horde_Registry_Api } try { - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($params['source']); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($params['source']); if ($driver->checkDefaultShare($share, $cfgSources[$params['source']])) { return $uid; } @@ -322,7 +322,7 @@ class Turba_Api extends Horde_Registry_Api } // Load the Turba driver. - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($parts[1]); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($parts[1]); $contacts = $driver->search(array()); @@ -371,7 +371,7 @@ class Turba_Api extends Horde_Registry_Api } // Load the Turba driver. - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($parts[1]); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($parts[1]); $contact = $driver->getObject($parts[2]); @@ -418,7 +418,7 @@ class Turba_Api extends Horde_Registry_Api } // Load the Turba driver. - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($parts[1]); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($parts[1]); return $driver->delete($parts[2]); } @@ -458,7 +458,7 @@ class Turba_Api extends Horde_Registry_Api throw new Turba_Exception(sprintf(_("Invalid address book: %s"), $source)); } - $storage = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($source); + $storage = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($source); try { $results = $storage->search(array()); @@ -518,7 +518,7 @@ class Turba_Api extends Horde_Registry_Api throw new Turba_Exception(sprintf(_("Invalid address book: %s"), $source)); } - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($source); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($source); $histories = $history->getByTimestamp( '>', $timestamp, $filter, @@ -589,7 +589,7 @@ class Turba_Api extends Horde_Registry_Api throw new Turba_Exception(sprintf(_("Invalid address book: %s"), $source)); } - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($source); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($source); $ts = $history->getActionTimestamp('turba:' . $driver->getName() . ':' . $uid, @@ -635,7 +635,7 @@ class Turba_Api extends Horde_Registry_Api throw new Turba_Exception(sprintf(_("Invalid address book: %s"), $import_source)); } - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($import_source); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($import_source); if (!$driver->hasPermission(Horde_Perms::EDIT)) { throw new Turba_Exception(_("Permission denied")); @@ -763,7 +763,7 @@ class Turba_Api extends Horde_Registry_Api throw new Turba_Exception(_("Invalid ID")); } - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($source); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($source); if (!$driver->hasPermission(Horde_Perms::READ)) { continue; @@ -827,7 +827,7 @@ class Turba_Api extends Horde_Registry_Api public function ownVCard() { $contact = $this->getOwnContactObject(); - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($contact['source']); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($contact['source']); $vcard = $driver->tovCard($contact['contact'], '3.0', null, true); $vcard->setAttribute('VERSION', '3.0'); @@ -868,7 +868,7 @@ class Turba_Api extends Horde_Registry_Api throw new Turba_Exception(_("The address book with your own contact doesn't exist anymore.")); } - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($source); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($source); if (!$driver->hasPermission(Horde_Perms::READ)) { throw new Turba_Exception(_("You don't have sufficient permissions to read the address book that contains your own contact.")); @@ -933,7 +933,7 @@ class Turba_Api extends Horde_Registry_Api throw new Turba_Exception(_("Invalid ID")); } - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($source); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($source); if (!$GLOBALS['registry']->isAdmin() && !$driver->hasPermission(Horde_Perms::DELETE)) { @@ -996,7 +996,7 @@ class Turba_Api extends Horde_Registry_Api } // Check permissions. - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($source); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($source); if (!$driver->hasPermission(Horde_Perms::EDIT)) { continue; } @@ -1121,7 +1121,7 @@ class Turba_Api extends Horde_Registry_Api continue; } - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($source); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($source); // Determine the name of the column to sort by. $columns = isset($sort_columns[$source]) @@ -1274,7 +1274,7 @@ class Turba_Api extends Horde_Registry_Api } if (isset($cfgSources[$source])) { - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($source); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($source); $object = $driver->getObject($objectId); @@ -1310,7 +1310,7 @@ class Turba_Api extends Horde_Registry_Api } if (isset($cfgSources[$source])) { - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($source); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($source); $objects = $driver->getObjects($objectIds); @@ -1351,7 +1351,7 @@ class Turba_Api extends Horde_Registry_Api $results = array(); foreach ($sources as $source) { if (isset($cfgSources[$source])) { - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($source); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($source); $res = $driver->search(array()); if (!($res instanceof Turba_List)) { @@ -1419,7 +1419,7 @@ class Turba_Api extends Horde_Registry_Api $objects = array(); foreach ($time_categories as $category) { list($category, $source) = explode('/', $category, 2); - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($source); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($source); $objects = array_merge($objects, $driver->listTimeObjects($start, $end, $category)); } @@ -1563,7 +1563,7 @@ class Turba_Api extends Horde_Registry_Api throw new Turba_Exception(_("Invalid entry")); } - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($source); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($source); if (!$driver->hasPermission(Horde_Perms::EDIT)) { throw new Turba_Exception(_("Permission denied")); @@ -1654,7 +1654,7 @@ class Turba_Api extends Horde_Registry_Api continue; } - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($source); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($source); $criterium = array('email' => $address); if (!isset($driver->map['email'])) { if (isset($driver->map['emails'])) { @@ -1719,7 +1719,7 @@ class Turba_Api extends Horde_Registry_Api foreach ($sources as $source) { if (isset($cfgSources[$source])) { - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($source); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($source); if (!$driver->hasPermission(Horde_Perms::EDIT)) { continue; } diff --git a/turba/lib/Application.php b/turba/lib/Application.php index a42b0182e..463d14e44 100644 --- a/turba/lib/Application.php +++ b/turba/lib/Application.php @@ -400,7 +400,7 @@ class Turba_Application extends Horde_Registry_Application if (empty($source['use_shares'])) { // Shares not enabled for this source try { - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($source); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($source); } catch (Turba_Exception $e) { Horde::logMessage($e, 'ERR'); throw new Turba_Exception(sprintf(_("There was an error removing an address book for %s"), $user)); @@ -433,7 +433,7 @@ class Turba_Application extends Horde_Registry_Application if (!empty($params['default'])) { $config = Turba::getSourceFromShare($share); try { - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($config); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($config); } catch (Turba_Exception $e) { continue; } diff --git a/turba/lib/Driver/Share.php b/turba/lib/Driver/Share.php index 57023a598..da5f2e820 100644 --- a/turba/lib/Driver/Share.php +++ b/turba/lib/Driver/Share.php @@ -44,7 +44,7 @@ class Turba_Driver_Share extends Turba_Driver { parent::__construct($name, $params); $this->_share = $this->_params['config']['params']['share']; - $this->_driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($this->_params['config']); + $this->_driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($this->_params['config']); } /** diff --git a/turba/lib/Driver/Vbook.php b/turba/lib/Driver/Vbook.php index 0aea11519..afffabe13 100644 --- a/turba/lib/Driver/Vbook.php +++ b/turba/lib/Driver/Vbook.php @@ -41,7 +41,7 @@ class Turba_Driver_Vbook extends Turba_Driver $this->_share = $this->_params['share']; /* Load the underlying driver. */ - $this->_driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($this->_params['source']); + $this->_driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($this->_params['source']); $this->searchCriteria = empty($this->_params['criteria']) ? array() diff --git a/turba/lib/Injector/Factory/Driver.php b/turba/lib/Factory/Driver.php similarity index 99% rename from turba/lib/Injector/Factory/Driver.php rename to turba/lib/Factory/Driver.php index 74ce00aa8..168a66952 100644 --- a/turba/lib/Injector/Factory/Driver.php +++ b/turba/lib/Factory/Driver.php @@ -25,7 +25,7 @@ * @link http://pear.horde.org/index.php?package=Turba * @package Turba */ -class Turba_Injector_Factory_Driver +class Turba_Factory_Driver { /** * Instances. diff --git a/turba/lib/Form/CreateAddressBook.php b/turba/lib/Form/CreateAddressBook.php index c0a6befae..985d24500 100644 --- a/turba/lib/Form/CreateAddressBook.php +++ b/turba/lib/Form/CreateAddressBook.php @@ -35,7 +35,7 @@ class Turba_Form_CreateAddressBook extends Horde_Form // Need a clean cfgSources array include TURBA_BASE . '/config/backends.php'; - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($cfgSources[$GLOBALS['conf']['shares']['source']]); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($cfgSources[$GLOBALS['conf']['shares']['source']]); $params = array( 'params' => array('source' => $GLOBALS['conf']['shares']['source']), diff --git a/turba/lib/Form/DeleteAddressBook.php b/turba/lib/Form/DeleteAddressBook.php index 3bae3e77e..6fe2f91e6 100644 --- a/turba/lib/Form/DeleteAddressBook.php +++ b/turba/lib/Form/DeleteAddressBook.php @@ -50,7 +50,7 @@ class Turba_Form_DeleteAddressBook extends Horde_Form throw new Turba_Exception(_("You do not have permissions to delete this address book.")); } - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($this->_addressbook->getName()); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($this->_addressbook->getName()); // We have a Turba_Driver, try to delete the address book. $driver->deleteAll(); diff --git a/turba/lib/List.php b/turba/lib/List.php index 978152617..ee07d8118 100644 --- a/turba/lib/List.php +++ b/turba/lib/List.php @@ -38,7 +38,7 @@ class Turba_List implements Countable foreach ($ids as $value) { list($source, $key) = explode(':', $value); try { - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($source); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($source); $this->insert($driver->getObject($key)); } catch (Turba_Exception $e) {} } diff --git a/turba/lib/LoginTasks/SystemTask/UpgradeLists.php b/turba/lib/LoginTasks/SystemTask/UpgradeLists.php index 6c4adeb09..cdfc37770 100644 --- a/turba/lib/LoginTasks/SystemTask/UpgradeLists.php +++ b/turba/lib/LoginTasks/SystemTask/UpgradeLists.php @@ -40,7 +40,7 @@ class Turba_LoginTasks_SystemTask_UpgradeLists extends Horde_LoginTasks_SystemTa $sources = array_keys($GLOBALS['cfgSources']); foreach ($sources as $sourcekey) { try { - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($sourcekey); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($sourcekey); $lists = $driver->search($criteria); } catch (Turba_Exception $e) { return false; diff --git a/turba/lib/Object/Group.php b/turba/lib/Object/Group.php index b2502f1e2..9077442c5 100644 --- a/turba/lib/Object/Group.php +++ b/turba/lib/Object/Group.php @@ -69,7 +69,7 @@ class Turba_Object_Group extends Turba_Object if ($sourceId == $this->getSource()) { $contact = $this->driver->getObject($contactId); } else { - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($sourceId); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($sourceId); $contact = $driver->getObject($contactId); } @@ -172,7 +172,7 @@ class Turba_Object_Group extends Turba_Object } try { - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($sourceId); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($sourceId); } catch (Turba_Exception $e) { continue; } diff --git a/turba/lib/Turba.php b/turba/lib/Turba.php index 48b0a9ad4..e94c84d7c 100644 --- a/turba/lib/Turba.php +++ b/turba/lib/Turba.php @@ -367,7 +367,7 @@ class Turba foreach ($in as $sourceId => $source) { try { - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($sourceId); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($sourceId); } catch (Turba_Exception $e) { Horde::logMessage($e, 'ERR'); continue; @@ -454,7 +454,7 @@ class Turba if ($GLOBALS['registry']->getAuth() && !$personal) { // User's default share is missing. try { - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($source); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($source); } catch (Turba_Exception $e) { $GLOBALS['notification']->push($driver, 'horde.error'); continue; diff --git a/turba/lib/View/Browse.php b/turba/lib/View/Browse.php index 9c69e7b79..75a15d7bd 100644 --- a/turba/lib/View/Browse.php +++ b/turba/lib/View/Browse.php @@ -68,7 +68,7 @@ class Turba_View_Browse } else { try { $driver = $GLOBALS['injector'] - ->getInstance('Turba_Injector_Factory_Driver') + ->getInstance('Turba_Factory_Driver') ->create($source); } catch (Turba_Exception $e) { $notification->push($e, 'horde.error'); @@ -160,7 +160,7 @@ class Turba_View_Browse try { $targetDriver = $GLOBALS['injector'] - ->getInstance('Turba_Injector_Factory_Driver') + ->getInstance('Turba_Factory_Driver') ->create($targetSource); } catch (Turba_Exception $e) { $notification->push($e, 'horde.error'); @@ -191,7 +191,7 @@ class Turba_View_Browse // Try and load the driver for the source. try { $sourceDriver = $GLOBALS['injector'] - ->getInstance('Turba_Injector_Factory_Driver') + ->getInstance('Turba_Factory_Driver') ->create($objectSource); } catch (Turba_Exception $e) { $notification->push($e, 'horde.error'); @@ -303,7 +303,7 @@ class Turba_View_Browse try { $targetDriver = $GLOBALS['injector'] - ->getInstance('Turba_Injector_Factory_Driver') + ->getInstance('Turba_Factory_Driver') ->create($targetSource); } catch (Turba_Exception $e) { $notification->push($e, 'horde.error'); @@ -320,7 +320,7 @@ class Turba_View_Browse $targetSource = $vars->get('targetAddressbook'); try { $targetDriver = $GLOBALS['injector'] - ->getInstance('Turba_Injector_Factory_Driver') + ->getInstance('Turba_Factory_Driver') ->create($targetSource); } catch (Turba_Exception $e) { $notification->push($e, 'horde.error'); diff --git a/turba/lib/View/List.php b/turba/lib/View/List.php index 02020ebcb..5ac193db9 100644 --- a/turba/lib/View/List.php +++ b/turba/lib/View/List.php @@ -161,7 +161,7 @@ class Turba_View_List implements Countable global $prefs, $session, $default_source, $copymove_source_options; $driver = $GLOBALS['injector'] - ->getInstance('Turba_Injector_Factory_Driver') + ->getInstance('Turba_Factory_Driver') ->create($default_source); $hasDelete = $driver->hasPermission(Horde_Perms::DELETE); $hasEdit = $driver->hasPermission(Horde_Perms::EDIT); @@ -424,7 +424,7 @@ class Turba_View_List implements Countable 'name' => '  ' . htmlspecialchars($srcConfig['title']), 'source' => htmlspecialchars($src)); - $srcDriver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($src); + $srcDriver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($src); try { $listList = $srcDriver->search( array('__type' => 'Group'), diff --git a/turba/lib/tests/KolabTest.php b/turba/lib/tests/KolabTest.php index 38188c3f7..5a5e6e411 100644 --- a/turba/lib/tests/KolabTest.php +++ b/turba/lib/tests/KolabTest.php @@ -47,14 +47,14 @@ class Turba_KolabTest extends Turba_KolabTestBase { $this->_kolab->_storage->save($object); // Check that the driver can be created - $turba = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create('wrobel@example.org'); + $turba = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create('wrobel@example.org'); //$this->assertNoError($turba); $result = $turba->search(array(), array('last-name')); $this->assertNoError($result); $this->assertEquals(2, count($result)); - $turba = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create('INBOX%2Ftest2'); + $turba = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create('INBOX%2Ftest2'); $result = $turba->search(array(), array('last-name')); $this->assertEquals(0, count($result)); @@ -75,7 +75,7 @@ class Turba_KolabTest extends Turba_KolabTestBase { ); // Save the contact - $turba = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create('wrobel@example.org'); + $turba = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create('wrobel@example.org'); //$this->assertNoError($turba); $this->assertNoError($turba->_add($object)); @@ -102,7 +102,7 @@ class Turba_KolabTest extends Turba_KolabTestBase { ); // Save the contact - $turba = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create('wrobel@example.org'); + $turba = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create('wrobel@example.org'); //$this->assertNoError($turba); $this->assertNoError($turba->_add($object)); diff --git a/turba/merge.php b/turba/merge.php index b288a176b..deb7d30fc 100644 --- a/turba/merge.php +++ b/turba/merge.php @@ -16,7 +16,7 @@ Horde_Registry::appInit('turba'); $source = Horde_Util::getFormData('source'); $key = Horde_Util::getFormData('key'); $mergeInto = Horde_Util::getFormData('merge_into'); -$driver = $injector->getInstance('Turba_Injector_Factory_Driver')->create($source); +$driver = $injector->getInstance('Turba_Factory_Driver')->create($source); if ($url = Horde_Util::getFormData('url')) { $url = new Horde_Url($url, true); diff --git a/turba/minisearch.php b/turba/minisearch.php index 66a7e2101..e304a0e90 100644 --- a/turba/minisearch.php +++ b/turba/minisearch.php @@ -22,7 +22,7 @@ $source = Horde_Util::getFormData('source', Turba::getDefaultAddressBook()); // Do the search if we have one. if (!is_null($search)) { try { - $driver = $injector->getInstance('Turba_Injector_Factory_Driver')->create($source); + $driver = $injector->getInstance('Turba_Factory_Driver')->create($source); $criteria['name'] = trim($search); $res = $driver->search($criteria); diff --git a/turba/scripts/import_squirrelmail_file_abook.php b/turba/scripts/import_squirrelmail_file_abook.php index 5d848ebe9..53e6d2d07 100755 --- a/turba/scripts/import_squirrelmail_file_abook.php +++ b/turba/scripts/import_squirrelmail_file_abook.php @@ -83,7 +83,7 @@ foreach($files as $file) { // Initiate driver try { - $driver = $GLOBALS['injector']->getInstance('Turba_Injector_Factory_Driver')->create($import_source); + $driver = $GLOBALS['injector']->getInstance('Turba_Factory_Driver')->create($import_source); } catch (Turba_Exception $e) { PEAR::raiseError(sprintf(_("Connection failed: %s"), $e->getMessage()), 'horde.error', null, null, $import_source); continue; diff --git a/turba/scripts/import_squirrelmail_sql_abook.php b/turba/scripts/import_squirrelmail_sql_abook.php index bc97bf7b9..5f370a68f 100755 --- a/turba/scripts/import_squirrelmail_sql_abook.php +++ b/turba/scripts/import_squirrelmail_sql_abook.php @@ -92,7 +92,7 @@ while ($row = $handle->fetchRow(DB_FETCHMODE_ASSOC)) { // Initiate driver try { - $driver = $injector->getInstance('Turba_Injector_Factory_Driver')->create($import_source); + $driver = $injector->getInstance('Turba_Factory_Driver')->create($import_source); } catch (Turba_Exception $e) { $cli->message(' ' . sprintf(_("Connection failed: %s"), $e->getMessage()), 'cli.error'); continue; diff --git a/turba/scripts/upgrades/public_to_horde_share.php b/turba/scripts/upgrades/public_to_horde_share.php index e832fd937..5c55b240b 100755 --- a/turba/scripts/upgrades/public_to_horde_share.php +++ b/turba/scripts/upgrades/public_to_horde_share.php @@ -68,7 +68,7 @@ $share->save(); $CLI->message('Created new Horde_Share object for the shared address book.', 'cli.success'); // Share created, now get a Turba_Driver and make the changes. -$driver = $injector->getInstance('Turba_Injector_Factory_Driver')->create($sourceKey); +$driver = $injector->getInstance('Turba_Factory_Driver')->create($sourceKey); $db = &$driver->_db; diff --git a/turba/search.php b/turba/search.php index 8238fdbeb..5e6d8b448 100644 --- a/turba/search.php +++ b/turba/search.php @@ -85,7 +85,7 @@ $val = Horde_Util::getFormData('val'); $action = Horde_Util::getFormData('actionID'); try { - $driver = $injector->getInstance('Turba_Injector_Factory_Driver')->create($source); + $driver = $injector->getInstance('Turba_Factory_Driver')->create($source); } catch (Turba_Exception $e) { $notification->push($e, 'horde.error'); $driver = null; diff --git a/turba/vcard.php b/turba/vcard.php index eaa6c153e..417ee2fc5 100644 --- a/turba/vcard.php +++ b/turba/vcard.php @@ -19,7 +19,7 @@ if (!isset($cfgSources[$source])) { Horde::url($prefs->getValue('initial_page'), true)->redirect(); } -$driver = $injector->getInstance('Turba_Injector_Factory_Driver')->create($source); +$driver = $injector->getInstance('Turba_Factory_Driver')->create($source); /* Set the contact from the key requested. */ try { diff --git a/turba/view.php b/turba/view.php index 377640afb..c2f9b5702 100644 --- a/turba/view.php +++ b/turba/view.php @@ -28,7 +28,7 @@ if (!isset($cfgSources[$source])) { throw new Turba_Exception(_("The contact you requested does not exist.")); } -$driver = $injector->getInstance('Turba_Injector_Factory_Driver')->create($source); +$driver = $injector->getInstance('Turba_Factory_Driver')->create($source); $object = $driver->getObject($key); /* Check permissions. */ -- 2.11.0