From c9047274d551357010fd628ff45f95bc9a9dd03f Mon Sep 17 00:00:00 2001 From: Catrope Date: Mon, 30 Apr 2012 20:57:56 +0000 Subject: [PATCH] Revert "Commit of various live hacks" Was meant for 1.20wmf2 This reverts commit 062773733d6c97a5b05098712ffc64fc7fc491f7 --- includes/DefaultSettings.php | 6 ++---- includes/MessageBlobStore.php | 3 --- includes/cache/HTMLCacheUpdate.php | 8 +------- includes/cache/SquidUpdate.php | 17 +---------------- includes/db/DatabaseMysql.php | 4 ++-- maintenance/tables.sql | 6 +++--- 6 files changed, 9 insertions(+), 35 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index bfac3897a2..9801e04ed1 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -157,8 +157,7 @@ $wgLoadScript = false; * The URL path of the skins directory. Will default to "{$wgScriptPath}/skins" in Setup.php */ $wgStylePath = false; -# Broken PHP, canary mismatch -- TS -#$wgStyleSheetPath = &$wgStylePath; +$wgStyleSheetPath = &$wgStylePath; /** * The URL path of the skins directory. Should not point to an external domain. @@ -3734,11 +3733,10 @@ $wgAutoConfirmCount = 0; * user who has provided an e-mail address. */ $wgAutopromote = array( - /* test patch -- TS 'autoconfirmed' => array( '&', array( APCOND_EDITCOUNT, &$wgAutoConfirmCount ), array( APCOND_AGE, &$wgAutoConfirmAge ), - ), */ + ), ); /** diff --git a/includes/MessageBlobStore.php b/includes/MessageBlobStore.php index 255e9a79e9..be6b27c9ef 100644 --- a/includes/MessageBlobStore.php +++ b/includes/MessageBlobStore.php @@ -228,9 +228,6 @@ class MessageBlobStore { } public static function clear() { - // HACK: disable clear() on WMF servers - return; - // TODO: Give this some more thought // TODO: Is TRUNCATE better? $dbw = wfGetDB( DB_MASTER ); diff --git a/includes/cache/HTMLCacheUpdate.php b/includes/cache/HTMLCacheUpdate.php index 029f67af91..11e2ae740b 100644 --- a/includes/cache/HTMLCacheUpdate.php +++ b/includes/cache/HTMLCacheUpdate.php @@ -191,19 +191,13 @@ class HTMLCacheUpdate implements DeferrableUpdate { array( 'page_id' => $batch ), __METHOD__ ); - # WM patch: throttle to avoid apache CPU exhaustion -- TS - if ( php_sapi_name() == 'cli' ) { - sleep( 1 ); - } } # Update squid - # Disable this as a temporary measure per private-l post -- TS - /* if ( $wgUseSquid ) { $u = SquidUpdate::newFromTitles( $titleArray ); $u->doUpdate(); - } */ + } # Update file cache if ( $wgUseFileCache ) { diff --git a/includes/cache/SquidUpdate.php b/includes/cache/SquidUpdate.php index b343b0a681..e560e0e7db 100644 --- a/includes/cache/SquidUpdate.php +++ b/includes/cache/SquidUpdate.php @@ -185,25 +185,10 @@ class SquidUpdate { throw new MWException( "Invalid HTCP rule for URL $url\n" ); } - // Try and incremement value in APC cache - $id = apc_inc( 'squidhtcppurge' ); - if ( $id === false ) { - // If false, means it didn't work - // Chances are that means it isn't in the cache - // Start saving a cached value - $add = apc_add( 'squidhtcppurge', 1 ); - if ( $add === false ) { - wfDebugLog( 'htcp', 'Unable to set value to APC cache' ); - $id = 0; - } else { - $id = $add; - } - } - // Construct a minimal HTCP request diagram // as per RFC 2756 // Opcode 'CLR', no response desired, no auth - $htcpTransID = $id; + $htcpTransID = rand(); $htcpSpecifier = pack( 'na4na*na8n', 4, 'HEAD', strlen( $url ), $url, diff --git a/includes/db/DatabaseMysql.php b/includes/db/DatabaseMysql.php index e7c73684d7..c334c388d8 100644 --- a/includes/db/DatabaseMysql.php +++ b/includes/db/DatabaseMysql.php @@ -143,12 +143,12 @@ class DatabaseMysql extends DatabaseBase { if ( $success ) { // Tell the server we're communicating with it in UTF-8. // This may engage various charset conversions. - /*global $wgDBmysql5; + global $wgDBmysql5; if( $wgDBmysql5 ) { $this->query( 'SET NAMES utf8', __METHOD__ ); } else { $this->query( 'SET NAMES binary', __METHOD__ ); - }*/ + } // Set SQL mode, default is turning them all off, can be overridden or skipped with null global $wgSQLMode; if ( is_string( $wgSQLMode ) ) { diff --git a/maintenance/tables.sql b/maintenance/tables.sql index 34eba56e24..a848bf5eb4 100644 --- a/maintenance/tables.sql +++ b/maintenance/tables.sql @@ -1121,9 +1121,9 @@ CREATE TABLE /*_*/searchindex ( si_text mediumtext NOT NULL ) ENGINE=MyISAM; --- CREATE UNIQUE INDEX /*i*/si_page ON /*_*/searchindex (si_page); --- CREATE FULLTEXT INDEX /*i*/si_title ON /*_*/searchindex (si_title); --- CREATE FULLTEXT INDEX /*i*/si_text ON /*_*/searchindex (si_text); +CREATE UNIQUE INDEX /*i*/si_page ON /*_*/searchindex (si_page); +CREATE FULLTEXT INDEX /*i*/si_title ON /*_*/searchindex (si_title); +CREATE FULLTEXT INDEX /*i*/si_text ON /*_*/searchindex (si_text); -- -- 2.20.1