Set search_path on Postgres if wgDBmwschema != 'mediawiki' to support multiple wikis...
authorGreg Sabino Mullane <greg@users.mediawiki.org>
Wed, 19 Sep 2007 02:31:28 +0000 (02:31 +0000)
committerGreg Sabino Mullane <greg@users.mediawiki.org>
Wed, 19 Sep 2007 02:31:28 +0000 (02:31 +0000)
RELEASE-NOTES
includes/DatabasePostgres.php

index addd0d4..ed9360d 100644 (file)
@@ -24,7 +24,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Add a warning for non-descriptive filenames at Special:Upload
 * Add {{filepath:}} parser function to get full path to an uploaded file,
   complementing {{fullurl:}} for pages.
-
+* (bug 11136) If using Postgres, search path is explicitly set if wgDBmwschema is 
+  not set to 'mediawiki', allowing multiple mediawiki instances per user.
 
 === Bug fixes in 1.12 ===
 
index 32c061a..7e550c8 100644 (file)
@@ -486,6 +486,15 @@ class DatabasePostgres extends Database {
                        $this->doQuery("SET client_min_messages = 'ERROR'");
                }
 
+               global $wgDBmwschema, $wgDBts2schema;
+               if (isset( $wgDBmwschema ) && isset( $wgDBts2schema )
+                       && $wgDBmwschema !== 'mediawiki'
+                       && preg_match( '/^\w+$/', $wgDBmwschema )
+                       && preg_match( '/^\w+$/', $wgDBts2schema )
+               ) {
+                       $this->doQuery("SET search_path = $wgDBmwschema, $wgDBts2schema, public");
+               }
+
                return $this->mConn;
        }