From d81f562b712f2387fa02290bf2ca86392ab356f2 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 11 Oct 2006 20:21:25 +0000 Subject: Aktualisierung auf Version 1.8.1 --- includes/Wiki.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'includes/Wiki.php') diff --git a/includes/Wiki.php b/includes/Wiki.php index 6f010003..401756be 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -170,6 +170,12 @@ class MediaWiki { * @return Article */ function articleFromTitle( $title ) { + $article = null; + wfRunHooks('ArticleFromTitle', array( &$title, &$article ) ); + if ( $article ) { + return $article; + } + if( NS_MEDIA == $title->getNamespace() ) { // FIXME: where should this go? $title = Title::makeTitle( NS_IMAGE, $title->getDBkey() ); @@ -258,8 +264,14 @@ class MediaWiki { */ function doUpdates ( &$updates ) { wfProfileIn( 'MediaWiki::doUpdates' ); + $dbw =& wfGetDB( DB_MASTER ); foreach( $updates as $up ) { $up->doUpdate(); + + # Commit after every update to prevent lock contention + if ( $dbw->trxLevel() ) { + $dbw->commit(); + } } wfProfileOut( 'MediaWiki::doUpdates' ); } @@ -270,7 +282,7 @@ class MediaWiki { function doJobs() { global $wgJobRunRate; - if ( $wgJobRunRate <= 0 ) { + if ( $wgJobRunRate <= 0 || wfReadOnly() ) { return; } if ( $wgJobRunRate < 1 ) { @@ -302,8 +314,7 @@ class MediaWiki { * Ends this task peacefully */ function restInPeace ( &$loadBalancer ) { - wfProfileClose(); - logProfilingData(); + wfLogProfilingData(); $loadBalancer->closeAll(); wfDebug( "Request ended normally\n" ); } -- cgit v1.2.3-54-g00ecf