Index: trunk/phase3/includes/db/DatabaseMysql.php |
— | — | @@ -95,7 +95,9 @@ |
96 | 96 | wfProfileOut("dbconnect-$server"); |
97 | 97 | |
98 | 98 | if ( $dbName != '' && $this->mConn !== false ) { |
99 | | - $success = @/**/mysql_select_db( $dbName, $this->mConn ); |
| 99 | + wfSuppressWarnings(); |
| 100 | + $success = mysql_select_db( $dbName, $this->mConn ); |
| 101 | + wfRestoreWarnings(); |
100 | 102 | if ( !$success ) { |
101 | 103 | $error = "Error selecting database $dbName on server {$this->mServer} " . |
102 | 104 | "from client host " . wfHostname() . "\n"; |
— | — | @@ -152,7 +154,10 @@ |
153 | 155 | if ( $res instanceof ResultWrapper ) { |
154 | 156 | $res = $res->result; |
155 | 157 | } |
156 | | - if ( !@/**/mysql_free_result( $res ) ) { |
| 158 | + wfSuppressWarnings(); |
| 159 | + $ok = mysql_free_result( $res ); |
| 160 | + wfRestoreWarnings(); |
| 161 | + if ( !$ok ) { |
157 | 162 | throw new DBUnexpectedError( $this, "Unable to free MySQL result" ); |
158 | 163 | } |
159 | 164 | } |
— | — | @@ -161,7 +166,9 @@ |
162 | 167 | if ( $res instanceof ResultWrapper ) { |
163 | 168 | $res = $res->result; |
164 | 169 | } |
165 | | - @/**/$row = mysql_fetch_object( $res ); |
| 170 | + wfSuppressWarnings(); |
| 171 | + $row = mysql_fetch_object( $res ); |
| 172 | + wfRestoreWarnings(); |
166 | 173 | if( $this->lastErrno() ) { |
167 | 174 | throw new DBUnexpectedError( $this, 'Error in fetchObject(): ' . htmlspecialchars( $this->lastError() ) ); |
168 | 175 | } |
— | — | @@ -172,7 +179,9 @@ |
173 | 180 | if ( $res instanceof ResultWrapper ) { |
174 | 181 | $res = $res->result; |
175 | 182 | } |
176 | | - @/**/$row = mysql_fetch_array( $res ); |
| 183 | + wfSuppressWarnings(); |
| 184 | + $row = mysql_fetch_array( $res ); |
| 185 | + wfRestoreWarnings(); |
177 | 186 | if ( $this->lastErrno() ) { |
178 | 187 | throw new DBUnexpectedError( $this, 'Error in fetchRow(): ' . htmlspecialchars( $this->lastError() ) ); |
179 | 188 | } |
— | — | @@ -183,7 +192,9 @@ |
184 | 193 | if ( $res instanceof ResultWrapper ) { |
185 | 194 | $res = $res->result; |
186 | 195 | } |
187 | | - @/**/$n = mysql_num_rows( $res ); |
| 196 | + wfSuppressWarnings(); |
| 197 | + $n = mysql_num_rows( $res ); |
| 198 | + wfRestoreWarnings(); |
188 | 199 | if( $this->lastErrno() ) { |
189 | 200 | throw new DBUnexpectedError( $this, 'Error in numRows(): ' . htmlspecialchars( $this->lastError() ) ); |
190 | 201 | } |
Index: trunk/phase3/includes/db/DatabasePostgres.php |
— | — | @@ -263,7 +263,10 @@ |
264 | 264 | if ( $res instanceof ResultWrapper ) { |
265 | 265 | $res = $res->result; |
266 | 266 | } |
267 | | - if ( !@pg_free_result( $res ) ) { |
| 267 | + wfSuppressWarnings(); |
| 268 | + $ok = pg_free_result( $res ); |
| 269 | + wfRestoreWarnings(); |
| 270 | + if ( !$ok ) { |
268 | 271 | throw new DBUnexpectedError( $this, "Unable to free Postgres result\n" ); |
269 | 272 | } |
270 | 273 | } |
— | — | @@ -272,7 +275,9 @@ |
273 | 276 | if ( $res instanceof ResultWrapper ) { |
274 | 277 | $res = $res->result; |
275 | 278 | } |
276 | | - @$row = pg_fetch_object( $res ); |
| 279 | + wfSuppressWarnings(); |
| 280 | + $row = pg_fetch_object( $res ); |
| 281 | + wfRestoreWarnings(); |
277 | 282 | # @todo FIXME: HACK HACK HACK HACK debug |
278 | 283 | |
279 | 284 | # @todo hashar: not sure if the following test really trigger if the object |
— | — | @@ -287,7 +292,9 @@ |
288 | 293 | if ( $res instanceof ResultWrapper ) { |
289 | 294 | $res = $res->result; |
290 | 295 | } |
291 | | - @$row = pg_fetch_array( $res ); |
| 296 | + wfSuppressWarnings(); |
| 297 | + $row = pg_fetch_array( $res ); |
| 298 | + wfRestoreWarnings(); |
292 | 299 | if( pg_last_error( $this->mConn ) ) { |
293 | 300 | throw new DBUnexpectedError( $this, 'SQL error: ' . htmlspecialchars( pg_last_error( $this->mConn ) ) ); |
294 | 301 | } |
— | — | @@ -298,7 +305,9 @@ |
299 | 306 | if ( $res instanceof ResultWrapper ) { |
300 | 307 | $res = $res->result; |
301 | 308 | } |
302 | | - @$n = pg_num_rows( $res ); |
| 309 | + wfSuppressWarnings(); |
| 310 | + $n = pg_num_rows( $res ); |
| 311 | + wfRestoreWarnings(); |
303 | 312 | if( pg_last_error( $this->mConn ) ) { |
304 | 313 | throw new DBUnexpectedError( $this, 'SQL error: ' . htmlspecialchars( pg_last_error( $this->mConn ) ) ); |
305 | 314 | } |
Index: trunk/phase3/includes/db/DatabaseError.php |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | * @param $error String A simple error message to be used for debugging |
19 | 19 | */ |
20 | 20 | function __construct( DatabaseBase &$db, $error ) { |
21 | | - $this->db =& $db; |
| 21 | + $this->db = $db; |
22 | 22 | parent::__construct( $error ); |
23 | 23 | } |
24 | 24 | |
— | — | @@ -178,13 +178,13 @@ |
179 | 179 | * @return string |
180 | 180 | */ |
181 | 181 | function searchForm() { |
182 | | - global $wgSitename, $wgServer; |
| 182 | + global $wgSitename, $wgServer, $wgRequest; |
183 | 183 | |
184 | 184 | $usegoogle = htmlspecialchars( $this->msg( 'dberr-usegoogle', 'You can try searching via Google in the meantime.' ) ); |
185 | 185 | $outofdate = htmlspecialchars( $this->msg( 'dberr-outofdate', 'Note that their indexes of our content may be out of date.' ) ); |
186 | 186 | $googlesearch = htmlspecialchars( $this->msg( 'searchbutton', 'Search' ) ); |
187 | 187 | |
188 | | - $search = htmlspecialchars( @$_REQUEST['search'] ); |
| 188 | + $search = htmlspecialchars( $wgRequest->getVal( 'search' ) ); |
189 | 189 | |
190 | 190 | $server = htmlspecialchars( $wgServer ); |
191 | 191 | $sitename = htmlspecialchars( $wgSitename ); |
Index: trunk/phase3/includes/db/DatabaseIbm_db2.php |
— | — | @@ -379,7 +379,9 @@ |
380 | 380 | * Opens a cataloged database connection, sets mConn |
381 | 381 | */ |
382 | 382 | protected function openCataloged( $dbName, $user, $password ) { |
383 | | - @$this->mConn = db2_pconnect( $dbName, $user, $password ); |
| 383 | + wfSuppressWarnings(); |
| 384 | + $this->mConn = db2_pconnect( $dbName, $user, $password ); |
| 385 | + wfRestoreWarnings(); |
384 | 386 | } |
385 | 387 | |
386 | 388 | /** |
— | — | @@ -388,7 +390,9 @@ |
389 | 391 | protected function openUncataloged( $dbName, $user, $password, $server, $port ) |
390 | 392 | { |
391 | 393 | $dsn = "DRIVER={IBM DB2 ODBC DRIVER};DATABASE=$dbName;CHARSET=UTF-8;HOSTNAME=$server;PORT=$port;PROTOCOL=TCPIP;UID=$user;PWD=$password;"; |
392 | | - @$this->mConn = db2_pconnect($dsn, "", "", array()); |
| 394 | + wfSuppressWarnings(); |
| 395 | + $this->mConn = db2_pconnect($dsn, "", "", array()); |
| 396 | + wfRestoreWarnings(); |
393 | 397 | } |
394 | 398 | |
395 | 399 | /** |
— | — | @@ -501,7 +505,7 @@ |
502 | 506 | } |
503 | 507 | |
504 | 508 | // If the table exists, there should be one of it |
505 | | - @$row = $this->fetchRow( $res ); |
| 509 | + $row = $this->fetchRow( $res ); |
506 | 510 | $count = $row[0]; |
507 | 511 | if ( $count == '1' || $count == 1 ) { |
508 | 512 | return true; |
— | — | @@ -523,7 +527,9 @@ |
524 | 528 | if ( $res instanceof ResultWrapper ) { |
525 | 529 | $res = $res->result; |
526 | 530 | } |
527 | | - @$row = db2_fetch_object( $res ); |
| 531 | + wfSuppressWarnings(); |
| 532 | + $row = db2_fetch_object( $res ); |
| 533 | + wfRestoreWarnings(); |
528 | 534 | if( $this->lastErrno() ) { |
529 | 535 | throw new DBUnexpectedError( $this, 'Error in fetchObject(): ' |
530 | 536 | . htmlspecialchars( $this->lastError() ) ); |
— | — | @@ -544,7 +550,9 @@ |
545 | 551 | $res = $res->result; |
546 | 552 | } |
547 | 553 | if ( db2_num_rows( $res ) > 0) { |
548 | | - @$row = db2_fetch_array( $res ); |
| 554 | + wfSuppressWarnings(); |
| 555 | + $row = db2_fetch_array( $res ); |
| 556 | + wfRestoreWarnings(); |
549 | 557 | if ( $this->lastErrno() ) { |
550 | 558 | throw new DBUnexpectedError( $this, 'Error in fetchRow(): ' |
551 | 559 | . htmlspecialchars( $this->lastError() ) ); |
— | — | @@ -1072,7 +1080,10 @@ |
1073 | 1081 | if ( $res instanceof ResultWrapper ) { |
1074 | 1082 | $res = $res->result; |
1075 | 1083 | } |
1076 | | - if ( !@db2_free_result( $res ) ) { |
| 1084 | + wfSuppressWarnings(); |
| 1085 | + $ok = db2_free_result( $res ); |
| 1086 | + wfRestoreWarnings(); |
| 1087 | + if ( !$ok ) { |
1077 | 1088 | throw new DBUnexpectedError( $this, "Unable to free DB2 result\n" ); |
1078 | 1089 | } |
1079 | 1090 | } |
Index: trunk/phase3/includes/db/Database.php |
— | — | @@ -1877,9 +1877,9 @@ |
1878 | 1878 | # the correct table. |
1879 | 1879 | $dbDetails = array_reverse( explode( '.', $name, 2 ) ); |
1880 | 1880 | if ( isset( $dbDetails[1] ) ) { |
1881 | | - @list( $table, $database ) = $dbDetails; |
| 1881 | + list( $table, $database ) = $dbDetails; |
1882 | 1882 | } else { |
1883 | | - @list( $table ) = $dbDetails; |
| 1883 | + list( $table ) = $dbDetails; |
1884 | 1884 | } |
1885 | 1885 | $prefix = $this->mTablePrefix; # Default prefix |
1886 | 1886 | |