https://www.mediawiki.org/wiki/Special:Code/MediaWiki/106373
Revision: 106373
Author: platonides
Date: 2011-12-15 21:21:30 +0000 (Thu, 15 Dec 2011)
Log Message:
-----------
Simplify a bit the code of r106025
Modified Paths:
--------------
trunk/phase3/includes/db/DatabasePostgres.php
Modified: trunk/phase3/includes/db/DatabasePostgres.php
===================================================================
--- trunk/phase3/includes/db/DatabasePostgres.php 2011-12-15 21:15:12 UTC
(rev 106372)
+++ trunk/phase3/includes/db/DatabasePostgres.php 2011-12-15 21:21:30 UTC
(rev 106373)
@@ -642,11 +642,13 @@
# Split database and table into proper variables.
# We reverse the explode so that schema.table and table both
output
# the correct table.
- $dbDetails = array_reverse( explode( '.', $name, 2 ) );
+ $dbDetails = explode( '.', $name, 2 );
if ( isset( $dbDetails[1] ) ) {
- list( $table, $schema ) = $dbDetails;
+ $schema = '"' . $dbDetails[0] . '".';
+ $table = $dbDetails [1];
} else {
- list( $table ) = $dbDetails;
+ $schema = "\"{$wgDBmwschema}\"."; # keep old schema,
but quote it.
+ $table = $dbDetails[0];
}
if ( $format != 'quoted' ) {
switch( $name ) {
@@ -658,12 +660,7 @@
return $table;
}
}
- if ( !isset( $schema )) {
- $schema = "\"{$wgDBmwschema}\".";
- } else {
- # keep old schema, but quote it.
- $schema = "\"{$schema}\".";
- }
+
# during installation wgDBmwschema is not set, so we would end
up quering
# ""."table" => error. Erase the first part if wgDBmwschema is
empty
if ( $schema == "\"\"." ) {
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs