r90431 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90430‎ | r90431 | r90432 >
Date:07:16, 20 June 2011
Author:tstarling
Status:ok
Tags:
Comment:
Fix for r72150: rename getSchema() to getSchemaPath(). This terminology creates an unfortunate and potentially confusing conflict with the PostgreSQL usage of the term. At some point in the future I'd like to have a getSchema() that gives you the PostgreSQL schema name ($wgDBmwschema). Strictly speaking, tables.sql is not a schema, it's an SQL file that creates a schema.
Modified paths:
  • /trunk/phase3/includes/db/Database.php (modified) (history)
  • /trunk/phase3/includes/installer/DatabaseInstaller.php (modified) (history)
  • /trunk/phase3/includes/installer/Ibm_db2Installer.php (modified) (history)
  • /trunk/phase3/includes/installer/PostgresInstaller.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/Database.php
@@ -531,11 +531,11 @@
532532 }
533533
534534 /**
535 - * Return a path to the DBMS-specific schema, otherwise default to tables.sql
 535+ * Return a path to the DBMS-specific schema file, otherwise default to tables.sql
536536 *
537537 * @return string
538538 */
539 - public function getSchema() {
 539+ public function getSchemaPath() {
540540 global $IP;
541541 if ( file_exists( "$IP/maintenance/" . $this->getType() . "/tables.sql" ) ) {
542542 return "$IP/maintenance/" . $this->getType() . "/tables.sql";
Index: trunk/phase3/includes/installer/Ibm_db2Installer.php
@@ -185,7 +185,7 @@
186186 $this->db->setFlag( DBO_DDLMODE ); // For Oracle's handling of schema files
187187 $this->db->begin( __METHOD__ );
188188
189 - $error = $this->db->sourceFile( $this->db->getSchema() );
 189+ $error = $this->db->sourceFile( $this->db->getSchemaPath() );
190190 if( $error !== true ) {
191191 $this->db->reportQueryError( $error, 0, '', __METHOD__ );
192192 $this->db->rollback( __METHOD__ );
Index: trunk/phase3/includes/installer/DatabaseInstaller.php
@@ -157,7 +157,7 @@
158158 $this->db->setFlag( DBO_DDLMODE ); // For Oracle's handling of schema files
159159 $this->db->begin( __METHOD__ );
160160
161 - $error = $this->db->sourceFile( $this->db->getSchema() );
 161+ $error = $this->db->sourceFile( $this->db->getSchemaPath() );
162162 if( $error !== true ) {
163163 $this->db->reportQueryError( $error, 0, '', __METHOD__ );
164164 $this->db->rollback( __METHOD__ );
Index: trunk/phase3/includes/installer/PostgresInstaller.php
@@ -543,7 +543,7 @@
544544 $status->fatal( 'config-install-pg-schema-not-exist' );
545545 return $status;
546546 }
547 - $error = $conn->sourceFile( $conn->getSchema() );
 547+ $error = $conn->sourceFile( $conn->getSchemaPath() );
548548 if( $error !== true ) {
549549 $conn->reportQueryError( $error, 0, '', __METHOD__ );
550550 $conn->rollback( __METHOD__ );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r72150Move createTables() up a level, this code was practically identicaldemon19:03, 1 September 2010

Status & tagging log