Index: branches/REL1_17/phase3/includes/db/DatabaseOracle.php |
— | — | @@ -182,7 +182,7 @@ |
183 | 183 | { |
184 | 184 | $tablePrefix = $tablePrefix == 'get from global' ? $tablePrefix : strtoupper( $tablePrefix ); |
185 | 185 | parent::__construct( $server, $user, $password, $dbName, $flags, $tablePrefix ); |
186 | | - wfRunHooks( 'DatabaseOraclePostInit', array( &$this ) ); |
| 186 | + wfRunHooks( 'DatabaseOraclePostInit', array( $this ) ); |
187 | 187 | } |
188 | 188 | |
189 | 189 | function getType() { |
Index: branches/REL1_17/phase3/includes/db/DatabasePostgres.php |
— | — | @@ -100,13 +100,6 @@ |
101 | 101 | var $numeric_version = null; |
102 | 102 | var $mAffectedRows = null; |
103 | 103 | |
104 | | - function __construct( $server = false, $user = false, $password = false, $dbName = false, |
105 | | - $flags = 0 ) |
106 | | - { |
107 | | - $this->mFlags = $flags; |
108 | | - $this->open( $server, $user, $password, $dbName ); |
109 | | - } |
110 | | - |
111 | 104 | function getType() { |
112 | 105 | return 'postgres'; |
113 | 106 | } |
Index: branches/REL1_17/phase3/includes/db/DatabaseIbm_db2.php |
— | — | @@ -245,11 +245,6 @@ |
246 | 246 | return 'ibm_db2'; |
247 | 247 | } |
248 | 248 | |
249 | | - ###################################### |
250 | | - # Setup |
251 | | - ###################################### |
252 | | - |
253 | | - |
254 | 249 | /** |
255 | 250 | * |
256 | 251 | * @param $server String: hostname of database server |
— | — | @@ -259,20 +254,13 @@ |
260 | 255 | * @param $flags Integer: database behaviour flags (optional, unused) |
261 | 256 | * @param $schema String |
262 | 257 | */ |
263 | | - public function DatabaseIbm_db2( $server = false, $user = false, |
| 258 | + public function __construct( $server = false, $user = false, |
264 | 259 | $password = false, |
265 | 260 | $dbName = false, $flags = 0, |
266 | 261 | $schema = self::USE_GLOBAL ) |
267 | 262 | { |
| 263 | + global $wgDBmwschema; |
268 | 264 | |
269 | | - global $wgOut, $wgDBmwschema; |
270 | | - # Can't get a reference if it hasn't been set yet |
271 | | - if ( !isset( $wgOut ) ) { |
272 | | - $wgOut = null; |
273 | | - } |
274 | | - $this->mOut =& $wgOut; |
275 | | - $this->mFlags = DBO_TRX | $flags; |
276 | | - |
277 | 265 | if ( $schema == self::USE_GLOBAL ) { |
278 | 266 | $this->mSchema = $wgDBmwschema; |
279 | 267 | } else { |
— | — | @@ -287,7 +275,7 @@ |
288 | 276 | $this->setDB2Option( 'rowcount', 'DB2_ROWCOUNT_PREFETCH_ON', |
289 | 277 | self::STMT_OPTION ); |
290 | 278 | |
291 | | - $this->open( $server, $user, $password, $dbName ); |
| 279 | + parent::__construct( $server, $user, $password, $dbName, DBO_TRX | $flags ); |
292 | 280 | } |
293 | 281 | |
294 | 282 | /** |
— | — | @@ -351,6 +339,7 @@ |
352 | 340 | } |
353 | 341 | |
354 | 342 | if ( strlen( $user ) < 1 ) { |
| 343 | + wfProfileOut( __METHOD__ ); |
355 | 344 | return null; |
356 | 345 | } |
357 | 346 | |
— | — | @@ -378,6 +367,7 @@ |
379 | 368 | "Server: $server, Database: $dbName, User: $user, Password: " |
380 | 369 | . substr( $password, 0, 3 ) . "...\n" ); |
381 | 370 | $this->installPrint( $this->lastError() . "\n" ); |
| 371 | + wfProfileOut( __METHOD__ ); |
382 | 372 | return null; |
383 | 373 | } |
384 | 374 | |
Index: branches/REL1_17/phase3/includes/db/DatabaseMssql.php |
— | — | @@ -17,13 +17,6 @@ |
18 | 18 | var $mLastResult = NULL; |
19 | 19 | var $mAffectedRows = NULL; |
20 | 20 | |
21 | | - function __construct( $server = false, $user = false, $password = false, $dbName = false, |
22 | | - $flags = 0 ) |
23 | | - { |
24 | | - $this->mFlags = $flags; |
25 | | - $this->open( $server, $user, $password, $dbName ); |
26 | | - } |
27 | | - |
28 | 21 | function cascadingDeletes() { |
29 | 22 | return true; |
30 | 23 | } |
Index: branches/REL1_17/phase3/includes/db/DatabaseSqlite.php |
— | — | @@ -24,12 +24,14 @@ |
25 | 25 | * Parameters $server, $user and $password are not used. |
26 | 26 | */ |
27 | 27 | function __construct( $server = false, $user = false, $password = false, $dbName = false, $flags = 0 ) { |
28 | | - global $wgSharedDB; |
29 | | - $this->mFlags = $flags; |
30 | 28 | $this->mName = $dbName; |
31 | | - |
32 | | - if ( $this->open( $server, $user, $password, $dbName ) && $wgSharedDB ) { |
33 | | - $this->attachDatabase( $wgSharedDB ); |
| 29 | + parent::__construct( $server, $user, $password, $dbName, $flags ); |
| 30 | + // parent doesn't open when $user is false, but we can work with $dbName |
| 31 | + if( !$user && $dbName ) { |
| 32 | + global $wgSharedDB; |
| 33 | + if( $this->open( $server, $user, $password, $dbName ) && $wgSharedDB ) { |
| 34 | + $this->attachDatabase( $wgSharedDB ); |
| 35 | + } |
34 | 36 | } |
35 | 37 | } |
36 | 38 | |
Index: branches/REL1_17/phase3/includes/db/LoadBalancer.php |
— | — | @@ -428,6 +428,7 @@ |
429 | 429 | if ( $i === false ) { |
430 | 430 | $this->mLastError = 'No working slave server: ' . $this->mLastError; |
431 | 431 | $this->reportConnectionError( $this->mErrorConnection ); |
| 432 | + wfProfileOut( __METHOD__ ); |
432 | 433 | return false; |
433 | 434 | } |
434 | 435 | } |
Property changes on: branches/REL1_17/phase3/includes/db |
___________________________________________________________________ |
Added: svn:mergeinfo |
435 | 436 | Merged /branches/sqlite/includes/db:r58211-58321 |
436 | 437 | Merged /trunk/phase3/includes/db:r80892,82845,82847-82848 |
437 | 438 | Merged /branches/new-installer/phase3/includes/db:r43664-66004 |
438 | 439 | Merged /branches/wmf-deployment/includes/db:r53381 |
439 | 440 | Merged /branches/REL1_15/phase3/includes/db:r51646 |