Index: trunk/phase3/includes/db/DatabasePostgres.php |
— | — | @@ -103,7 +103,6 @@ |
104 | 104 | function __construct( $server = false, $user = false, $password = false, $dbName = false, |
105 | 105 | $failFunction = false, $flags = 0 ) |
106 | 106 | { |
107 | | - $this->mFailFunction = $failFunction; |
108 | 107 | $this->mFlags = $flags; |
109 | 108 | $this->open( $server, $user, $password, $dbName ); |
110 | 109 | } |
— | — | @@ -192,11 +191,7 @@ |
193 | 192 | wfDebug( "DB connection error\n" ); |
194 | 193 | wfDebug( "Server: $server, Database: $dbName, User: $user, Password: " . substr( $password, 0, 3 ) . "...\n" ); |
195 | 194 | wfDebug( $this->lastError() . "\n" ); |
196 | | - if ( !$this->mFailFunction ) { |
197 | | - throw new DBConnectionError( $this, $phpError ); |
198 | | - } else { |
199 | | - return false; |
200 | | - } |
| 195 | + throw new DBConnectionError( $this, $phpError ); |
201 | 196 | } |
202 | 197 | |
203 | 198 | $this->mOpened = true; |
Index: trunk/phase3/includes/db/DatabaseIbm_db2.php |
— | — | @@ -273,7 +273,6 @@ |
274 | 274 | $wgOut = null; |
275 | 275 | } |
276 | 276 | $this->mOut =& $wgOut; |
277 | | - $this->mFailFunction = $failFunction; |
278 | 277 | $this->mFlags = DBO_TRX | $flags; |
279 | 278 | |
280 | 279 | if ( $schema == self::USE_GLOBAL ) { |
Index: trunk/phase3/includes/db/Database.php |
— | — | @@ -236,14 +236,6 @@ |
237 | 237 | } |
238 | 238 | |
239 | 239 | /** |
240 | | - * Fail function, takes a Database as a parameter |
241 | | - * Set to false for default, 1 for ignore errors |
242 | | - */ |
243 | | - function failFunction( $function = null ) { |
244 | | - return wfSetVar( $this->mFailFunction, $function ); |
245 | | - } |
246 | | - |
247 | | - /** |
248 | 240 | * Boolean, controls output of large amounts of debug information |
249 | 241 | */ |
250 | 242 | function debug( $debug = null ) { |
— | — | @@ -500,8 +492,6 @@ |
501 | 493 | if ( !isset( $wgOut ) ) { |
502 | 494 | $wgOut = null; |
503 | 495 | } |
504 | | - |
505 | | - $this->mFailFunction = $failFunction; |
506 | 496 | $this->mFlags = $flags; |
507 | 497 | |
508 | 498 | if ( $this->mFlags & DBO_DEFAULT ) { |
— | — | @@ -589,16 +579,8 @@ |
590 | 580 | $error = $myError; |
591 | 581 | } |
592 | 582 | |
593 | | - if ( $this->mFailFunction ) { |
594 | | - # Legacy error handling method |
595 | | - if ( !is_int( $this->mFailFunction ) ) { |
596 | | - $ff = $this->mFailFunction; |
597 | | - $ff( $this, $error ); |
598 | | - } |
599 | | - } else { |
600 | | - # New method |
601 | | - throw new DBConnectionError( $this, $error ); |
602 | | - } |
| 583 | + # New method |
| 584 | + throw new DBConnectionError( $this, $error ); |
603 | 585 | } |
604 | 586 | |
605 | 587 | /** |
Index: trunk/phase3/includes/db/DatabaseMssql.php |
— | — | @@ -20,10 +20,8 @@ |
21 | 21 | function __construct( $server = false, $user = false, $password = false, $dbName = false, |
22 | 22 | $failFunction = false, $flags = 0 ) |
23 | 23 | { |
24 | | - $this->mFailFunction = $failFunction; |
25 | 24 | $this->mFlags = $flags; |
26 | 25 | $this->open( $server, $user, $password, $dbName ); |
27 | | - |
28 | 26 | } |
29 | 27 | |
30 | 28 | function cascadingDeletes() { |
Index: trunk/phase3/includes/db/DatabaseSqlite.php |
— | — | @@ -25,7 +25,6 @@ |
26 | 26 | */ |
27 | 27 | function __construct( $server = false, $user = false, $password = false, $dbName = false, $failFunction = false, $flags = 0 ) { |
28 | 28 | global $wgSharedDB; |
29 | | - $this->mFailFunction = $failFunction; |
30 | 29 | $this->mFlags = $flags; |
31 | 30 | $this->mName = $dbName; |
32 | 31 | |
— | — | @@ -80,12 +79,7 @@ |
81 | 80 | } |
82 | 81 | if ( !$this->mConn ) { |
83 | 82 | wfDebug( "DB connection error: $err\n" ); |
84 | | - if ( !$this->mFailFunction ) { |
85 | | - throw new DBConnectionError( $this, $err ); |
86 | | - } else { |
87 | | - return false; |
88 | | - } |
89 | | - |
| 83 | + throw new DBConnectionError( $this, $err ); |
90 | 84 | } |
91 | 85 | $this->mOpened = !!$this->mConn; |
92 | 86 | # set error codes only, don't raise exceptions |
Index: trunk/phase3/includes/db/LoadBalancer.php |
— | — | @@ -35,11 +35,6 @@ |
36 | 36 | } |
37 | 37 | $this->mServers = $params['servers']; |
38 | 38 | |
39 | | - if ( isset( $params['failFunction'] ) ) { |
40 | | - $this->mFailFunction = $params['failFunction']; |
41 | | - } else { |
42 | | - $this->mFailFunction = false; |
43 | | - } |
44 | 39 | if ( isset( $params['waitTimeout'] ) ) { |
45 | 40 | $this->mWaitTimeout = $params['waitTimeout']; |
46 | 41 | } else { |
— | — | @@ -671,19 +666,9 @@ |
672 | 667 | // No last connection, probably due to all servers being too busy |
673 | 668 | wfLogDBError( "LB failure with no last connection\n" ); |
674 | 669 | $conn = new Database; |
675 | | - if ( $this->mFailFunction ) { |
676 | | - $conn->failFunction( $this->mFailFunction ); |
677 | | - $conn->reportConnectionError( $this->mLastError ); |
678 | | - } else { |
679 | | - // If all servers were busy, mLastError will contain something sensible |
680 | | - throw new DBConnectionError( $conn, $this->mLastError ); |
681 | | - } |
| 670 | + // If all servers were busy, mLastError will contain something sensible |
| 671 | + throw new DBConnectionError( $conn, $this->mLastError ); |
682 | 672 | } else { |
683 | | - if ( $this->mFailFunction ) { |
684 | | - $conn->failFunction( $this->mFailFunction ); |
685 | | - } else { |
686 | | - $conn->failFunction( false ); |
687 | | - } |
688 | 673 | $server = $conn->getProperty( 'mServer' ); |
689 | 674 | wfLogDBError( "Connection error: {$this->mLastError} ({$server})\n" ); |
690 | 675 | $conn->reportConnectionError( "{$this->mLastError} ({$server})" ); |