From: Tim Starling Date: Wed, 7 Jun 2006 04:17:51 +0000 (+0000) Subject: removed obsolete function X-Git-Tag: 1.31.0-rc.0~56854 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=2d03f525986140270e6b4ed01be5cd94983c4688;p=lhc%2Fweb%2Fwiklou.git removed obsolete function --- diff --git a/includes/Database.php b/includes/Database.php index 173bc712bd..33aaee1720 100644 --- a/includes/Database.php +++ b/includes/Database.php @@ -2013,106 +2013,4 @@ class ResultWrapper { } - -#------------------------------------------------------------------------------ -# Global functions -#------------------------------------------------------------------------------ - -/** - * Standard fail function, called by default when a connection cannot be - * established. - * Displays the file cache if possible - */ -function wfEmergencyAbort( &$conn, $error ) { - global $wgTitle, $wgUseFileCache, $title, $wgInputEncoding, $wgOutputEncoding; - global $wgSitename, $wgServer, $wgMessageCache, $wgLogo; - - # I give up, Brion is right. Getting the message cache to work when there is no DB is tricky. - # Hard coding strings instead. - - $noconnect = "

$wgSitename has a problem

Sorry! This site is experiencing technical difficulties.

Try waiting a few minutes and reloading.

(Can't contact the database server: $1)

"; - $mainpage = 'Main Page'; - $searchdisabled = <<$wgSitename search is disabled for performance reasons. You can search via Google in the meantime. -Note that their indexes of $wgSitename content may be out of date.

', -EOT; - - $googlesearch = " - -
- -
- -\"Google\" - - - - -
WWW $wgServer
- - -
-
-
-"; - $cachederror = "The following is a cached copy of the requested page, and may not be up to date. "; - - - if( !headers_sent() ) { - header( 'HTTP/1.0 500 Internal Server Error' ); - header( 'Content-type: text/html; charset='.$wgOutputEncoding ); - /* Don't cache error pages! They cause no end of trouble... */ - header( 'Cache-control: none' ); - header( 'Pragma: nocache' ); - } - - # No database access - if ( is_object( $wgMessageCache ) ) { - $wgMessageCache->disable(); - } - - if ( trim( $error ) == '' ) { - $error = $this->mServer; - } - - wfLogDBError( "Connection error: $error\n" ); - - $text = str_replace( '$1', $error, $noconnect ); - $text .= wfGetSiteNotice(); - - if($wgUseFileCache) { - if($wgTitle) { - $t =& $wgTitle; - } else { - if($title) { - $t = Title::newFromURL( $title ); - } elseif (@/**/$_REQUEST['search']) { - $search = $_REQUEST['search']; - echo $searchdisabled; - echo str_replace( array( '$1', '$2' ), array( htmlspecialchars( $search ), - $wgInputEncoding ), $googlesearch ); - wfErrorExit(); - } else { - $t = Title::newFromText( $mainpage ); - } - } - - $cache = new CacheManager( $t ); - if( $cache->isFileCached() ) { - $msg = '

'.$msg."
\n" . - $cachederror . "

\n"; - - $tag = '
'; - $text = str_replace( - $tag, - $tag . $msg, - $cache->fetchPageText() ); - } - } - - echo $text; - wfErrorExit(); -} - ?> diff --git a/includes/LoadBalancer.php b/includes/LoadBalancer.php index dada8d44fa..f985a7b447 100644 --- a/includes/LoadBalancer.php +++ b/includes/LoadBalancer.php @@ -469,7 +469,7 @@ class LoadBalancer { $conn->reportConnectionError( $this->mLastError ); } else { // If all servers were busy, mLastError will contain something sensible - wfEmergencyAbort( $conn, $this->mLastError ); + throw new DBConnectionError( $conn, $this->mLastError ); } } else { if ( $this->mFailFunction ) {