From aeca8807dbce951beccbc3fb0e5a4ae5600e5e5f Mon Sep 17 00:00:00 2001 From: Eric Helgeson Date: Mon, 5 Oct 2009 12:55:55 -0400 Subject: [PATCH 1/4] Open tags should have closing tags --- scripts/allsites.php | 3 ++- scripts/createsim.php | 1 + scripts/decache.php | 1 + scripts/deleteuser.php | 1 + scripts/enjitqueuehandler.php | 1 + scripts/facebookqueuehandler.php | 1 + scripts/fixup_conversations.php | 1 + scripts/fixup_hashtags.php | 1 + scripts/fixup_inboxes.php | 1 + scripts/fixup_notices_rendered.php | 1 + scripts/fixup_replies.php | 1 + scripts/fixup_utf8.php | 1 + scripts/getpiddir.php | 1 + scripts/getvaliddaemons.php | 1 + scripts/inbox_users.php | 1 + scripts/jabberqueuehandler.php | 1 + scripts/maildaemon.php | 1 + scripts/ombqueuehandler.php | 1 + scripts/pingqueuehandler.php | 1 + scripts/publicqueuehandler.php | 1 + scripts/reportsnapshot.php | 1 + scripts/sessiongc.php | 1 + scripts/setpassword.php | 1 + scripts/showcache.php | 1 + scripts/smsqueuehandler.php | 1 + scripts/synctwitterfriends.php | 2 +- scripts/triminboxes.php | 1 + scripts/twitterqueuehandler.php | 1 + scripts/twitterstatusfetcher.php | 2 +- scripts/uncache_users.php | 1 + scripts/update_translations.php | 1 + scripts/xmppconfirmhandler.php | 2 +- scripts/xmppdaemon.php | 1 + 33 files changed, 34 insertions(+), 4 deletions(-) diff --git a/scripts/allsites.php b/scripts/allsites.php index cf1419e550..ff9d8bc804 100755 --- a/scripts/allsites.php +++ b/scripts/allsites.php @@ -37,4 +37,5 @@ if ($sn->find()) { while ($sn->fetch()) { print "$sn->nickname\n"; } -} \ No newline at end of file +} +?> diff --git a/scripts/createsim.php b/scripts/createsim.php index 71ed3bf722..93f904506a 100644 --- a/scripts/createsim.php +++ b/scripts/createsim.php @@ -140,3 +140,4 @@ $tagmax = (have_option('t', 'tags')) ? get_option_value('t', 'tags') : 10000 $userprefix = (have_option('x', 'prefix')) ? get_option_value('x', 'prefix') : 'testuser'; main($usercount, $noticeavg, $subsavg, $tagmax); +?> diff --git a/scripts/decache.php b/scripts/decache.php index 7cabd78ada..9b820bd832 100644 --- a/scripts/decache.php +++ b/scripts/decache.php @@ -48,3 +48,4 @@ if (!$object) { } $result = $object->decache(); +?> diff --git a/scripts/deleteuser.php b/scripts/deleteuser.php index 52389123c5..446f76878b 100644 --- a/scripts/deleteuser.php +++ b/scripts/deleteuser.php @@ -66,3 +66,4 @@ if (!have_option('y', 'yes')) { print "Deleting..."; $user->delete(); print "DONE.\n"; +?> diff --git a/scripts/enjitqueuehandler.php b/scripts/enjitqueuehandler.php index 08f733b07c..5eda062f5a 100755 --- a/scripts/enjitqueuehandler.php +++ b/scripts/enjitqueuehandler.php @@ -137,3 +137,4 @@ if ($handler->start()) { } $handler->finish(); +?> diff --git a/scripts/facebookqueuehandler.php b/scripts/facebookqueuehandler.php index e13ac4e850..dc17cb15a0 100755 --- a/scripts/facebookqueuehandler.php +++ b/scripts/facebookqueuehandler.php @@ -72,3 +72,4 @@ if (have_option('i')) { $handler = new FacebookQueueHandler($id); $handler->runOnce(); +?> diff --git a/scripts/fixup_conversations.php b/scripts/fixup_conversations.php index 8a9f7bb577..f79288f7b3 100755 --- a/scripts/fixup_conversations.php +++ b/scripts/fixup_conversations.php @@ -68,3 +68,4 @@ while ($nid->fetch()) { print ".\n"; } +?> diff --git a/scripts/fixup_hashtags.php b/scripts/fixup_hashtags.php index 5cfebd8ee8..bae0947b2d 100755 --- a/scripts/fixup_hashtags.php +++ b/scripts/fixup_hashtags.php @@ -45,3 +45,4 @@ while ($notice->fetch()) { common_log_db_error($notice, 'UPDATE', __FILE__); } } +?> diff --git a/scripts/fixup_inboxes.php b/scripts/fixup_inboxes.php index d55a538853..9619f3226b 100755 --- a/scripts/fixup_inboxes.php +++ b/scripts/fixup_inboxes.php @@ -79,3 +79,4 @@ while ($user->fetch()) { $cache->delete(common_cache_key('user:notices_with_friends:' . $user->id)); } } +?> diff --git a/scripts/fixup_notices_rendered.php b/scripts/fixup_notices_rendered.php index 359cd6cce4..4b928ecd22 100755 --- a/scripts/fixup_notices_rendered.php +++ b/scripts/fixup_notices_rendered.php @@ -49,3 +49,4 @@ while ($notice->fetch()) { common_log_db_error($notice, 'UPDATE', __FILE__); } } +?> diff --git a/scripts/fixup_replies.php b/scripts/fixup_replies.php index 7328635d3c..302c239151 100755 --- a/scripts/fixup_replies.php +++ b/scripts/fixup_replies.php @@ -39,3 +39,4 @@ while ($notice->fetch()) { common_log(LOG_INFO, 'Getting replies for notice #' . $notice->id); common_save_replies($notice); } +?> diff --git a/scripts/fixup_utf8.php b/scripts/fixup_utf8.php index 5a9fba7c3f..24d301dab8 100755 --- a/scripts/fixup_utf8.php +++ b/scripts/fixup_utf8.php @@ -363,3 +363,4 @@ $fixer = new UTF8FixerUpper(array('max_date' => $max_date, $fixer->fixup(); +?> diff --git a/scripts/getpiddir.php b/scripts/getpiddir.php index 8274c37c0f..5860655fd3 100755 --- a/scripts/getpiddir.php +++ b/scripts/getpiddir.php @@ -28,3 +28,4 @@ ENDOFHELP; require_once INSTALLDIR.'/scripts/commandline.inc'; echo common_config('daemon', 'piddir'); +?> diff --git a/scripts/getvaliddaemons.php b/scripts/getvaliddaemons.php index 8f48e8e6f0..7fffac783b 100755 --- a/scripts/getvaliddaemons.php +++ b/scripts/getvaliddaemons.php @@ -52,3 +52,4 @@ echo "pingqueuehandler.php "; if (common_config('sms', 'enabled')) { echo "smsqueuehandler.php "; } +?> diff --git a/scripts/inbox_users.php b/scripts/inbox_users.php index 32adcea213..718dd856be 100755 --- a/scripts/inbox_users.php +++ b/scripts/inbox_users.php @@ -105,3 +105,4 @@ foreach ($ids as $id) { $cache->delete(common_cache_key('user:notices_with_friends:' . $user->id . ';last')); } } +?> diff --git a/scripts/jabberqueuehandler.php b/scripts/jabberqueuehandler.php index 8f3a56944d..b029ea1f1e 100755 --- a/scripts/jabberqueuehandler.php +++ b/scripts/jabberqueuehandler.php @@ -76,3 +76,4 @@ if (have_option('i')) { $handler = new JabberQueueHandler($id); $handler->runOnce(); +?> diff --git a/scripts/maildaemon.php b/scripts/maildaemon.php index 11911dcbdc..19c77e077a 100755 --- a/scripts/maildaemon.php +++ b/scripts/maildaemon.php @@ -389,3 +389,4 @@ if (common_config('emailpost', 'enabled')) { $md = new MailerDaemon(); $md->handle_message('php://stdin'); } +?> diff --git a/scripts/ombqueuehandler.php b/scripts/ombqueuehandler.php index 8e685f1c8e..a24185da35 100755 --- a/scripts/ombqueuehandler.php +++ b/scripts/ombqueuehandler.php @@ -85,3 +85,4 @@ if (have_option('i')) { $handler = new OmbQueueHandler($id); $handler->runOnce(); +?> diff --git a/scripts/pingqueuehandler.php b/scripts/pingqueuehandler.php index c92337e36c..768c06c776 100644 --- a/scripts/pingqueuehandler.php +++ b/scripts/pingqueuehandler.php @@ -67,3 +67,4 @@ if (have_option('i')) { $handler = new PingQueueHandler($id); $handler->runOnce(); +?> diff --git a/scripts/publicqueuehandler.php b/scripts/publicqueuehandler.php index 50a11bcba0..ffb5acdb64 100755 --- a/scripts/publicqueuehandler.php +++ b/scripts/publicqueuehandler.php @@ -74,3 +74,4 @@ if (have_option('i')) { $handler = new PublicQueueHandler($id); $handler->runOnce(); +?> diff --git a/scripts/reportsnapshot.php b/scripts/reportsnapshot.php index 71f1019ee6..b8f8d2a7cf 100644 --- a/scripts/reportsnapshot.php +++ b/scripts/reportsnapshot.php @@ -28,3 +28,4 @@ END_OF_SNAPSHOT_HELP; require_once INSTALLDIR.'/scripts/commandline.inc'; Snapshot::check(); +?> diff --git a/scripts/sessiongc.php b/scripts/sessiongc.php index af55ddf3f0..b5fdcbf341 100644 --- a/scripts/sessiongc.php +++ b/scripts/sessiongc.php @@ -34,3 +34,4 @@ $maxlifetime = ini_get('session.gc_maxlifetime'); print "Deleting sessions older than $maxlifetime seconds.\n"; Session::gc($maxlifetime); +?> diff --git a/scripts/setpassword.php b/scripts/setpassword.php index 50d49d7dbf..f951dccf78 100755 --- a/scripts/setpassword.php +++ b/scripts/setpassword.php @@ -59,3 +59,4 @@ if (!$user->update($original)) { print "Password for user '$nickname' updated.\n"; exit(0); } +?> diff --git a/scripts/showcache.php b/scripts/showcache.php index f179795728..fb0ccb5e03 100644 --- a/scripts/showcache.php +++ b/scripts/showcache.php @@ -69,3 +69,4 @@ if (empty($obj)) { var_dump($obj); print "\n"; } +?> diff --git a/scripts/smsqueuehandler.php b/scripts/smsqueuehandler.php index 6583a77da8..9e8de7a117 100755 --- a/scripts/smsqueuehandler.php +++ b/scripts/smsqueuehandler.php @@ -71,3 +71,4 @@ if (have_option('i')) { $handler = new SmsQueueHandler($id); $handler->runOnce(); +?> diff --git a/scripts/synctwitterfriends.php b/scripts/synctwitterfriends.php index b30e700a1c..f582231e39 100755 --- a/scripts/synctwitterfriends.php +++ b/scripts/synctwitterfriends.php @@ -283,4 +283,4 @@ if (have_option('d') || have_option('debug')) { $syncer = new SyncTwitterFriendsDaemon($id, 60, 2, $debug); $syncer->runOnce(); - +?> diff --git a/scripts/triminboxes.php b/scripts/triminboxes.php index da09817e5b..5153d17065 100644 --- a/scripts/triminboxes.php +++ b/scripts/triminboxes.php @@ -54,3 +54,4 @@ $cnt = $user->find(); while ($user->fetch()) { Notice_inbox::gc($user->id); } +?> diff --git a/scripts/twitterqueuehandler.php b/scripts/twitterqueuehandler.php index ce4d824d0d..820baeb0a1 100755 --- a/scripts/twitterqueuehandler.php +++ b/scripts/twitterqueuehandler.php @@ -72,3 +72,4 @@ if (have_option('i')) { $handler = new TwitterQueueHandler($id); $handler->runOnce(); +?> diff --git a/scripts/twitterstatusfetcher.php b/scripts/twitterstatusfetcher.php index 3cdf1867a1..726d2e2375 100755 --- a/scripts/twitterstatusfetcher.php +++ b/scripts/twitterstatusfetcher.php @@ -562,4 +562,4 @@ if (have_option('d') || have_option('debug')) { $fetcher = new TwitterStatusFetcher($id, 60, 2, $debug); $fetcher->runOnce(); - +?> diff --git a/scripts/uncache_users.php b/scripts/uncache_users.php index 5a1d330307..ee030f778f 100644 --- a/scripts/uncache_users.php +++ b/scripts/uncache_users.php @@ -50,3 +50,4 @@ foreach ($ids as $id) { $memc->delete(common_cache_key('user:notices_with_friends:'. $user->id)); $memc->delete(common_cache_key('user:notices_with_friends:'. $user->id . ';last')); } +?> diff --git a/scripts/update_translations.php b/scripts/update_translations.php index f145c1f0b6..f036657c54 100755 --- a/scripts/update_translations.php +++ b/scripts/update_translations.php @@ -96,3 +96,4 @@ function curl_get_file($url) return FALSE; } +?> diff --git a/scripts/xmppconfirmhandler.php b/scripts/xmppconfirmhandler.php index c7ed15e495..05c5f86ce7 100755 --- a/scripts/xmppconfirmhandler.php +++ b/scripts/xmppconfirmhandler.php @@ -160,4 +160,4 @@ if (have_option('i')) { $handler = new XmppConfirmHandler($id); $handler->runOnce(); - +?> diff --git a/scripts/xmppdaemon.php b/scripts/xmppdaemon.php index 9e621e725a..eaebd59488 100755 --- a/scripts/xmppdaemon.php +++ b/scripts/xmppdaemon.php @@ -412,3 +412,4 @@ $foreground = have_option('f', 'foreground'); $daemon = new XMPPDaemon($id, !$foreground); $daemon->runOnce(); +?> From a6d4adc398d9d2d131df97007452c5c54072ddec Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 8 Oct 2009 11:41:39 -0400 Subject: [PATCH 2/4] Revert "Open tags should have closing tags" This reverts commit aeca8807dbce951beccbc3fb0e5a4ae5600e5e5f. We specifically DON'T have closing tags so we don't get errors with whitespace after the closing tag. I realize this is less of an issue with scripts, but we should still not use closing tags. --- scripts/allsites.php | 3 +-- scripts/createsim.php | 1 - scripts/decache.php | 1 - scripts/deleteuser.php | 1 - scripts/enjitqueuehandler.php | 1 - scripts/facebookqueuehandler.php | 1 - scripts/fixup_conversations.php | 1 - scripts/fixup_hashtags.php | 1 - scripts/fixup_inboxes.php | 1 - scripts/fixup_notices_rendered.php | 1 - scripts/fixup_replies.php | 1 - scripts/fixup_utf8.php | 1 - scripts/getpiddir.php | 1 - scripts/getvaliddaemons.php | 1 - scripts/inbox_users.php | 1 - scripts/jabberqueuehandler.php | 1 - scripts/maildaemon.php | 1 - scripts/ombqueuehandler.php | 1 - scripts/pingqueuehandler.php | 1 - scripts/publicqueuehandler.php | 1 - scripts/reportsnapshot.php | 1 - scripts/sessiongc.php | 1 - scripts/setpassword.php | 1 - scripts/showcache.php | 1 - scripts/smsqueuehandler.php | 1 - scripts/synctwitterfriends.php | 2 +- scripts/triminboxes.php | 1 - scripts/twitterqueuehandler.php | 1 - scripts/twitterstatusfetcher.php | 2 +- scripts/uncache_users.php | 1 - scripts/update_translations.php | 1 - scripts/xmppconfirmhandler.php | 2 +- scripts/xmppdaemon.php | 1 - 33 files changed, 4 insertions(+), 34 deletions(-) diff --git a/scripts/allsites.php b/scripts/allsites.php index ff9d8bc804..cf1419e550 100755 --- a/scripts/allsites.php +++ b/scripts/allsites.php @@ -37,5 +37,4 @@ if ($sn->find()) { while ($sn->fetch()) { print "$sn->nickname\n"; } -} -?> +} \ No newline at end of file diff --git a/scripts/createsim.php b/scripts/createsim.php index 93f904506a..71ed3bf722 100644 --- a/scripts/createsim.php +++ b/scripts/createsim.php @@ -140,4 +140,3 @@ $tagmax = (have_option('t', 'tags')) ? get_option_value('t', 'tags') : 10000 $userprefix = (have_option('x', 'prefix')) ? get_option_value('x', 'prefix') : 'testuser'; main($usercount, $noticeavg, $subsavg, $tagmax); -?> diff --git a/scripts/decache.php b/scripts/decache.php index 9b820bd832..7cabd78ada 100644 --- a/scripts/decache.php +++ b/scripts/decache.php @@ -48,4 +48,3 @@ if (!$object) { } $result = $object->decache(); -?> diff --git a/scripts/deleteuser.php b/scripts/deleteuser.php index 446f76878b..52389123c5 100644 --- a/scripts/deleteuser.php +++ b/scripts/deleteuser.php @@ -66,4 +66,3 @@ if (!have_option('y', 'yes')) { print "Deleting..."; $user->delete(); print "DONE.\n"; -?> diff --git a/scripts/enjitqueuehandler.php b/scripts/enjitqueuehandler.php index 5eda062f5a..08f733b07c 100755 --- a/scripts/enjitqueuehandler.php +++ b/scripts/enjitqueuehandler.php @@ -137,4 +137,3 @@ if ($handler->start()) { } $handler->finish(); -?> diff --git a/scripts/facebookqueuehandler.php b/scripts/facebookqueuehandler.php index dc17cb15a0..e13ac4e850 100755 --- a/scripts/facebookqueuehandler.php +++ b/scripts/facebookqueuehandler.php @@ -72,4 +72,3 @@ if (have_option('i')) { $handler = new FacebookQueueHandler($id); $handler->runOnce(); -?> diff --git a/scripts/fixup_conversations.php b/scripts/fixup_conversations.php index f79288f7b3..8a9f7bb577 100755 --- a/scripts/fixup_conversations.php +++ b/scripts/fixup_conversations.php @@ -68,4 +68,3 @@ while ($nid->fetch()) { print ".\n"; } -?> diff --git a/scripts/fixup_hashtags.php b/scripts/fixup_hashtags.php index bae0947b2d..5cfebd8ee8 100755 --- a/scripts/fixup_hashtags.php +++ b/scripts/fixup_hashtags.php @@ -45,4 +45,3 @@ while ($notice->fetch()) { common_log_db_error($notice, 'UPDATE', __FILE__); } } -?> diff --git a/scripts/fixup_inboxes.php b/scripts/fixup_inboxes.php index 9619f3226b..d55a538853 100755 --- a/scripts/fixup_inboxes.php +++ b/scripts/fixup_inboxes.php @@ -79,4 +79,3 @@ while ($user->fetch()) { $cache->delete(common_cache_key('user:notices_with_friends:' . $user->id)); } } -?> diff --git a/scripts/fixup_notices_rendered.php b/scripts/fixup_notices_rendered.php index 4b928ecd22..359cd6cce4 100755 --- a/scripts/fixup_notices_rendered.php +++ b/scripts/fixup_notices_rendered.php @@ -49,4 +49,3 @@ while ($notice->fetch()) { common_log_db_error($notice, 'UPDATE', __FILE__); } } -?> diff --git a/scripts/fixup_replies.php b/scripts/fixup_replies.php index 302c239151..7328635d3c 100755 --- a/scripts/fixup_replies.php +++ b/scripts/fixup_replies.php @@ -39,4 +39,3 @@ while ($notice->fetch()) { common_log(LOG_INFO, 'Getting replies for notice #' . $notice->id); common_save_replies($notice); } -?> diff --git a/scripts/fixup_utf8.php b/scripts/fixup_utf8.php index 24d301dab8..5a9fba7c3f 100755 --- a/scripts/fixup_utf8.php +++ b/scripts/fixup_utf8.php @@ -363,4 +363,3 @@ $fixer = new UTF8FixerUpper(array('max_date' => $max_date, $fixer->fixup(); -?> diff --git a/scripts/getpiddir.php b/scripts/getpiddir.php index 5860655fd3..8274c37c0f 100755 --- a/scripts/getpiddir.php +++ b/scripts/getpiddir.php @@ -28,4 +28,3 @@ ENDOFHELP; require_once INSTALLDIR.'/scripts/commandline.inc'; echo common_config('daemon', 'piddir'); -?> diff --git a/scripts/getvaliddaemons.php b/scripts/getvaliddaemons.php index 7fffac783b..8f48e8e6f0 100755 --- a/scripts/getvaliddaemons.php +++ b/scripts/getvaliddaemons.php @@ -52,4 +52,3 @@ echo "pingqueuehandler.php "; if (common_config('sms', 'enabled')) { echo "smsqueuehandler.php "; } -?> diff --git a/scripts/inbox_users.php b/scripts/inbox_users.php index 718dd856be..32adcea213 100755 --- a/scripts/inbox_users.php +++ b/scripts/inbox_users.php @@ -105,4 +105,3 @@ foreach ($ids as $id) { $cache->delete(common_cache_key('user:notices_with_friends:' . $user->id . ';last')); } } -?> diff --git a/scripts/jabberqueuehandler.php b/scripts/jabberqueuehandler.php index b029ea1f1e..8f3a56944d 100755 --- a/scripts/jabberqueuehandler.php +++ b/scripts/jabberqueuehandler.php @@ -76,4 +76,3 @@ if (have_option('i')) { $handler = new JabberQueueHandler($id); $handler->runOnce(); -?> diff --git a/scripts/maildaemon.php b/scripts/maildaemon.php index 19c77e077a..11911dcbdc 100755 --- a/scripts/maildaemon.php +++ b/scripts/maildaemon.php @@ -389,4 +389,3 @@ if (common_config('emailpost', 'enabled')) { $md = new MailerDaemon(); $md->handle_message('php://stdin'); } -?> diff --git a/scripts/ombqueuehandler.php b/scripts/ombqueuehandler.php index a24185da35..8e685f1c8e 100755 --- a/scripts/ombqueuehandler.php +++ b/scripts/ombqueuehandler.php @@ -85,4 +85,3 @@ if (have_option('i')) { $handler = new OmbQueueHandler($id); $handler->runOnce(); -?> diff --git a/scripts/pingqueuehandler.php b/scripts/pingqueuehandler.php index 768c06c776..c92337e36c 100644 --- a/scripts/pingqueuehandler.php +++ b/scripts/pingqueuehandler.php @@ -67,4 +67,3 @@ if (have_option('i')) { $handler = new PingQueueHandler($id); $handler->runOnce(); -?> diff --git a/scripts/publicqueuehandler.php b/scripts/publicqueuehandler.php index ffb5acdb64..50a11bcba0 100755 --- a/scripts/publicqueuehandler.php +++ b/scripts/publicqueuehandler.php @@ -74,4 +74,3 @@ if (have_option('i')) { $handler = new PublicQueueHandler($id); $handler->runOnce(); -?> diff --git a/scripts/reportsnapshot.php b/scripts/reportsnapshot.php index b8f8d2a7cf..71f1019ee6 100644 --- a/scripts/reportsnapshot.php +++ b/scripts/reportsnapshot.php @@ -28,4 +28,3 @@ END_OF_SNAPSHOT_HELP; require_once INSTALLDIR.'/scripts/commandline.inc'; Snapshot::check(); -?> diff --git a/scripts/sessiongc.php b/scripts/sessiongc.php index b5fdcbf341..af55ddf3f0 100644 --- a/scripts/sessiongc.php +++ b/scripts/sessiongc.php @@ -34,4 +34,3 @@ $maxlifetime = ini_get('session.gc_maxlifetime'); print "Deleting sessions older than $maxlifetime seconds.\n"; Session::gc($maxlifetime); -?> diff --git a/scripts/setpassword.php b/scripts/setpassword.php index f951dccf78..50d49d7dbf 100755 --- a/scripts/setpassword.php +++ b/scripts/setpassword.php @@ -59,4 +59,3 @@ if (!$user->update($original)) { print "Password for user '$nickname' updated.\n"; exit(0); } -?> diff --git a/scripts/showcache.php b/scripts/showcache.php index fb0ccb5e03..f179795728 100644 --- a/scripts/showcache.php +++ b/scripts/showcache.php @@ -69,4 +69,3 @@ if (empty($obj)) { var_dump($obj); print "\n"; } -?> diff --git a/scripts/smsqueuehandler.php b/scripts/smsqueuehandler.php index 9e8de7a117..6583a77da8 100755 --- a/scripts/smsqueuehandler.php +++ b/scripts/smsqueuehandler.php @@ -71,4 +71,3 @@ if (have_option('i')) { $handler = new SmsQueueHandler($id); $handler->runOnce(); -?> diff --git a/scripts/synctwitterfriends.php b/scripts/synctwitterfriends.php index f582231e39..b30e700a1c 100755 --- a/scripts/synctwitterfriends.php +++ b/scripts/synctwitterfriends.php @@ -283,4 +283,4 @@ if (have_option('d') || have_option('debug')) { $syncer = new SyncTwitterFriendsDaemon($id, 60, 2, $debug); $syncer->runOnce(); -?> + diff --git a/scripts/triminboxes.php b/scripts/triminboxes.php index 5153d17065..da09817e5b 100644 --- a/scripts/triminboxes.php +++ b/scripts/triminboxes.php @@ -54,4 +54,3 @@ $cnt = $user->find(); while ($user->fetch()) { Notice_inbox::gc($user->id); } -?> diff --git a/scripts/twitterqueuehandler.php b/scripts/twitterqueuehandler.php index 820baeb0a1..ce4d824d0d 100755 --- a/scripts/twitterqueuehandler.php +++ b/scripts/twitterqueuehandler.php @@ -72,4 +72,3 @@ if (have_option('i')) { $handler = new TwitterQueueHandler($id); $handler->runOnce(); -?> diff --git a/scripts/twitterstatusfetcher.php b/scripts/twitterstatusfetcher.php index 726d2e2375..3cdf1867a1 100755 --- a/scripts/twitterstatusfetcher.php +++ b/scripts/twitterstatusfetcher.php @@ -562,4 +562,4 @@ if (have_option('d') || have_option('debug')) { $fetcher = new TwitterStatusFetcher($id, 60, 2, $debug); $fetcher->runOnce(); -?> + diff --git a/scripts/uncache_users.php b/scripts/uncache_users.php index ee030f778f..5a1d330307 100644 --- a/scripts/uncache_users.php +++ b/scripts/uncache_users.php @@ -50,4 +50,3 @@ foreach ($ids as $id) { $memc->delete(common_cache_key('user:notices_with_friends:'. $user->id)); $memc->delete(common_cache_key('user:notices_with_friends:'. $user->id . ';last')); } -?> diff --git a/scripts/update_translations.php b/scripts/update_translations.php index f036657c54..f145c1f0b6 100755 --- a/scripts/update_translations.php +++ b/scripts/update_translations.php @@ -96,4 +96,3 @@ function curl_get_file($url) return FALSE; } -?> diff --git a/scripts/xmppconfirmhandler.php b/scripts/xmppconfirmhandler.php index 05c5f86ce7..c7ed15e495 100755 --- a/scripts/xmppconfirmhandler.php +++ b/scripts/xmppconfirmhandler.php @@ -160,4 +160,4 @@ if (have_option('i')) { $handler = new XmppConfirmHandler($id); $handler->runOnce(); -?> + diff --git a/scripts/xmppdaemon.php b/scripts/xmppdaemon.php index eaebd59488..9e621e725a 100755 --- a/scripts/xmppdaemon.php +++ b/scripts/xmppdaemon.php @@ -412,4 +412,3 @@ $foreground = have_option('f', 'foreground'); $daemon = new XMPPDaemon($id, !$foreground); $daemon->runOnce(); -?> From 88e7092d2326403ab5cb0c7261b665154491e75c Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 9 Oct 2009 10:39:56 -0400 Subject: [PATCH 3/4] don't write session if it's unchanged --- classes/Session.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/classes/Session.php b/classes/Session.php index d641edbbe4..79a69a96ea 100644 --- a/classes/Session.php +++ b/classes/Session.php @@ -85,9 +85,18 @@ class Session extends Memcached_DataObject return $session->insert(); } else { - $session->session_data = $session_data; + if (strcmp($session->session_data, $session_data) == 0) { + self::logdeb("Not writing session '$id'; unchanged"); + return true; + } else { + self::logdeb("Session '$id' data changed; updating"); - return $session->update(); + $orig = clone($session); + + $session->session_data = $session_data; + + return $session->update($orig); + } } } From e9d7f18f0c2ad05c0203bc347a74c0f69e497566 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 9 Oct 2009 14:06:08 -0400 Subject: [PATCH 4/4] fix FBConnect so it doesn't muffle EndPrimaryNav --- plugins/FBConnect/FBConnectPlugin.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/FBConnect/FBConnectPlugin.php b/plugins/FBConnect/FBConnectPlugin.php index 593b49b4ed..cb19b05461 100644 --- a/plugins/FBConnect/FBConnectPlugin.php +++ b/plugins/FBConnect/FBConnectPlugin.php @@ -313,6 +313,11 @@ class FBConnectPlugin extends Plugin $action->menuItem(common_local_url('peoplesearch'), _('Search'), _('Search for people or text'), false, 'nav_search'); + // We are replacing the primary nav entirely; give other + // plugins a chance to handle it here. + + Event::handle('EndPrimaryNav', array($action)); + return false; }