Removed purgeStaleMemcachedText.php and refreshImageCount.php scripts
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Fri, 7 Sep 2012 18:04:11 +0000 (20:04 +0200)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Fri, 7 Sep 2012 18:04:11 +0000 (20:04 +0200)
Both are Wikimedia-specific scripts and are now obsolete:
- purgeStaleMemcachedText.php is a script to purge memcached entries
  for revision text older than an hardcoded date of December 2012.
  This script is already in the WikimediaMaintenance extension.
- refreshImageCount.php is a hack to fix a schema update script dating
  to 2006.

Change-Id: I2ae469063eba502e662f80c38d5816c371550352

maintenance/purgeStaleMemcachedText.php [deleted file]
maintenance/refreshImageCount.php [deleted file]

diff --git a/maintenance/purgeStaleMemcachedText.php b/maintenance/purgeStaleMemcachedText.php
deleted file mode 100644 (file)
index 225400f..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-/**
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Maintenance Memcached
- */
-
-require_once( __DIR__ . '/commandLine.inc' );
-
-function purgeStaleMemcachedText() {
-       global $wgMemc, $wgDBname;
-       $db = wfGetDB( DB_MASTER );
-       $maxTextId = $db->selectField( 'text', 'max(old_id)' );
-       $latestReplicatedTextId = $db->selectField( array( 'recentchanges', 'revision' ), 'rev_text_id', 
-               array( 'rev_id = rc_this_oldid', "rc_timestamp < '20101225183000'"),  'purgeStaleMemcachedText', 
-               array( 'ORDER BY' => 'rc_timestamp DESC' ) );
-       $latestReplicatedTextId -= 100; # A bit of paranoia
-
-       echo "Going to purge text entries from $latestReplicatedTextId to $maxTextId in $wgDBname\n";
-
-       for ( $i = $latestReplicatedTextId; $i < $maxTextId; $i++ ) {
-               $key = wfMemcKey( 'revisiontext', 'textid', $i );
-               
-               while (1) {
-                       if (! $wgMemc->delete( $key ) ) {
-                               echo "Memcache delete for $key returned false\n";
-                       }
-                       if ( $wgMemc->get( $key ) ) {
-                               echo "There's still content in $key!\n";
-                       } else {
-                               break;
-                       }
-               }
-               
-       }
-}
-
-purgeStaleMemcachedText();
-
diff --git a/maintenance/refreshImageCount.php b/maintenance/refreshImageCount.php
deleted file mode 100644 (file)
index be6bd18..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-/**
- * Quickie hack; patch-ss_images.sql uses variables which don't
- * replicate properly.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @ingroup Maintenance
- */
-
-require_once( __DIR__ . '/Maintenance.php' );
-
-class RefreshImageCount extends Maintenance {
-       public function __construct() {
-               parent::__construct();
-               $this->mDescription = "Resets ss_image count, forcing slaves to pick it up.";
-       }
-
-       public function execute() {
-               $dbw = wfGetDB( DB_MASTER );
-
-               // Load the current value from the master
-               $count = $dbw->selectField( 'site_stats', 'ss_images' );
-
-               $this->output( wfWikiID() . ": forcing ss_images to $count\n" );
-
-               // First set to NULL so that it changes on the master
-               $dbw->update( 'site_stats',
-                       array( 'ss_images' => null ),
-                       array( 'ss_row_id' => 1 ) );
-
-               // Now this update will be forced to go out
-               $dbw->update( 'site_stats',
-                       array( 'ss_images' => $count ),
-                       array( 'ss_row_id' => 1 ) );
-                       }
-}
-
-$maintClass = "RefreshImageCount";
-require_once( RUN_MAINTENANCE_IF_MAIN );
-