r79056 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79055‎ | r79056 | r79057 >
Date:13:56, 27 December 2010
Author:demon
Status:ok
Tags:
Comment:
* Followup r78450: just use selectField() instead of pg_fetch_result() with a raw doQuery()
* Remove useless isset() check, this will always be set with some default in DefaultSettings.php
Modified paths:
  • /trunk/phase3/includes/installer/DatabaseUpdater.php (modified) (history)
  • /trunk/phase3/includes/installer/PostgresUpdater.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/DatabaseUpdater.php
@@ -26,6 +26,11 @@
2727
2828 protected $extensionUpdates = array();
2929
 30+ /**
 31+ * Handle to the database subclass
 32+ *
 33+ * @var DatabaseBase
 34+ */
3035 protected $db;
3136
3237 protected $shared = false;
Index: trunk/phase3/includes/installer/PostgresUpdater.php
@@ -516,14 +516,10 @@
517517 protected function checkPgUser() {
518518 global $wgDBmwschema, $wgDBts2schema, $wgDBuser;
519519
520 - # Just in case their LocalSettings.php does not have this:
521 - if ( !isset( $wgDBmwschema ) ) {
522 - $wgDBmwschema = 'mediawiki';
523 - }
 520+ $config = $this->db->selectField(
 521+ 'pg_catalog.pg_user', "array_to_string(useconfig,'*')",
 522+ array( 'usename' => $wgDBuser ), __METHOD__ );
524523
525 - $safeuser = $this->db->addQuotes( $wgDBuser );
526 - $SQL = "SELECT array_to_string(useconfig,'*') FROM pg_catalog.pg_user WHERE usename = $safeuser";
527 - $config = pg_fetch_result( $this->db->query( $SQL ), 0, 0 );
528524 $conf = array();
529525 foreach ( explode( '*', $config ) as $c ) {
530526 list( $x, $y ) = explode( '=', $c );

Follow-up revisions

RevisionCommit summaryAuthorDate
r801901.17: MFT first batch of installer changes: r78043, r78231, r78259, r78300, r...catrope20:47, 13 January 2011
r92328REL1_18 MFT r79056, r80612, r81499, r87627, r87628, r87630, r87998, r88134, r...reedy22:46, 15 July 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r78450Changed doQuery() -> query()aaron20:59, 15 December 2010

Status & tagging log