From 7ec27b657e6b7ad9416e531cf70fffcf48614708 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 30 Dec 2009 09:03:06 -1000 Subject: Replace Notice_inbox with Inbox --- scripts/triminboxes.php | 76 ------------------------------------------------- 1 file changed, 76 deletions(-) delete mode 100644 scripts/triminboxes.php (limited to 'scripts/triminboxes.php') diff --git a/scripts/triminboxes.php b/scripts/triminboxes.php deleted file mode 100644 index ea4751305..000000000 --- a/scripts/triminboxes.php +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env php -. - */ - -define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); - -$shortoptions = 'u::'; -$longoptions = array('start-user-id=', 'sleep-time='); - -$helptext = << - --start-user-id= User ID to start after. Default is all. - --sleep-time= Amount of time to wait (in seconds) between trims. Default is zero. - -END_OF_TRIM_HELP; - -require_once INSTALLDIR.'/scripts/commandline.inc'; - -$id = null; -$sleep_time = 0; - -if (have_option('u')) { - $id = get_option_value('u'); -} else if (have_option('--start-user-id')) { - $id = get_option_value('--start-user-id'); -} else { - $id = null; -} - -if (have_option('--sleep-time')) { - $sleep_time = intval(get_option_value('--sleep-time')); -} - -$quiet = have_option('q') || have_option('--quiet'); - -$user = new User(); - -if (!empty($id)) { - $user->whereAdd('id > ' . $id); -} - -$cnt = $user->find(); - -while ($user->fetch()) { - if (!$quiet) { - print "Trimming inbox for user $user->id"; - } - $count = Notice_inbox::gc($user->id); - if ($count) { - if (!$quiet) { - print ": $count trimmed..."; - } - sleep($sleep_time); - } - if (!$quiet) { - print "\n"; - } -} -- cgit v1.2.3-54-g00ecf