From: Michael M Slusarz Date: Tue, 7 Jul 2009 22:30:52 +0000 (-0600) Subject: PHP 5 coding standards X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=ce92aaf85475453978c8aebe8634e13b6231c385;p=horde.git PHP 5 coding standards --- diff --git a/imp/acl.php b/imp/acl.php index ba2e20958..34d812fed 100644 --- a/imp/acl.php +++ b/imp/acl.php @@ -23,7 +23,7 @@ if ($prefs->isLocked('acl') || empty($_SESSION['imp']['acl'])) { } try { - $ACLDriver = &IMP_Imap_Acl::singleton(); + $ACLDriver = IMP_Imap_Acl::singleton(); } catch (Horde_Exception $e) { $notification->push($error, _("This server does not support sharing folders.")); header('Location: ' . $prefs_url); @@ -119,7 +119,7 @@ case 'imp_acl_set': break; } -$imp_folder = &IMP_Folder::singleton(); +$imp_folder = IMP_Folder::singleton(); $rights = $ACLDriver->getRights(); if (empty($folder)) { diff --git a/imp/ajax.php b/imp/ajax.php index 2ac83a8bb..e319fd295 100644 --- a/imp/ajax.php +++ b/imp/ajax.php @@ -246,7 +246,7 @@ case 'EmptyFolder': break; } - $imp_message = &IMP_Message::singleton(); + $imp_message = IMP_Message::singleton(); $imp_message->emptyMailbox(array($mbox)); $result = new stdClass; $result->mbox = $mbox; @@ -260,7 +260,7 @@ case 'FlagAll': $set = Horde_Util::getPost('set'); - $imp_message = &IMP_Message::singleton(); + $imp_message = IMP_Message::singleton(); $result = $imp_message->flagAllInMailbox($flags, array($mbox), $set); if ($result) { @@ -356,7 +356,7 @@ case 'CopyMessage': $change = _changed($mbox, $cacheid, true); } - $imp_message = &IMP_Message::singleton(); + $imp_message = IMP_Message::singleton(); $result = $imp_message->copy($to, ($action == 'MoveMessage') ? 'move' : 'copy', $indices); @@ -397,7 +397,7 @@ case 'FlagMessage': } } - $imp_message = &IMP_Message::singleton(); + $imp_message = IMP_Message::singleton(); if (!empty($set)) { $result = $imp_message->flag($set, $indices, true); } @@ -415,7 +415,7 @@ case 'DeleteMessage': break; } - $imp_message = &IMP_Message::singleton(); + $imp_message = IMP_Message::singleton(); $change = _changed($mbox, $cacheid, true); $result = $imp_message->delete($indices); if ($result) { @@ -537,7 +537,7 @@ case 'DeleteDraft': $imp_compose = IMP_Compose::singleton(Horde_Util::getPost('imp_compose')); $imp_compose->destroy(); if ($action == 'DeleteDraft') { - $imp_message = &IMP_Message::singleton(); + $imp_message = IMP_Message::singleton(); $idx_array = array($imp_compose->getMetadata('draft_index') . IMP::IDX_SEP . IMP::folderPref($prefs->getValue('drafts_folder'), true)); $imp_message->delete($idx_array, array('nuke' => true)); } @@ -628,7 +628,7 @@ case 'PurgeDeleted': $sort = IMP::getSort($mbox); $change = ($sort['by'] == Horde_Imap_Client::SORT_THREAD); } - $imp_message = &IMP_Message::singleton(); + $imp_message = IMP_Message::singleton(); $expunged = $imp_message->expungeMailbox(array($mbox => 1), array('list' => true)); if (!empty($expunged[$mbox])) { $expunge_count = count($expunged[$mbox]); diff --git a/imp/attachment.php b/imp/attachment.php index 753f1e1bb..cd40dae0f 100644 --- a/imp/attachment.php +++ b/imp/attachment.php @@ -37,7 +37,7 @@ if (is_null($mail_user) || is_null($time_stamp) || is_null($file_name)) { } // Initialize the VFS. -$vfsroot = &VFS::singleton($conf['vfs']['type'], Horde::getDriverConfig('vfs', $conf['vfs']['type'])); +$vfsroot = VFS::singleton($conf['vfs']['type'], Horde::getDriverConfig('vfs', $conf['vfs']['type'])); if (is_a($vfsroot, 'PEAR_Error')) { Horde::fatal(sprintf(_("Could not create the VFS backend: %s"), $vfsroot->getMessage()), $self_url, __LINE__); } @@ -74,11 +74,11 @@ if ($conf['compose']['link_attachments_notify']) { /* Load $mail_user's preferences so that we can use their * locale information for the notification message. */ include_once 'Horde/Prefs.php'; - $prefs = &Prefs::singleton($conf['prefs']['driver'], 'horde', $mail_user); + $prefs = Prefs::singleton($conf['prefs']['driver'], 'horde', $mail_user); $prefs->retrieve(); include_once 'Horde/Identity.php'; - $mail_identity = &Identity::singleton('none', $mail_user); + $mail_identity = Identity::singleton('none', $mail_user); $mail_address = $mail_identity->getDefaultFromAddress(); /* Ignore missing addresses, which are returned as <>. */ diff --git a/imp/compose-dimp.php b/imp/compose-dimp.php index c96c0a7fb..2f76226f8 100644 --- a/imp/compose-dimp.php +++ b/imp/compose-dimp.php @@ -20,7 +20,7 @@ function _removeAutoSaveDraft($index) { if (!empty($index)) { - $imp_message = &IMP_Message::singleton(); + $imp_message = IMP_Message::singleton(); $imp_message->delete(array($index . IMP::IDX_SEP . IMP::folderPref($GLOBALS['prefs']->getValue('drafts_folder'), true)), array('nuke' => true)); } } @@ -42,7 +42,7 @@ $get_sig = true; $msg = ''; require_once 'Horde/Identity.php'; -$identity = &Identity::singleton(array('imp', 'imp')); +$identity = Identity::singleton(array('imp', 'imp')); if (!$prefs->isLocked('default_identity')) { $identity_id = Horde_Util::getFormData('identity'); if (!is_null($identity_id)) { @@ -54,7 +54,7 @@ if (!$prefs->isLocked('default_identity')) { NLS::setTimeZone(); /* Initialize the IMP_Compose:: object. */ -$imp_compose = &IMP_Compose::singleton(Horde_Util::getFormData('composeCache')); +$imp_compose = IMP_Compose::singleton(Horde_Util::getFormData('composeCache')); /* Init IMP_UI_Compose:: object. */ $imp_ui = new IMP_UI_Compose(); @@ -149,7 +149,7 @@ if (count($_POST)) { /* Use IMP_Tree to determine whether the sent mail folder was * created. */ - $imptree = &IMP_Imap_Tree::singleton(); + $imptree = IMP_Imap_Tree::singleton(); $imptree->eltDiffStart(); $options = array( @@ -218,7 +218,7 @@ if (in_array($type, array('reply', 'reply_all', 'reply_list', 'forward', 'resume } try { - $imp_contents = &IMP_Contents::singleton($index . IMP::IDX_SEP . $folder); + $imp_contents = IMP_Contents::singleton($index . IMP::IDX_SEP . $folder); } catch (Horde_Exception $e) { $notification->push(_("Requested message not found."), 'horde.error'); $index = $folder = null; diff --git a/imp/compose-mimp.php b/imp/compose-mimp.php index 6faee1e5e..7ef725377 100644 --- a/imp/compose-mimp.php +++ b/imp/compose-mimp.php @@ -12,13 +12,13 @@ * @package IMP */ -function &_getIMPContents($index, $mailbox) +function _getIMPContents($index, $mailbox) { if (empty($index)) { return false; } try { - $imp_contents = &IMP_Contents::singleton($index . IMP::IDX_SEP . $mailbox); + $imp_contents = IMP_Contents::singleton($index . IMP::IDX_SEP . $mailbox); return $imp_contents; } catch (Horde_Exception $e) { $GLOBALS['notification']->push(_("Could not retrieve the message from the mail server."), 'horde.error'); @@ -34,7 +34,7 @@ $msg = ''; $header = array(); /* Set the current identity. */ -$identity = &Identity::singleton(array('imp', 'imp')); +$identity = Identity::singleton(array('imp', 'imp')); if (!$prefs->isLocked('default_identity')) { $identity_id = Horde_Util::getFormData('identity'); if (!is_null($identity_id)) { @@ -63,7 +63,7 @@ $compose_disable = !empty($conf['hooks']['disable_compose']) && NLS::setTimeZone(); /* Initialize the IMP_Compose:: object. */ -$imp_compose = &IMP_Compose::singleton(Horde_Util::getFormData('composeCache')); +$imp_compose = IMP_Compose::singleton(Horde_Util::getFormData('composeCache')); /* Run through the action handlers. */ $actionID = Horde_Util::getFormData('a'); @@ -110,7 +110,7 @@ case _("Expand Names"): case 'r': case 'ra': case 'rl': - if (!($imp_contents = &_getIMPContents($index, $thismailbox))) { + if (!($imp_contents = _getIMPContents($index, $thismailbox))) { break; } $actions = array('r' => 'reply', 'ra' => 'reply_all', 'rl' => 'reply_list'); @@ -122,7 +122,7 @@ case 'rl': // 'f' = forward case 'f': - if (!($imp_contents = &_getIMPContents($index, $thismailbox))) { + if (!($imp_contents = _getIMPContents($index, $thismailbox))) { break; } $fwd_msg = $imp_compose->forwardMessage($imp_contents); @@ -132,7 +132,7 @@ case 'f': break; case _("Redirect"): - if (!($imp_contents = &_getIMPContents($index, $thismailbox))) { + if (!($imp_contents = _getIMPContents($index, $thismailbox))) { break; } @@ -166,7 +166,7 @@ case _("Send"): $thismailbox = $imp_compose->getMetadata('mailbox'); if ($ctype = $imp_compose->getMetadata('reply_type')) { - if (!($imp_contents = &_getIMPContents($index, $thismailbox))) { + if (!($imp_contents = _getIMPContents($index, $thismailbox))) { break; } @@ -221,7 +221,7 @@ case _("Send"): if (Horde_Util::getFormData('resume_draft') && $prefs->getValue('auto_delete_drafts')) { - $imp_message = &IMP_Message::singleton(); + $imp_message = IMP_Message::singleton(); $idx_array = array($index . IMP::IDX_SEP . $thismailbox); $delete_draft = $imp_message->delete($idx_array, array('nuke' => true)); } diff --git a/imp/compose.php b/imp/compose.php index c96de2778..a9dcf1d79 100644 --- a/imp/compose.php +++ b/imp/compose.php @@ -40,14 +40,14 @@ function _popupSuccess() require $GLOBALS['registry']->get('templates', 'horde') . '/common-footer.inc'; } -function &_getIMPContents($index, $mailbox) +function _getIMPContents($index, $mailbox) { if (empty($index)) { return false; } try { - $imp_contents = &IMP_Contents::singleton($index . IMP::IDX_SEP . $mailbox); + $imp_contents = IMP_Contents::singleton($index . IMP::IDX_SEP . $mailbox); return $imp_contents; } catch (Horde_Exception $e) { $GLOBALS['notification']->push(_("Could not retrieve the message from the mail server."), 'horde.error'); @@ -70,7 +70,7 @@ $pgp_passphrase_dialog = $pgp_symmetric_passphrase_dialog = $showmenu = $smime_p $cursor_pos = $oldrtemode = $rtemode = $siglocation = null; /* Set the current identity. */ -$identity = &Identity::singleton(array('imp', 'imp')); +$identity = Identity::singleton(array('imp', 'imp')); if (!$prefs->isLocked('default_identity')) { $identity_id = Horde_Util::getFormData('identity'); if (!is_null($identity_id)) { @@ -153,7 +153,7 @@ if ($readonly_sentmail) { } /* Initialize the IMP_Compose:: object. */ -$imp_compose = &IMP_Compose::singleton(Horde_Util::getFormData('composeCache')); +$imp_compose = IMP_Compose::singleton(Horde_Util::getFormData('composeCache')); $imp_compose->pgpAttachPubkey((bool) Horde_Util::getFormData('pgp_attach_pubkey')); $imp_compose->userLinkAttachments((bool) Horde_Util::getFormData('link_attachments')); @@ -248,7 +248,7 @@ if ($_SESSION['imp']['file_upload']) { $title = _("New Message"); switch ($actionID) { case 'mailto': - if (!($imp_contents = &_getIMPContents($index, $thismailbox))) { + if (!($imp_contents = _getIMPContents($index, $thismailbox))) { break; } $imp_headers = $imp_contents->getHeaderOb(); @@ -309,7 +309,7 @@ case 'redirect_expand_addr': case 'reply': case 'reply_all': case 'reply_list': - if (!($imp_contents = &_getIMPContents($index, $thismailbox))) { + if (!($imp_contents = _getIMPContents($index, $thismailbox))) { break; } @@ -335,7 +335,7 @@ case 'reply_list': break; case 'forward': - if (!($imp_contents = &_getIMPContents($index, $thismailbox))) { + if (!($imp_contents = _getIMPContents($index, $thismailbox))) { break; } @@ -353,7 +353,7 @@ case 'redirect_compose': break; case 'redirect_send': - if (!($imp_contents = &_getIMPContents($index, $thismailbox))) { + if (!($imp_contents = _getIMPContents($index, $thismailbox))) { break; } @@ -449,7 +449,7 @@ case 'send_message': if (Horde_Util::getFormData('resume_draft') && $prefs->getValue('auto_delete_drafts') && ($thismailbox == IMP::folderPref($prefs->getValue('drafts_folder'), true))) { - $imp_message = &IMP_Message::singleton(); + $imp_message = IMP_Message::singleton(); $idx_array = array($index . IMP::IDX_SEP . $thismailbox); if ($imp_message->delete($idx_array)) { $notification->push(_("The draft message was automatically deleted because it was successfully completed and sent."), 'horde.success'); @@ -735,7 +735,7 @@ if ($prefs->getValue('use_pgp') && !$prefs->isLocked('default_encrypt')) { try { $addrs = $imp_compose->recipientList($header); if (!empty($addrs['list'])) { - $imp_pgp = &Horde_Crypt::singleton(array('IMP', 'Pgp')); + $imp_pgp = Horde_Crypt::singleton(array('IMP', 'Pgp')); foreach ($addrs['list'] as $val) { $imp_pgp->getPublicKey($val); } diff --git a/imp/folders-mimp.php b/imp/folders-mimp.php index b8e0b2059..e4e207085 100644 --- a/imp/folders-mimp.php +++ b/imp/folders-mimp.php @@ -30,7 +30,7 @@ $subscribe = $prefs->getValue('subscribe'); $showAll = (!$subscribe || $_SESSION['imp']['showunsub']); /* Initialize the IMP_Imap_Tree object. */ -$imptree = &IMP_Imap_Tree::singleton(); +$imptree = IMP_Imap_Tree::singleton(); $mask = IMP_Imap_Tree::NEXT_SHOWCLOSED; /* Toggle subscribed view, if necessary. */ diff --git a/imp/folders.php b/imp/folders.php index 90a82e801..c14500415 100644 --- a/imp/folders.php +++ b/imp/folders.php @@ -60,10 +60,10 @@ IMP::addInlineScript(array( )); /* Initialize the IMP_Folder object. */ -$imp_folder = &IMP_Folder::singleton(); +$imp_folder = IMP_Folder::singleton(); /* Initialize the IMP_Imap_Tree object. */ -$imaptree = &IMP_Imap_Tree::singleton(); +$imaptree = IMP_Imap_Tree::singleton(); /* $folder_list is already encoded in UTF7-IMAP. */ $folder_list = Horde_Util::getFormData('folder_list', array()); @@ -110,7 +110,7 @@ case 'rebuild_tree': case 'expunge_folder': if (!empty($folder_list)) { - $imp_message = &IMP_Message::singleton(); + $imp_message = IMP_Message::singleton(); $imp_message->expungeMailbox(array_flip($folder_list)); } break; @@ -135,7 +135,7 @@ case 'download_folder_zip': if ($actionID == 'download_folder') { $browser->downloadHeaders($folder_list[0] . '.mbox', null, false, strlen($mbox)); } else { - $horde_compress = &Horde_Compress::singleton('zip'); + $horde_compress = Horde_Compress::singleton('zip'); $mbox = $horde_compress->compress(array(array('data' => $mbox, 'name' => $folder_list[0] . '.mbox'))); $browser->downloadHeaders($folder_list[0] . '.zip', 'application/zip', false, strlen($mbox)); } @@ -223,7 +223,7 @@ case 'nopoll_folder': case 'folders_empty_mailbox': if (!empty($folder_list)) { - $imp_message = &IMP_Message::singleton(); + $imp_message = IMP_Message::singleton(); $imp_message->emptyMailbox($folder_list); } break; @@ -231,7 +231,7 @@ case 'folders_empty_mailbox': case 'mark_folder_seen': case 'mark_folder_unseen': if (!empty($folder_list)) { - $imp_message = &IMP_Message::singleton(); + $imp_message = IMP_Message::singleton(); $imp_message->flagAllInMailbox(array('seen'), $folder_list, ($actionID == 'mark_folder_seen')); } break; @@ -296,7 +296,7 @@ case 'mbox_size': $loop = array(); $rowct = $sum = 0; - $imp_message = &IMP_Message::singleton(); + $imp_message = IMP_Message::singleton(); foreach ($folder_list as $val) { $size = $imp_message->sizeMailbox($val, false); diff --git a/imp/lib/Block/Foldersummary.php b/imp/lib/Block/Foldersummary.php index 0cbe79baa..56817259c 100644 --- a/imp/lib/Block/Foldersummary.php +++ b/imp/lib/Block/Foldersummary.php @@ -25,7 +25,7 @@ class IMP_Block_Foldersummary extends Horde_Block } /* Get list of mailboxes to poll. */ - $imptree = &IMP_Imap_Tree::singleton(); + $imptree = IMP_Imap_Tree::singleton(); $folders = $imptree->getPollList(true, true); $anyUnseen = false; diff --git a/imp/lib/Block/summary.php b/imp/lib/Block/summary.php index e860827cd..6e687c4b0 100644 --- a/imp/lib/Block/summary.php +++ b/imp/lib/Block/summary.php @@ -55,7 +55,7 @@ class Horde_Block_imp_summary extends Horde_Block } /* Get list of mailboxes to poll. */ - $imaptree = &IMP_Imap_Tree::singleton(); + $imaptree = IMP_Imap_Tree::singleton(); $folders = $imaptree->getPollList(true, true); /* Quota info, if available. */ diff --git a/imp/lib/Block/tree_folders.php b/imp/lib/Block/tree_folders.php index e45a1d2ac..04a0316bb 100644 --- a/imp/lib/Block/tree_folders.php +++ b/imp/lib/Block/tree_folders.php @@ -55,7 +55,7 @@ class Horde_Block_imp_tree_folders extends Horde_Block $name_url = Horde_Util::addParameter(Horde::applicationUrl('mailbox.php'), 'no_newmail_popup', 1); /* Initialize the IMP_Tree object. */ - $imaptree = &IMP_Imap_Tree::singleton(); + $imaptree = IMP_Imap_Tree::singleton(); $mask = IMP_Imap_Tree::NEXT_SHOWCLOSED; if ($GLOBALS['prefs']->getValue('subscribe')) { $mask |= IMP_Imap_Tree::NEXT_SHOWSUB; diff --git a/imp/lib/Crypt/Smime.php b/imp/lib/Crypt/Smime.php index bb0214b9e..07a8f5b6d 100644 --- a/imp/lib/Crypt/Smime.php +++ b/imp/lib/Crypt/Smime.php @@ -171,7 +171,7 @@ class IMP_Crypt_Smime extends Horde_Crypt_Smime /* See if the address points to the user's public key. */ if (is_a($key, 'PEAR_Error')) { require_once 'Horde/Identity.php'; - $identity = &Identity::singleton(array('imp', 'imp')); + $identity = Identity::singleton(array('imp', 'imp')); $personal_pubkey = $this->getPersonalPublicKey(); if (!empty($personal_pubkey) && $identity->hasAddress($address)) { return $personal_pubkey; diff --git a/imp/lib/Filter.php b/imp/lib/Filter.php index 155c17b63..1bcabb06b 100644 --- a/imp/lib/Filter.php +++ b/imp/lib/Filter.php @@ -56,7 +56,7 @@ class IMP_Filter public function blacklistMessage($indices, $show_link = true) { if ($this->_processBWlist($indices, _("your blacklist"), 'blacklistFrom', 'showBlacklist', $show_link)) { - $imp_message = &IMP_Message::singleton(); + $imp_message = IMP_Message::singleton(); if (($msg_count = $imp_message->delete($indices))) { if ($msg_count == 1) { @@ -109,7 +109,7 @@ class IMP_Filter $addr = array(); foreach ($msgList as $mbox => $msgIndices) { foreach ($msgIndices as $idx) { - $contents = &IMP_Contents::singleton($idx . IMP::IDX_SEP . $mbox); + $contents = IMP_Contents::singleton($idx . IMP::IDX_SEP . $mbox); $hdr = $contents->getHeaderOb(); $addr[] = Horde_Mime_Address::bareAddress($hdr->getValue('from')); } diff --git a/imp/lib/LoginTasks/Task/DeleteSentmailMonthly.php b/imp/lib/LoginTasks/Task/DeleteSentmailMonthly.php index 6e1b4406c..c0985ecaa 100644 --- a/imp/lib/LoginTasks/Task/DeleteSentmailMonthly.php +++ b/imp/lib/LoginTasks/Task/DeleteSentmailMonthly.php @@ -35,8 +35,8 @@ class IMP_LoginTasks_Task_DeleteSentmailMonthly extends Horde_LoginTasks_Task old sent-mail folders. Then sort this array according to the date. */ include_once 'Horde/Identity.php'; - $identity = &Identity::singleton(array('imp', 'imp')); - $imp_folder = &IMP_Folder::singleton(); + $identity = Identity::singleton(array('imp', 'imp')); + $imp_folder = IMP_Folder::singleton(); $sent_mail_folders = $identity->getAllSentmailFolders(); $folder_array = array(); diff --git a/imp/lib/LoginTasks/Task/RenameSentmailMonthly.php b/imp/lib/LoginTasks/Task/RenameSentmailMonthly.php index a84cbd13a..00cc5b5a0 100644 --- a/imp/lib/LoginTasks/Task/RenameSentmailMonthly.php +++ b/imp/lib/LoginTasks/Task/RenameSentmailMonthly.php @@ -35,8 +35,8 @@ class IMP_LoginTasks_Task_RenameSentmailMonthly extends Horde_LoginTasks_Task include_once 'Horde/Identity.php'; - $identity = &Identity::singleton(array('imp', 'imp')); - $imp_folder = &IMP_Folder::singleton(); + $identity = Identity::singleton(array('imp', 'imp')); + $imp_folder = IMP_Folder::singleton(); foreach ($identity->getAllSentmailfolders() as $sent_folder) { /* Display a message to the user and rename the folder. @@ -67,7 +67,7 @@ class IMP_LoginTasks_Task_RenameSentmailMonthly extends Horde_LoginTasks_Task public function describe() { include_once 'Horde/Identity.php'; - $identity = &Identity::singleton(array('imp', 'imp')); + $identity = Identity::singleton(array('imp', 'imp')); $new_folders = $old_folders = array(); foreach ($identity->getAllSentmailfolders() as $folder) { diff --git a/imp/lib/Maillog.php b/imp/lib/Maillog.php index 9d254b0cd..031d318a0 100644 --- a/imp/lib/Maillog.php +++ b/imp/lib/Maillog.php @@ -26,7 +26,7 @@ class IMP_Maillog */ static public function log($type, $msg_ids, $data = null) { - $history = &Horde_History::singleton(); + $history = Horde_History::singleton(); if (!is_array($msg_ids)) { $msg_ids = array($msg_ids); @@ -75,7 +75,7 @@ class IMP_Maillog */ static public function getLog($msg_id) { - $history = &Horde_History::singleton(); + $history = Horde_History::singleton(); $res = $history->getHistory(self::_getUniqueHistoryId($msg_id)); if (is_a($res, 'PEAR_Error')) { @@ -193,7 +193,7 @@ class IMP_Maillog } $msg_ids = array_map(array('IMP_Maillog', '_getUniqueHistoryId'), $msg_ids); - $history = &Horde_History::singleton(); + $history = Horde_History::singleton(); return $history->removeByNames($msg_ids); } diff --git a/imp/lib/Mime/Viewer/Itip.php b/imp/lib/Mime/Viewer/Itip.php index 501aa169b..853c02d16 100644 --- a/imp/lib/Mime/Viewer/Itip.php +++ b/imp/lib/Mime/Viewer/Itip.php @@ -236,7 +236,7 @@ class IMP_Horde_Mime_Viewer_Itip extends Horde_Mime_Viewer_Driver $vCal->setAttribute('PRODID', '-//The Horde Project//' . HORDE_AGENT_HEADER . '//EN'); $vCal->setAttribute('METHOD', 'REPLY'); - $vEvent_reply = &Horde_iCalendar::newComponent('vevent', $vCal); + $vEvent_reply = Horde_iCalendar::newComponent('vevent', $vCal); $vEvent_reply->setAttribute('UID', $vEvent->getAttribute('UID')); if (!is_a($vEvent->getAttribute('SUMMARY'), 'PEAR_error')) { $vEvent_reply->setAttribute('SUMMARY', $vEvent->getAttribute('SUMMARY')); @@ -259,7 +259,7 @@ class IMP_Horde_Mime_Viewer_Itip extends Horde_Mime_Viewer_Driver $vEvent_reply->setAttribute('ORGANIZER', $vEvent->getAttribute('ORGANIZER'), array_pop($organizer)); // Find out who we are and update status. - $identity = &Identity::singleton(array('imp', 'imp')); + $identity = Identity::singleton(array('imp', 'imp')); $attendees = $vEvent->getAttribute('ATTENDEE'); if (!is_array($attendees)) { $attendees = array($attendees); @@ -399,7 +399,7 @@ class IMP_Horde_Mime_Viewer_Itip extends Horde_Mime_Viewer_Driver require_once 'Horde/Identity.php'; // Find out who we are and update status. - $identity = &Identity::singleton(); + $identity = Identity::singleton(); $email = $identity->getFromAddress(); // Build the reply. @@ -632,7 +632,7 @@ class IMP_Horde_Mime_Viewer_Itip extends Horde_Mime_Viewer_Driver $is_attendee = false; if (!is_a($attendees, 'PEAR_Error') && !empty($attendees)) { require_once 'Horde/Identity.php'; - $identity = &Identity::singleton(array('imp', 'imp')); + $identity = Identity::singleton(array('imp', 'imp')); for ($i = 0, $c = count($attendees); $i < $c; ++$i) { $attendee = parse_url($attendees[$i]); if (!empty($attendee['path']) && diff --git a/imp/lib/Mime/Viewer/Tnef.php b/imp/lib/Mime/Viewer/Tnef.php index b8479fdbf..c5348788d 100644 --- a/imp/lib/Mime/Viewer/Tnef.php +++ b/imp/lib/Mime/Viewer/Tnef.php @@ -46,7 +46,7 @@ class IMP_Horde_Mime_Viewer_Tnef extends Horde_Mime_Viewer_Tnef } /* Get the data from the attachment. */ - $tnef = &Horde_Compress::singleton('tnef'); + $tnef = Horde_Compress::singleton('tnef'); $tnefData = $tnef->decompress($this->_mimepart->getContents()); /* Display the requested file. Its position in the $tnefData @@ -80,7 +80,7 @@ class IMP_Horde_Mime_Viewer_Tnef extends Horde_Mime_Viewer_Tnef protected function _renderInfo() { /* Get the data from the attachment. */ - $tnef = &Horde_Compress::singleton('tnef'); + $tnef = Horde_Compress::singleton('tnef'); $tnefData = $tnef->decompress($this->_mimepart->getContents()); $text = ''; diff --git a/imp/lib/Mime/Viewer/Zip.php b/imp/lib/Mime/Viewer/Zip.php index f2d9d45d8..c03e92b70 100644 --- a/imp/lib/Mime/Viewer/Zip.php +++ b/imp/lib/Mime/Viewer/Zip.php @@ -34,7 +34,7 @@ class IMP_Horde_Mime_Viewer_Zip extends Horde_Mime_Viewer_Zip /* Send the requested file. Its position in the zip archive is located * in 'zip_attachment'. */ $data = $this->_mimepart->getContents(); - $zip = &Horde_Compress::singleton('zip'); + $zip = Horde_Compress::singleton('zip'); $fileKey = Horde_Util::getFormData('zip_attachment') - 1; $zipInfo = $zip->decompress($data, array('action' => HORDE_COMPRESS_ZIP_LIST)); diff --git a/imp/lib/Quota.php b/imp/lib/Quota.php index 4627228f3..f49648f57 100644 --- a/imp/lib/Quota.php +++ b/imp/lib/Quota.php @@ -34,7 +34,7 @@ class IMP_Quota * It will only create a new instance if no instance with the same * parameters currently exists. * - * This method must be invoked as: $var = &IMP_Quota::singleton() + * This method must be invoked as: $var = IMP_Quota::singleton() * * @param string $driver The type of concrete subclass to return. * @param array $params A hash containing any additional configuration diff --git a/imp/lib/Quota/sql.php b/imp/lib/Quota/sql.php index 92158e192..5e8eef4c2 100644 --- a/imp/lib/Quota/sql.php +++ b/imp/lib/Quota/sql.php @@ -66,10 +66,10 @@ class IMP_Quota_sql extends IMP_Quota protected function _connect() { if (!$this->_connected) { - $this->_db = &DB::connect($this->_params, - array('persistent' => !empty($this->_params['persistent']), - 'ssl' => !empty($this->_params['ssl']))); - if (is_a($this->_db, 'PEAR_Error')) { + $this->_db = DB::connect($this->_params, + array('persistent' => !empty($this->_params['persistent']), + 'ssl' => !empty($this->_params['ssl']))); + if ($this->_db instanceof PEAR_Error) { throw new Horde_Exception(_("Unable to connect to SQL server.")); } diff --git a/imp/lib/Search.php b/imp/lib/Search.php index 66f11777c..04615a42c 100644 --- a/imp/lib/Search.php +++ b/imp/lib/Search.php @@ -99,7 +99,7 @@ class IMP_Search $_SESSION['imp']['search'] = array('q' => array()); } if (!$no_vf) { - $imaptree = &IMP_Imap_Tree::singleton(); + $imaptree = IMP_Imap_Tree::singleton(); foreach ($this->_getVFolderList() as $key => $val) { if (!empty($val['vfolder']) && !$this->isVTrashFolder($key) && @@ -229,7 +229,7 @@ class IMP_Search unset($vfolders[$id]); $this->_saveVFolderList($vfolders); if (!$no_delete) { - $imaptree = &IMP_Imap_Tree::singleton(); + $imaptree = IMP_Imap_Tree::singleton(); $imaptree->delete($id); } } @@ -334,7 +334,7 @@ class IMP_Search $this->_saveVFolderList($vfolders); } - $imaptree = &IMP_Imap_Tree::singleton(); + $imaptree = IMP_Imap_Tree::singleton(); $imaptree->insertVFolders(array($id => $label)); return $id; @@ -356,7 +356,7 @@ class IMP_Search } /* Create Virtual Trash with new folder list. */ - $imp_folder = &IMP_Folder::singleton(); + $imp_folder = IMP_Folder::singleton(); $fl = $imp_folder->flist(); $flist = array(); foreach ($fl as $mbox) { @@ -403,7 +403,7 @@ class IMP_Search public function createVINBOXFolder() { /* Initialize IMP_Imap_Tree. */ - $imaptree = &IMP_Imap_Tree::singleton(); + $imaptree = IMP_Imap_Tree::singleton(); /* Delete the current Virtual Inbox folder, if it exists. */ $vinbox_id = $GLOBALS['prefs']->getValue('vinbox_id'); diff --git a/imp/lib/Session.php b/imp/lib/Session.php index d4905cb51..b21026930 100644 --- a/imp/lib/Session.php +++ b/imp/lib/Session.php @@ -200,7 +200,7 @@ class IMP_Session } /* Do login tasks. */ - $tasks = &Horde_LoginTasks::singleton('imp', is_null($url) ? Horde::selfUrl(true, true, true) : $url); + $tasks = Horde_LoginTasks::singleton('imp', is_null($url) ? Horde::selfUrl(true, true, true) : $url); $tasks->runTasks(); /* If the user wants to run filters on login, make sure they get @@ -212,7 +212,7 @@ class IMP_Session } /* Check for drafts due to session timeouts. */ - $imp_compose = &IMP_Compose::singleton(); + $imp_compose = IMP_Compose::singleton(); $imp_compose->recoverSessionExpireDraft(); $_SESSION['imp']['logintasks'] = true; diff --git a/imp/lib/Spam.php b/imp/lib/Spam.php index 1c5262b1f..72813aab9 100644 --- a/imp/lib/Spam.php +++ b/imp/lib/Spam.php @@ -41,7 +41,7 @@ class IMP_Spam /* Fetch the raw message contents (headers and complete * body). */ try { - $imp_contents = &IMP_Contents::singleton($idx . IMP::IDX_SEP . $mbox); + $imp_contents = IMP_Contents::singleton($idx . IMP::IDX_SEP . $mbox); } catch (Horde_Exception $e) { continue; } @@ -104,8 +104,8 @@ class IMP_Spam if (!isset($imp_compose)) { require_once 'Horde/Identity.php'; - $imp_compose = &IMP_Compose::singleton(); - $identity = &Identity::singleton(array('imp', 'imp')); + $imp_compose = IMP_Compose::singleton(); + $identity = Identity::singleton(array('imp', 'imp')); try { $from_line = $identity->getFromLine(); } catch (Horde_Exception $e) { @@ -170,7 +170,7 @@ class IMP_Spam /* Delete spam after report. */ $delete_spam = $GLOBALS['prefs']->getValue('delete_spam_after_report'); if ($delete_spam) { - $imp_message = &IMP_Message::singleton(); + $imp_message = IMP_Message::singleton(); switch ($delete_spam) { case 1: if ($action == 'spam') { diff --git a/imp/lib/UI/Compose.php b/imp/lib/UI/Compose.php index 283cd01d8..793525cfe 100644 --- a/imp/lib/UI/Compose.php +++ b/imp/lib/UI/Compose.php @@ -15,7 +15,7 @@ class IMP_UI_Compose { /** */ - function expandAddresses($input, $imp_compose) + public function expandAddresses($input, $imp_compose) { $result = $imp_compose->expandAddresses($this->getAddressList($input)); @@ -31,7 +31,7 @@ class IMP_UI_Compose * * @throws Horde_Exception */ - function redirectMessage($to, $imp_compose, $contents, $encoding) + public function redirectMessage($to, $imp_compose, $contents, $encoding) { try { $recip = $imp_compose->recipientList(array('to' => $to)); @@ -40,7 +40,7 @@ class IMP_UI_Compose } $recipients = implode(', ', $recip['list']); - $identity = &Identity::singleton(array('imp', 'imp')); + $identity = Identity::singleton(array('imp', 'imp')); $from_addr = $identity->getFromAddress(); $headers = $contents->getHeaderOb(); @@ -80,7 +80,7 @@ class IMP_UI_Compose /** */ - function getForwardData(&$imp_compose, &$imp_contents, $index) + public function getForwardData(&$imp_compose, &$imp_contents, $index) { $fwd_msg = $imp_compose->forwardMessage($imp_contents); $subject_header = $imp_compose->attachIMAPMessage(array($index), $fwd_msg['headers']); @@ -95,7 +95,7 @@ class IMP_UI_Compose /** */ - function attachAutoCompleter($fields) + public function attachAutoCompleter($fields) { /* Attach autocompleters to the compose form elements. */ foreach ($fields as $val) { @@ -105,7 +105,7 @@ class IMP_UI_Compose /** */ - function attachSpellChecker($mode, $add_br = false) + public function attachSpellChecker($mode, $add_br = false) { $menu_view = $GLOBALS['prefs']->getValue('menu_view'); $show_text = ($menu_view == 'text' || $menu_view == 'both'); @@ -127,7 +127,7 @@ class IMP_UI_Compose /** */ - function getAddressList($to, $to_list = array(), $to_field = array(), + public function getAddressList($to, $to_list = array(), $to_field = array(), $to_new = '', $expand = false) { $to = rtrim(trim($to), ','); @@ -169,9 +169,9 @@ class IMP_UI_Compose /** */ - function initRTE($mode = 'imp', $editoronly = false) + public function initRTE($mode = 'imp', $editoronly = false) { - $editor = &Horde_Editor::singleton('Fckeditor', array('id' => 'message', 'no_notify' => true)); + $editor = Horde_Editor::singleton('Fckeditor', array('id' => 'message', 'no_notify' => true)); if ($editoronly) { return $editor; } diff --git a/imp/lib/UI/Mailbox.php b/imp/lib/UI/Mailbox.php index 61c18bdea..76603cb5b 100644 --- a/imp/lib/UI/Mailbox.php +++ b/imp/lib/UI/Mailbox.php @@ -78,7 +78,7 @@ class IMP_UI_Mailbox $ret['from'] = _("Invalid Address"); $ret['error'] = true; } else { - $identity = &Identity::singleton(array('imp', 'imp')); + $identity = Identity::singleton(array('imp', 'imp')); if ($identity->hasAddress($from['inner'])) { /* This message was sent by one of the user's identity * addresses - show To: information instead. */ diff --git a/imp/lib/UI/Message.php b/imp/lib/UI/Message.php index 44645afa2..d75560671 100644 --- a/imp/lib/UI/Message.php +++ b/imp/lib/UI/Message.php @@ -119,7 +119,7 @@ class IMP_UI_Message $success = true; if ($mdn_flag) { - $imp_message = &IMP_Message::singleton(); + $imp_message = IMP_Message::singleton(); $imp_message->flag(array('$MDNSent'), $uid . IMP::IDX_SEP . $mailbox, true); } } catch (Horde_Mime_Exception $e) { diff --git a/imp/lib/Views/Compose.php b/imp/lib/Views/Compose.php index 51b680095..d3c4ddc66 100644 --- a/imp/lib/Views/Compose.php +++ b/imp/lib/Views/Compose.php @@ -38,7 +38,7 @@ class IMP_Views_Compose /* Load Identity. */ require_once 'Horde/Identity.php'; - $identity = &Identity::singleton(array('imp', 'imp')); + $identity = Identity::singleton(array('imp', 'imp')); $selected_identity = $identity->getDefault(); $sent_mail_folder = $identity->getValue('sent_mail_folder'); if (!empty($sent_mail_folder)) { @@ -68,7 +68,7 @@ class IMP_Views_Compose $composeCache = null; if (!empty($args['composeCache'])) { - $imp_compose = &IMP_Compose::singleton($args['composeCache']); + $imp_compose = IMP_Compose::singleton($args['composeCache']); $composeCache = $args['composeCache']; if ($imp_compose->numberOfAttachments()) { diff --git a/imp/lib/Views/ListMessages.php b/imp/lib/Views/ListMessages.php index 91818c92a..a808a3904 100644 --- a/imp/lib/Views/ListMessages.php +++ b/imp/lib/Views/ListMessages.php @@ -53,7 +53,7 @@ class IMP_Views_ListMessages } /* Generate the sorted mailbox list now. */ - $imp_mailbox = &IMP_Mailbox::singleton($mbox); + $imp_mailbox = IMP_Mailbox::singleton($mbox); $sorted_list = $imp_mailbox->getSortedList(); $msgcount = count($sorted_list['s']); @@ -117,7 +117,7 @@ class IMP_Views_ListMessages * is a chance that the mailbox doesn't exist. If there is at least * 1 message, we don't need this check. */ if (empty($msgcount) && !$is_search) { - $imp_folder = &IMP_Folder::singleton(); + $imp_folder = IMP_Folder::singleton(); if (!$imp_folder->exists($mbox)) { $GLOBALS['notification']->push(sprintf(_("Mailbox %s does not exist."), $label), 'horde.error'); } @@ -192,7 +192,7 @@ class IMP_Views_ListMessages /* Get unseen/thread information. */ if (!$is_search) { - $imptree = &IMP_Imap_Tree::singleton(); + $imptree = IMP_Imap_Tree::singleton(); $info = $imptree->getElementInfo($mbox); if (!empty($info)) { $md->unseen = $info['unseen']; @@ -251,7 +251,7 @@ class IMP_Views_ListMessages $ob['flags'] = array_merge($ob['flags'], Horde::callHook('_imp_hook_msglist_flags', array($ob, 'dimp'), 'imp')); } - $imp_flags = &IMP_Imap_Flags::singleton(); + $imp_flags = IMP_Imap_Flags::singleton(); $flag_parse = $imp_flags->parse(array( 'atc' => isset($ob['structure']) ? $ob['structure'] : null, 'flags' => $ob['flags'], diff --git a/imp/lib/Views/ShowMessage.php b/imp/lib/Views/ShowMessage.php index 93d3eb0f0..381cac478 100644 --- a/imp/lib/Views/ShowMessage.php +++ b/imp/lib/Views/ShowMessage.php @@ -118,7 +118,7 @@ class IMP_Views_ShowMessage /* Parse MIME info and create the body of the message. */ try { - $imp_contents = &IMP_Contents::singleton($index . IMP::IDX_SEP . $mailbox); + $imp_contents = IMP_Contents::singleton($index . IMP::IDX_SEP . $mailbox); } catch (Horde_Exception $e) { $result['error'] = $error_msg; $result['errortype'] = 'horde.error'; diff --git a/imp/lib/api.php b/imp/lib/api.php index 58f98e2d2..ce8efeae4 100644 --- a/imp/lib/api.php +++ b/imp/lib/api.php @@ -257,7 +257,7 @@ function _imp_folderlist() require_once dirname(__FILE__) . '/base.php'; if (IMP::checkAuthentication(true)) { - $imp_folder = &IMP_Folder::singleton(); + $imp_folder = IMP_Folder::singleton(); return $imp_folder->flist(); } @@ -277,7 +277,7 @@ function _imp_createFolder($folder) require_once dirname(__FILE__) . '/base.php'; if (IMP::checkAuthentication(true)) { - $imp_folder = &IMP_Folder::singleton(); + $imp_folder = IMP_Folder::singleton(); return $imp_folder->create(IMP::appendNamespace($folder), $GLOBALS['prefs']->getValue('subscribe')); } @@ -299,7 +299,7 @@ function _imp_deleteMessages($mailbox, $indices) require_once dirname(__FILE__) . '/base.php'; if (IMP::checkAuthentication(true)) { - $imp_message = &IMP_Message::singleton(); + $imp_message = IMP_Message::singleton(); return $imp_message->delete(array($mailbox => $indices), array('nuke' => true)); } @@ -321,7 +321,7 @@ function _imp_copyMessages($mailbox, $indices, $target) require_once dirname(__FILE__) . '/base.php'; if (IMP::checkAuthentication(true)) { - $imp_message = &IMP_Message::singleton(); + $imp_message = IMP_Message::singleton(); return $imp_message->copy($target, 'copy', array($mailbox => $indices), true); } @@ -343,7 +343,7 @@ function _imp_moveMessages($mailbox, $indices, $target) require_once dirname(__FILE__) . '/base.php'; if (IMP::checkAuthentication(true)) { - $imp_message = &IMP_Message::singleton(); + $imp_message = IMP_Message::singleton(); return $imp_message->copy($target, 'move', array($mailbox => $indices), true); } @@ -366,7 +366,7 @@ function _imp_flagMessages($mailbox, $indices, $flags, $set) require_once dirname(__FILE__) . '/base.php'; if (IMP::checkAuthentication(true)) { - $imp_message = &IMP_Message::singleton(); + $imp_message = IMP_Message::singleton(); return $imp_message->flag($flags, 'move', array($mailbox => $indices), $set); } @@ -487,9 +487,9 @@ function _imp_changeLanguage() require_once dirname(__FILE__) . '/base.php'; if (IMP::checkAuthentication(true)) { - $imp_folder = &IMP_Folder::singleton(); + $imp_folder = IMP_Folder::singleton(); $imp_folder->clearFlistCache(); - $imaptree = &IMP_Imap_Tree::singleton(); + $imaptree = IMP_Imap_Tree::singleton(); $imaptree->init(); $GLOBALS['imp_search']->sessionSetup(true); } diff --git a/imp/lib/base.php b/imp/lib/base.php index 8f626a3cd..c7a3b9c88 100644 --- a/imp/lib/base.php +++ b/imp/lib/base.php @@ -54,7 +54,7 @@ case 'readonly': $s_ctrl = Registry::SESSION_READONLY; break; } -$registry = &Registry::singleton($s_ctrl); +$registry = Registry::singleton($s_ctrl); // We explicitly do not check application permissions for the compose // and login pages, since those are handled below and need to fall through @@ -86,7 +86,7 @@ if (!Horde_Util::nonInputVar('no_compress')) { // that just timed out, store the draft. if (!(Auth::isAuthenticated() || (Auth::getProvider() == 'imp'))) { if ($compose_page) { - $imp_compose = &IMP_Compose::singleton(); + $imp_compose = IMP_Compose::singleton(); $imp_compose->sessionExpireDraft(); } Horde::authenticationFailureRedirect(); @@ -106,7 +106,7 @@ if ($authentication !== 'none') { // are likely to trigger this case. if (empty($_SESSION['imp'])) { if ($compose_page) { - $imp_compose = &IMP_Compose::singleton(); + $imp_compose = IMP_Compose::singleton(); $imp_compose->sessionExpireDraft(); require IMP_BASE . '/login.php'; } else { @@ -117,7 +117,7 @@ if ($authentication !== 'none') { if ($compose_page) { if (!IMP::checkAuthentication(true, ($authentication === 'horde'))) { - $imp_compose = &IMP_Compose::singleton(); + $imp_compose = IMP_Compose::singleton(); $imp_compose->sessionExpireDraft(); require IMP_BASE . '/login.php'; exit; @@ -160,12 +160,12 @@ if (($viewmode == 'dimp') && Horde_Util::nonInputVar('dimp_logout')) { } // Notification system. -$notification = &Horde_Notification::singleton(); +$notification = Horde_Notification::singleton(); if (($viewmode == 'mimp') || (Horde_Util::nonInputVar('login_page') && $GLOBALS['browser']->isMobile())) { - $GLOBALS['imp_notify'] = &$notification->attach('status', null, 'Horde_Notification_Listener_Mobile'); + $GLOBALS['imp_notify'] = $notification->attach('status', null, 'Horde_Notification_Listener_Mobile'); } else { - $GLOBALS['imp_notify'] = &$notification->attach('status', array('viewmode' => $viewmode), 'IMP_Notification_Listener_Status'); + $GLOBALS['imp_notify'] = $notification->attach('status', array('viewmode' => $viewmode), 'IMP_Notification_Listener_Status'); if ($viewmode == 'imp') { $notification->attach('audio'); } diff --git a/imp/lib/prefs.php b/imp/lib/prefs.php index 74a2644bf..960784898 100644 --- a/imp/lib/prefs.php +++ b/imp/lib/prefs.php @@ -26,7 +26,7 @@ function handle_sentmailselect($updated) $sent_mail_folder = IMP::appendNamespace($sent_mail_default); } if (!empty($sent_mail_folder)) { - $imp_folder = &IMP_Folder::singleton(); + $imp_folder = IMP_Folder::singleton(); if (!$imp_folder->exists($sent_mail_folder)) { $imp_folder->create($sent_mail_folder, $prefs->getValue('subscribe')); } @@ -51,7 +51,7 @@ function handlefolders($updated, $pref, $folder, $new) } else { if (empty($folder) && !empty($new)) { $folder = IMP::appendNamespace($new); - $imp_folder = &IMP_Folder::singleton(); + $imp_folder = IMP_Folder::singleton(); if (!$imp_folder->create($folder, $prefs->getValue('subscribe'))) { $folder = null; } @@ -158,7 +158,7 @@ function handle_soundselect($updated) function handle_flagmanagement($updated) { - $imp_flags = &IMP_Imap_Flags::singleton(); + $imp_flags = IMP_Imap_Flags::singleton(); $action = Horde_Util::getFormData('flag_action'); $data = Horde_Util::getFormData('flag_data'); @@ -222,9 +222,9 @@ function prefs_callback() } if ($prefs->isDirty('subscribe') || $prefs->isDirty('tree_view')) { - $imp_folder = &IMP_Folder::singleton(); + $imp_folder = IMP_Folder::singleton(); $imp_folder->clearFlistCache(); - $imaptree = &IMP_Imap_Tree::singleton(); + $imaptree = IMP_Imap_Tree::singleton(); $imaptree->init(); } diff --git a/imp/mailbox-mimp.php b/imp/mailbox-mimp.php index 5b233b11e..9beafc161 100644 --- a/imp/mailbox-mimp.php +++ b/imp/mailbox-mimp.php @@ -38,7 +38,7 @@ case 'm': // 'e' = expunge mailbox case 'e': if (!$readonly) { - $imp_message = &IMP_Message::singleton(); + $imp_message = IMP_Message::singleton(); $imp_message->expungeMailbox(array($imp_mbox['mailbox'] => 1)); } break; @@ -53,7 +53,7 @@ case 'c': $mailbox_url = IMP::generateIMPUrl('mailbox-mimp.php', $imp_mbox['mailbox']); /* Build the list of messages in the mailbox. */ -$imp_mailbox = &IMP_Mailbox::singleton($imp_mbox['mailbox']); +$imp_mailbox = IMP_Mailbox::singleton($imp_mbox['mailbox']); $pageOb = $imp_mailbox->buildMailboxPage(Horde_Util::getFormData('p'), Horde_Util::getFormData('s')); /* Generate page links. */ @@ -106,7 +106,7 @@ while (list(,$ob) = each($mbox_info['overview'])) { } /* Get flag information. */ - $imp_flags = &IMP_Imap_Flags::singleton(); + $imp_flags = IMP_Imap_Flags::singleton(); $flag_parse = $imp_flags->parse(array( 'flags' => $ob['flags'], 'personal' => Horde_Mime_Address::getAddressesFromObject($ob['envelope']['to']), diff --git a/imp/mailbox.php b/imp/mailbox.php index b12b1d49c..092163f6a 100644 --- a/imp/mailbox.php +++ b/imp/mailbox.php @@ -141,14 +141,14 @@ case 'fwd_digest': case 'delete_messages': if (!empty($indices)) { - $imp_message = &IMP_Message::singleton(); + $imp_message = IMP_Message::singleton(); $imp_message->delete($indices); } break; case 'undelete_messages': if (!empty($indices)) { - $imp_message = &IMP_Message::singleton(); + $imp_message = IMP_Message::singleton(); $imp_message->undelete($indices); } break; @@ -156,7 +156,7 @@ case 'undelete_messages': case 'move_messages': case 'copy_messages': if (!empty($indices) && !empty($targetMbox)) { - $imp_message = &IMP_Message::singleton(); + $imp_message = IMP_Message::singleton(); if (!empty($newMbox) && ($newMbox == 1)) { $targetMbox = IMP::folderPref($targetMbox, true); $newMbox = true; @@ -175,7 +175,7 @@ case 'flag_messages': $flag = substr($flag, 1); $set = false; } - $imp_message = &IMP_Message::singleton(); + $imp_message = IMP_Message::singleton(); $imp_message->flag(array($flag), $indices, $set); } break; @@ -186,7 +186,7 @@ case 'hide_deleted': break; case 'expunge_mailbox': - $imp_message = &IMP_Message::singleton(); + $imp_message = IMP_Message::singleton(); $imp_message->expungeMailbox(array($imp_mbox['mailbox'] => 1)); break; @@ -195,7 +195,7 @@ case 'filter': break; case 'empty_mailbox': - $imp_message = &IMP_Message::singleton(); + $imp_message = IMP_Message::singleton(); $imp_message->emptyMailbox(array($imp_mbox['mailbox'])); break; @@ -489,7 +489,7 @@ if (empty($pageOb['end'])) { exit; } -$imp_flags = &IMP_Imap_Flags::singleton(); +$imp_flags = IMP_Imap_Flags::singleton(); /* Display the navbar and actions if there is at least 1 message in mailbox. */ if ($pageOb['msgcount']) { diff --git a/imp/message-mimp.php b/imp/message-mimp.php index 4dca5f787..d8f47fc6c 100644 --- a/imp/message-mimp.php +++ b/imp/message-mimp.php @@ -21,14 +21,14 @@ require_once dirname(__FILE__) . '/lib/base.php'; /* Make sure we have a valid index. */ -$imp_mailbox = &IMP_Mailbox::singleton($imp_mbox['mailbox'], $imp_mbox['index']); +$imp_mailbox = IMP_Mailbox::singleton($imp_mbox['mailbox'], $imp_mbox['index']); if (!$imp_mailbox->isValidIndex(false)) { header('Location: ' . Horde_Util::addParameter(IMP::generateIMPUrl('mailbox-mimp.php', $imp_mbox['mailbox']), array('a' => 'm'), null, false)); exit; } /* Initialize IMP_Message object. */ -$imp_message = &IMP_Message::singleton(); +$imp_message = IMP_Message::singleton(); /* Determine if mailbox is readonly. */ $readonly = $imp_imap->isReadOnly($imp_mbox['mailbox']); @@ -113,7 +113,7 @@ $use_pop = ($_SESSION['imp']['protocol'] == 'pop'); /* Parse the message. */ try { - $imp_contents = &IMP_Contents::singleton($index . IMP::IDX_SEP . $mailbox_name); + $imp_contents = IMP_Contents::singleton($index . IMP::IDX_SEP . $mailbox_name); } catch (Horde_Exception $e) { header('Location: ' . Horde_Util::addParameter(IMP::generateIMPUrl('mailbox-mimp.php', $mailbox_name), array('a' => 'm'), null, false)); exit; @@ -154,7 +154,7 @@ $imp_ui = new IMP_UI_Message(); /* Create the Identity object. */ require_once 'Horde/Identity.php'; -$user_identity = &Identity::singleton(array('imp', 'imp')); +$user_identity = Identity::singleton(array('imp', 'imp')); /* Develop the list of headers to display. */ $basic_headers = $imp_ui->basicHeaders(); @@ -215,7 +215,7 @@ if (!empty($msgAddresses)) { } } -$imp_flags = &IMP_Imap_Flags::singleton(); +$imp_flags = IMP_Imap_Flags::singleton(); $flag_parse = $imp_flags->parse(array( 'flags' => $flags, 'personal' => $match_identity diff --git a/imp/message.php b/imp/message.php index 6c1c8e81d..cc7238caf 100644 --- a/imp/message.php +++ b/imp/message.php @@ -36,7 +36,7 @@ if (!$imp_search->isSearchMbox($imp_mbox['mailbox'])) { } /* Make sure we have a valid index. */ -$imp_mailbox = &IMP_Mailbox::singleton($imp_mbox['mailbox'], $imp_mbox['index']); +$imp_mailbox = IMP_Mailbox::singleton($imp_mbox['mailbox'], $imp_mbox['index']); if (!$imp_mailbox->isValidIndex(false)) { _returnToMailbox(null, 'message_missing'); require IMP_BASE . '/mailbox.php'; @@ -44,14 +44,14 @@ if (!$imp_mailbox->isValidIndex(false)) { } /* Initialize IMP_Message object. */ -$imp_message = &IMP_Message::singleton(); +$imp_message = IMP_Message::singleton(); /* Set the current time zone. */ NLS::setTimeZone(); /* Initialize the user's identities. */ require_once 'Horde/Identity.php'; -$user_identity = &Identity::singleton(array('imp', 'imp')); +$user_identity = Identity::singleton(array('imp', 'imp')); /* Run through action handlers. */ $actionID = Horde_Util::getFormData('actionID'); @@ -200,7 +200,7 @@ $mailbox_name = $index_array['mailbox']; /* Parse the message. */ try { - $imp_contents = &IMP_Contents::singleton($index . IMP::IDX_SEP . $mailbox_name); + $imp_contents = IMP_Contents::singleton($index . IMP::IDX_SEP . $mailbox_name); } catch (Horde_Exception $e) { $imp_mailbox->removeMsgs(true); _returnToMailbox(null, 'message_missing'); @@ -385,7 +385,7 @@ $mailbox_url = Horde_Util::addParameter(IMP::generateIMPUrl('mailbox.php', $imp_ /* Generate the view link. */ $view_link = IMP::generateIMPUrl('view.php', $imp_mbox['mailbox'], $index, $mailbox_name); -$imp_flags = &IMP_Imap_Flags::singleton(); +$imp_flags = IMP_Imap_Flags::singleton(); /* Everything below here is related to preparing the output. */ if (!IMP::$printMode) { diff --git a/imp/pgp.php b/imp/pgp.php index f2b142671..97c979ff4 100644 --- a/imp/pgp.php +++ b/imp/pgp.php @@ -63,7 +63,7 @@ function _textWindowOutput($filename, $msg) function _reloadWindow() { - $cacheSess = &Horde_SessionObjects::singleton(); + $cacheSess = Horde_SessionObjects::singleton(); $reload = Horde_Util::getFormData('reload'); $cacheSess->setPruneFlag($reload, true); Horde_Util::closeWindowJS('opener.focus();opener.location.href="' . $cacheSess->query($reload) . '";'); @@ -259,7 +259,7 @@ case 'save_options': case 'save_attachment_public_key': /* Retrieve the key from the message. */ try { - $contents = &IMP_Contents::singleton(Horde_Util::getFormData('uid') . IMP::IDX_SEP . Horde_Util::getFormData('mailbox')); + $contents = IMP_Contents::singleton(Horde_Util::getFormData('uid') . IMP::IDX_SEP . Horde_Util::getFormData('mailbox')); } catch (Horde_Exception $e) { Horde::fatal($e, __FILE__, __LINE__); } @@ -358,7 +358,7 @@ if ($prefs->getValue('use_pgp')) { if (!$t->get('no_file_upload')) { $t->set('no_source', !$GLOBALS['prefs']->getValue('add_source')); if (!$t->get('no_source')) { - $cacheSess = &Horde_SessionObjects::singleton(); + $cacheSess = Horde_SessionObjects::singleton(); $t->set('public_import_url', Horde_Util::addParameter(Horde_Util::addParameter($selfURL, 'actionID', 'import_public_key'), 'reload', $cacheSess->storeOid($selfURL, false))); $t->set('import_pubkey-help', Horde_Help::link('imp', 'pgp-import-pubkey')); } @@ -382,7 +382,7 @@ if ($prefs->getValue('use_pgp')) { $t->set('personalkey-delete-help', Horde_Help::link('imp', 'pgp-personalkey-delete')); } else { require_once 'Horde/Identity.php'; - $imp_identity = &Identity::singleton(array('imp', 'imp')); + $imp_identity = Identity::singleton(array('imp', 'imp')); $t->set('fullname', $imp_identity->getFullname()); $t->set('personalkey-create-name-help', Horde_Help::link('imp', 'pgp-personalkey-create-name')); $t->set('personalkey-create-comment-help', Horde_Help::link('imp', 'pgp-personalkey-create-comment')); diff --git a/imp/rss.php b/imp/rss.php index 21397ccb6..668b03777 100644 --- a/imp/rss.php +++ b/imp/rss.php @@ -38,7 +38,7 @@ if (!empty($request)) { $mailbox = IMP::appendNamespace(preg_replace('/\//', $ns_info['delimiter'], trim($request_parts[0], '/'))); /* Make sure mailbox exists or else exit immediately. */ - $imp_folder = &IMP_Folder::singleton(); + $imp_folder = IMP_Folder::singleton(); if (!$imp_folder->exists($mailbox)) { exit; } @@ -47,7 +47,7 @@ if (!empty($request)) { } /* Obtain some information describing the mailbox state. */ -$imp_mailbox = &IMP_Mailbox::singleton($mailbox); +$imp_mailbox = IMP_Mailbox::singleton($mailbox); $total_num = $imp_mailbox->getMessageCount(); $unseen_num = ($imp_search->isVINBOXFolder($mailbox)) ? $imp_mailbox->getMessageCount() diff --git a/imp/saveimage.php b/imp/saveimage.php index 2d659fc95..2e4ec53b9 100644 --- a/imp/saveimage.php +++ b/imp/saveimage.php @@ -18,7 +18,7 @@ $index = Horde_Util::getFormData('index'); $actionID = Horde_Util::getFormData('actionID'); switch ($actionID) { case 'save_image': - $contents = &IMP_Contents::singleton($index); + $contents = IMP_Contents::singleton($index); $mime_part = $contents->getMIMEPart($id); $image_data = array( 'filename' => $mime_part->getName(true), diff --git a/imp/search.php b/imp/search.php index 08d020218..7caa1f54b 100644 --- a/imp/search.php +++ b/imp/search.php @@ -306,7 +306,7 @@ if (empty($search['mbox'])) { $mboxes = array(); $newcol = $numcolumns = 1; - $imp_folder = &IMP_Folder::singleton(); + $imp_folder = IMP_Folder::singleton(); $mailboxes = $imp_folder->flist(array(), !is_null($shown) ? $shown : null); $total = ceil(count($mailboxes) / 3); diff --git a/imp/smime.php b/imp/smime.php index 998094bea..3d9d7b641 100644 --- a/imp/smime.php +++ b/imp/smime.php @@ -47,14 +47,14 @@ function _getImportKey() function _actionWindow() { $oid = Horde_Util::getFormData('passphrase_action'); - $cacheSess = &Horde_SessionObjects::singleton(); + $cacheSess = Horde_SessionObjects::singleton(); $cacheSess->setPruneFlag($oid, true); Horde_Util::closeWindowJS($cacheSess->query($oid)); } function _reloadWindow() { - $cacheSess = &Horde_SessionObjects::singleton(); + $cacheSess = Horde_SessionObjects::singleton(); $reload = Horde_Util::getFormData('reload'); $cacheSess->setPruneFlag($reload, true); Horde_Util::closeWindowJS('opener.focus();opener.location.href="' . $cacheSess->query($reload) . '";'); @@ -179,7 +179,7 @@ case 'process_import_personal_certs': case 'save_attachment_public_key': /* Retrieve the key from the message. */ try { - $contents = &IMP_Contents::singleton(Horde_Util::getFormData('uid') . IMP::IDX_SEP . Horde_Util::getFormData('mailbox')); + $contents = IMP_Contents::singleton(Horde_Util::getFormData('uid') . IMP::IDX_SEP . Horde_Util::getFormData('mailbox')); } catch (Horde_Exception $e) { Horde::fatal($e, __FILE__, __LINE__); } @@ -276,7 +276,7 @@ if ($openssl_check && $prefs->getValue('use_smime')) { if (!$t->get('no_file_upload')) { $t->set('no_source', !$GLOBALS['prefs']->getValue('add_source')); if (!$t->get('no_source')) { - $cacheSess = &Horde_SessionObjects::singleton(); + $cacheSess = Horde_SessionObjects::singleton(); $t->set('public_import_url', Horde_Util::addParameter(Horde_Util::addParameter($selfURL, 'actionID', 'import_public_key'), 'reload', $cacheSess->storeOid($selfURL, false))); $t->set('import_pubkey-help', Horde_Help::link('imp', 'smime-import-pubkey')); } diff --git a/imp/stationery.php b/imp/stationery.php index f5e3b8dc5..ad708b62b 100644 --- a/imp/stationery.php +++ b/imp/stationery.php @@ -90,7 +90,7 @@ if ($updated) { } if ($stationery['t'] == 'html') { - $editor = &Horde_Editor::singleton('Fckeditor', array('id' => 'content')); + $editor = Horde_Editor::singleton('Fckeditor', array('id' => 'content')); } /* Show the header. */ diff --git a/imp/templates/folders/folders-mimp.inc b/imp/templates/folders/folders-mimp.inc index 86be4cda3..47be0f376 100644 --- a/imp/templates/folders/folders-mimp.inc +++ b/imp/templates/folders/folders-mimp.inc @@ -25,7 +25,7 @@ foreach ($rows as $val) { $t->set('linebreaks', true); } -$menu = &new Horde_Mobile_card('o', _("Menu")); +$menu = new Horde_Mobile_card('o', _("Menu")); $mset = &$menu->add(new Horde_Mobile_linkset()); $mset->add(new Horde_Mobile_link(_("Refresh"), $selfurl)); if ($subscribe) { diff --git a/imp/templates/index/index-dimp.inc b/imp/templates/index/index-dimp.inc index 5fa96ea07..8df17d6e2 100644 --- a/imp/templates/index/index-dimp.inc +++ b/imp/templates/index/index-dimp.inc @@ -17,7 +17,7 @@ $sidebar_width = max((int)$prefs->getValue('sidebar_width') - 50, 150) . 'px'; $show_quota = (isset($_SESSION['imp']['quota']) && is_array($_SESSION['imp']['quota'])); // Get the list of available IMAP flags -$imp_flags = &IMP_Imap_Flags::singleton(); +$imp_flags = IMP_Imap_Flags::singleton(); $flag_list = $imp_flags->getList(array('imap' => true)); // Small utility functions to simplify creating dimpactions buttons. diff --git a/imp/templates/javascript_defs_dimp.php b/imp/templates/javascript_defs_dimp.php index 8cbc5612a..013b8a80c 100644 --- a/imp/templates/javascript_defs_dimp.php +++ b/imp/templates/javascript_defs_dimp.php @@ -28,7 +28,7 @@ foreach ($dimp_block_list as $block) { } /* Generate flag array. */ -$imp_flags = &IMP_Imap_Flags::singleton(); +$imp_flags = IMP_Imap_Flags::singleton(); foreach ($imp_flags->getList() as $val) { $flags[$val['flag']] = array_filter(array( 'b' => isset($val['b']) ? $val['b'] : null, diff --git a/imp/templates/prefs/flagmanagement.inc b/imp/templates/prefs/flagmanagement.inc index 02f80af77..20d899bdf 100644 --- a/imp/templates/prefs/flagmanagement.inc +++ b/imp/templates/prefs/flagmanagement.inc @@ -1,6 +1,6 @@ getList(array('div' => true, 'fgcolor' => true)); /* Get the graphics. */ diff --git a/imp/thread.php b/imp/thread.php index 70910cf83..1e2fc67e6 100644 --- a/imp/thread.php +++ b/imp/thread.php @@ -17,7 +17,7 @@ require_once dirname(__FILE__) . '/lib/base.php'; */ $mode = Horde_Util::getFormData('mode', 'thread'); -$imp_mailbox = &IMP_Mailbox::singleton($imp_mbox['mailbox'], $imp_mbox['index']); +$imp_mailbox = IMP_Mailbox::singleton($imp_mbox['mailbox'], $imp_mbox['index']); $error = false; if ($mode == 'thread') { @@ -88,7 +88,7 @@ foreach ($loop_array as $mbox => $idxlist) { /* Get the body of the message. */ $curr_msg = $curr_tree = array(); - $contents = &IMP_Contents::singleton($idx . IMP::IDX_SEP . $mbox); + $contents = IMP_Contents::singleton($idx . IMP::IDX_SEP . $mbox); $mime_id = $contents->findBody(); if ($contents->canDisplay($mime_id, IMP_Contents::RENDER_INLINE)) { $ret = $contents->renderMIMEPart($mime_id, IMP_Contents::RENDER_INLINE); @@ -138,7 +138,7 @@ foreach ($loop_array as $mbox => $idxlist) { } /* Flag messages as seen. */ -$imp_message = &IMP_Message::singleton(); +$imp_message = IMP_Message::singleton(); $imp_message->flag(array('\\seen'), $loop_array); $template = new IMP_Template();