r84548 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84547‎ | r84548 | r84549 >
Date:20:10, 22 March 2011
Author:demon
Status:ok (Comments)
Tags:
Comment:
MFT r80892, r81143, partial r81896, r84532
Modified paths:
  • /branches/REL1_17/phase3/includes/db (modified) (history)
  • /branches/REL1_17/phase3/includes/db/DatabaseIbm_db2.php (modified) (history)
  • /branches/REL1_17/phase3/includes/db/DatabaseMssql.php (modified) (history)
  • /branches/REL1_17/phase3/includes/db/DatabaseOracle.php (modified) (history)
  • /branches/REL1_17/phase3/includes/db/DatabasePostgres.php (modified) (history)
  • /branches/REL1_17/phase3/includes/db/DatabaseSqlite.php (modified) (history)
  • /branches/REL1_17/phase3/includes/db/LoadBalancer.php (modified) (history)

Diff [purge]

Index: branches/REL1_17/phase3/includes/db/DatabaseOracle.php
@@ -182,7 +182,7 @@
183183 {
184184 $tablePrefix = $tablePrefix == 'get from global' ? $tablePrefix : strtoupper( $tablePrefix );
185185 parent::__construct( $server, $user, $password, $dbName, $flags, $tablePrefix );
186 - wfRunHooks( 'DatabaseOraclePostInit', array( &$this ) );
 186+ wfRunHooks( 'DatabaseOraclePostInit', array( $this ) );
187187 }
188188
189189 function getType() {
Index: branches/REL1_17/phase3/includes/db/DatabasePostgres.php
@@ -100,13 +100,6 @@
101101 var $numeric_version = null;
102102 var $mAffectedRows = null;
103103
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 -
111104 function getType() {
112105 return 'postgres';
113106 }
Index: branches/REL1_17/phase3/includes/db/DatabaseIbm_db2.php
@@ -245,11 +245,6 @@
246246 return 'ibm_db2';
247247 }
248248
249 - ######################################
250 - # Setup
251 - ######################################
252 -
253 -
254249 /**
255250 *
256251 * @param $server String: hostname of database server
@@ -259,20 +254,13 @@
260255 * @param $flags Integer: database behaviour flags (optional, unused)
261256 * @param $schema String
262257 */
263 - public function DatabaseIbm_db2( $server = false, $user = false,
 258+ public function __construct( $server = false, $user = false,
264259 $password = false,
265260 $dbName = false, $flags = 0,
266261 $schema = self::USE_GLOBAL )
267262 {
 263+ global $wgDBmwschema;
268264
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 -
277265 if ( $schema == self::USE_GLOBAL ) {
278266 $this->mSchema = $wgDBmwschema;
279267 } else {
@@ -287,7 +275,7 @@
288276 $this->setDB2Option( 'rowcount', 'DB2_ROWCOUNT_PREFETCH_ON',
289277 self::STMT_OPTION );
290278
291 - $this->open( $server, $user, $password, $dbName );
 279+ parent::__construct( $server, $user, $password, $dbName, DBO_TRX | $flags );
292280 }
293281
294282 /**
@@ -351,6 +339,7 @@
352340 }
353341
354342 if ( strlen( $user ) < 1 ) {
 343+ wfProfileOut( __METHOD__ );
355344 return null;
356345 }
357346
@@ -378,6 +367,7 @@
379368 "Server: $server, Database: $dbName, User: $user, Password: "
380369 . substr( $password, 0, 3 ) . "...\n" );
381370 $this->installPrint( $this->lastError() . "\n" );
 371+ wfProfileOut( __METHOD__ );
382372 return null;
383373 }
384374
Index: branches/REL1_17/phase3/includes/db/DatabaseMssql.php
@@ -17,13 +17,6 @@
1818 var $mLastResult = NULL;
1919 var $mAffectedRows = NULL;
2020
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 -
2821 function cascadingDeletes() {
2922 return true;
3023 }
Index: branches/REL1_17/phase3/includes/db/DatabaseSqlite.php
@@ -24,12 +24,14 @@
2525 * Parameters $server, $user and $password are not used.
2626 */
2727 function __construct( $server = false, $user = false, $password = false, $dbName = false, $flags = 0 ) {
28 - global $wgSharedDB;
29 - $this->mFlags = $flags;
3028 $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+ }
3436 }
3537 }
3638
Index: branches/REL1_17/phase3/includes/db/LoadBalancer.php
@@ -428,6 +428,7 @@
429429 if ( $i === false ) {
430430 $this->mLastError = 'No working slave server: ' . $this->mLastError;
431431 $this->reportConnectionError( $this->mErrorConnection );
 432+ wfProfileOut( __METHOD__ );
432433 return false;
433434 }
434435 }
Property changes on: branches/REL1_17/phase3/includes/db
___________________________________________________________________
Added: svn:mergeinfo
435436 Merged /branches/sqlite/includes/db:r58211-58321
436437 Merged /trunk/phase3/includes/db:r80892,82845,82847-82848
437438 Merged /branches/new-installer/phase3/includes/db:r43664-66004
438439 Merged /branches/wmf-deployment/includes/db:r53381
439440 Merged /branches/REL1_15/phase3/includes/db:r51646

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r80892* Cleanup massive duplication across Database constructors. Default implement...demon18:36, 24 January 2011
r81143Restore global wrongly removed in r80892platonides18:10, 28 January 2011
r81896Yet more additions of wfProfileOut()platonides16:39, 10 February 2011
r84532Cleanup r80892, r84485: Check user also in sqlite for consistency.demon15:59, 22 March 2011

Comments

#Comment by Catrope (talk | contribs)   19:04, 2 April 2011

Missing changes from includes/installer , otherwise OK

#Comment by 😂 (talk | contribs)   20:07, 3 April 2011

Changes for installer stuff were already merged, not an issue.

Status & tagging log