use Horde_Date instead of DateTime here, since Horde_Date supports timestamps in...
authorChuck Hagenbuch <chuck@horde.org>
Sat, 17 Jan 2009 16:10:49 +0000 (11:10 -0500)
committerChuck Hagenbuch <chuck@horde.org>
Sat, 17 Jan 2009 16:10:49 +0000 (11:10 -0500)
imp/lib/Maintenance/Task/purge_sentmail.php
imp/lib/Maintenance/Task/purge_spam.php
imp/lib/Maintenance/Task/purge_trash.php

index 4062b5c..7399831 100644 (file)
@@ -23,15 +23,15 @@ class Maintenance_Task_purge_sentmail extends Maintenance_Task
     {
         global $prefs, $notification;
 
-        $imp_folder = &IMP_Folder::singleton();
-        $imp_message = &IMP_Message::singleton();
+        $imp_folder = IMP_Folder::singleton();
+        $imp_message = IMP_Message::singleton();
 
         $mbox_list = Maintenance_Task_purge_sentmail::_getFolders();
 
         /* Get the current UNIX timestamp minus the number of days specified
          * in 'purge_sentmail_keep'.  If a message has a timestamp prior to
          * this value, it will be deleted. */
-        $del_time = new DateTime(time() - ($prefs->getValue('purge_sentmail_keep') * 86400));
+        $del_time = new Horde_Date(time() - ($prefs->getValue('purge_sentmail_keep') * 86400));
         $month = $del_time->format('n');
         $day = $del_time->format('j');
         $year = $del_time->format('Y');
@@ -87,9 +87,8 @@ class Maintenance_Task_purge_sentmail extends Maintenance_Task
      */
     function _getFolders()
     {
-        include_once 'Horde/Identity.php';
-        $identity = &Identity::singleton(array('imp', 'imp'));
-        return $identity->getAllSentmailfolders();
+        require_once 'Horde/Identity.php';
+        return Identity::singleton(array('imp', 'imp'))->getAllSentmailfolders();
     }
 
 }
index e7aa14b..2ee177f 100644 (file)
@@ -29,7 +29,7 @@ class Maintenance_Task_purge_spam extends Maintenance_Task
         }
 
         /* Make sure the Spam folder exists. */
-        $imp_folder = &IMP_Folder::singleton();
+        $imp_folder = IMP_Folder::singleton();
         if (!$imp_folder->exists($spam_folder)) {
             return false;
         }
@@ -37,7 +37,7 @@ class Maintenance_Task_purge_spam extends Maintenance_Task
         /* Get the current UNIX timestamp minus the number of days
            specified in 'purge_spam_keep'.  If a message has a
            timestamp prior to this value, it will be deleted. */
-        $del_time = new DateTime(time() - ($prefs->getValue('purge_spam_keep') * 86400));
+        $del_time = new Horde_Date(time() - ($prefs->getValue('purge_spam_keep') * 86400));
         $month = $del_time->format('n');
         $day = $del_time->format('j');
         $year = $del_time->format('Y');
@@ -51,7 +51,7 @@ class Maintenance_Task_purge_spam extends Maintenance_Task
         }
 
         /* Go through the message list and delete the messages. */
-        $imp_message = &IMP_Message::singleton();
+        $imp_message = IMP_Message::singleton();
         if ($imp_message->delete(array($spam_folder => $msg_ids), true)) {
             $msgcount = count($msg_ids);
             if ($msgcount == 1) {
index 12369e1..40d32a0 100644 (file)
@@ -29,7 +29,7 @@ class Maintenance_Task_purge_trash extends Maintenance_Task
         }
 
         /* Make sure the Trash folder exists. */
-        $imp_folder = &IMP_Folder::singleton();
+        $imp_folder = IMP_Folder::singleton();
         if (!$imp_folder->exists($trash_folder)) {
             return false;
         }
@@ -37,7 +37,7 @@ class Maintenance_Task_purge_trash extends Maintenance_Task
         /* Get the current UNIX timestamp minus the number of days
            specified in 'purge_trash_keep'.  If a message has a
            timestamp prior to this value, it will be deleted. */
-        $del_time = new DateTime(time() - ($prefs->getValue('purge_trash_keep') * 86400));
+        $del_time = new Horde_Date(time() - ($prefs->getValue('purge_trash_keep') * 86400));
         $month = $del_time->format('n');
         $day = $del_time->format('j');
         $year = $del_time->format('Y');
@@ -51,7 +51,7 @@ class Maintenance_Task_purge_trash extends Maintenance_Task
         }
 
         /* Go through the message list and delete the messages. */
-        $imp_message = &IMP_Message::singleton();
+        $imp_message = IMP_Message::singleton();
         if ($imp_message->delete(array($trash_folder => $msg_ids), true)) {
             $msgcount = count($msg_ids);
             if ($msgcount == 1) {