From d560eb0b3eccde3ec6ae30dcf91bec3eb694d8d6 Mon Sep 17 00:00:00 2001 From: Reedy Date: Mon, 29 Apr 2013 19:19:13 +0100 Subject: [PATCH] Revert "Commit of various live hacks" This reverts commit c6af934ae65b8c7dbd878a376f9e46dc28bff941. Change-Id: I3e863bb632531d7cd4ec0614325a7c4a7ba9aa3d --- includes/DefaultSettings.php | 6 ++---- includes/MessageBlobStore.php | 3 --- includes/cache/SquidUpdate.php | 17 +---------------- includes/db/DatabaseMysql.php | 4 ++-- includes/job/jobs/HTMLCacheUpdateJob.php | 5 +---- maintenance/tables.sql | 6 +++--- 6 files changed, 9 insertions(+), 32 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 6dec645bd3..c19808118b 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -185,8 +185,7 @@ $wgLoadScript = false; * @since 1.3 */ $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. @@ -4121,11 +4120,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 3f320913aa..8a8142b7e3 100644 --- a/includes/MessageBlobStore.php +++ b/includes/MessageBlobStore.php @@ -241,9 +241,6 @@ class MessageBlobStore { } public static function clear() { - // HACK: disable clear() on WMF servers - return; - // TODO: Give this some more thought // TODO: Is TRUNCATE better? try { diff --git a/includes/cache/SquidUpdate.php b/includes/cache/SquidUpdate.php index e9ccfcb84a..dd7180173a 100644 --- a/includes/cache/SquidUpdate.php +++ b/includes/cache/SquidUpdate.php @@ -205,25 +205,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 e02b034fe7..4105ee1ad6 100644 --- a/includes/db/DatabaseMysql.php +++ b/includes/db/DatabaseMysql.php @@ -153,11 +153,11 @@ class DatabaseMysql extends DatabaseBase { // Tell the server we're communicating with it in UTF-8. // This may engage various charset conversions. - /*if ( $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 if ( is_string( $wgSQLMode ) ) { $mode = $this->addQuotes( $wgSQLMode ); diff --git a/includes/job/jobs/HTMLCacheUpdateJob.php b/includes/job/jobs/HTMLCacheUpdateJob.php index a68d8b6908..44c240bb30 100644 --- a/includes/job/jobs/HTMLCacheUpdateJob.php +++ b/includes/job/jobs/HTMLCacheUpdateJob.php @@ -245,12 +245,9 @@ class HTMLCacheUpdateJob extends Job { array( 'page_id' => $batch ) + $touchedCond, __METHOD__ ); - # WM patch: throttle to avoid apache CPU exhaustion -- TS - if ( php_sapi_name() == 'cli' ) { - sleep( 1 ); - } } + # Update squid if ( $wgUseSquid ) { $u = SquidUpdate::newFromTitles( $titleArray ); $u->doUpdate(); diff --git a/maintenance/tables.sql b/maintenance/tables.sql index a66b8ca867..19c740b50e 100644 --- a/maintenance/tables.sql +++ b/maintenance/tables.sql @@ -1131,9 +1131,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