From 2d03f525986140270e6b4ed01be5cd94983c4688 Mon Sep 17 00:00:00 2001
From: Tim Starling
Date: Wed, 7 Jun 2006 04:17:51 +0000
Subject: [PATCH] removed obsolete function
---
includes/Database.php | 102 --------------------------------------
includes/LoadBalancer.php | 2 +-
2 files changed, 1 insertion(+), 103 deletions(-)
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 = "
-
-
-";
- $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 ) {
--
2.20.1