X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=scripts%2Ffixup_inboxes.php;h=2aa5d1690003c938c634e71ef5c631cc709db13f;hb=297d603febbb1900b395e1ddaf970f61f259cdad;hp=e631a80ed8906423081665646d987f9e5265869d;hpb=edbc0c665cc65875b4d14b79939233b1c9c06bb6;p=quix0rs-gnu-social.git diff --git a/scripts/fixup_inboxes.php b/scripts/fixup_inboxes.php index e631a80ed8..2aa5d16900 100755 --- a/scripts/fixup_inboxes.php +++ b/scripts/fixup_inboxes.php @@ -1,8 +1,8 @@ #!/usr/bin/env php . */ -# Abort if called from a web server +// Abort if called from a web server if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) { print "This script must be run from the command line\n"; exit(); @@ -30,11 +30,12 @@ set_time_limit(0); mb_internal_encoding('UTF-8'); define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); -define('LACONICA', true); +define('STATUSNET', true); +define('LACONICA', true); // compatibility require_once(INSTALLDIR . '/lib/common.php'); -$start_at = ($argc > 1) ? $argv[1] : NULL; +$start_at = ($argc > 1) ? $argv[1] : null; common_log(LOG_INFO, 'Updating user inboxes.'); @@ -45,7 +46,7 @@ if ($start_at) { } $cnt = $user->find(); -$cache = common_memcache(); +$cache = Cache::instance(); while ($user->fetch()) { common_log(LOG_INFO, 'Updating inbox for user ' . $user->id); @@ -75,6 +76,6 @@ while ($user->fetch()) { $inbox->free(); unset($inbox); if ($cache) { - $cache->delete(common_cache_key('user:notices_with_friends:' . $user->id)); + $cache->delete(Cache::key('user:notices_with_friends:' . $user->id)); } }