Paladox has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/316233

Change subject: Add two missing functions to PostgresInstaller.php
......................................................................

Add two missing functions to PostgresInstaller.php

Bug: T148332
Change-Id: I043d1e9b2056d94717dc452d87cc5b3c856e4873
---
M includes/installer/PostgresInstaller.php
1 file changed, 30 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/33/316233/1

diff --git a/includes/installer/PostgresInstaller.php 
b/includes/installer/PostgresInstaller.php
index 33e1a1f..027fe55 100644
--- a/includes/installer/PostgresInstaller.php
+++ b/includes/installer/PostgresInstaller.php
@@ -622,6 +622,36 @@
                return $status;
        }
 
+       /**
+        * Return a path to the DBMS-specific SQL file if it exists,
+        * otherwise default SQL file
+        *
+        * @param IDatabase $db
+        * @param string $filename
+        * @return string
+        */
+       private function getSqlFilePath( $db, $filename ) {
+               global $IP;
+
+               $dbmsSpecificFilePath = "$IP/maintenance/" . $db->getType() . 
"/$filename";
+               if ( file_exists( $dbmsSpecificFilePath ) ) {
+                       return $dbmsSpecificFilePath;
+               } else {
+                       return "$IP/maintenance/$filename";
+               }
+       }
+
+       /**
+        * Return a path to the DBMS-specific schema file,
+        * otherwise default to tables.sql
+        *
+        * @param IDatabase $db
+        * @return string
+        */
+       public function getSchemaPath( $db ) {
+               return $this->getSqlFilePath( $db, 'tables.sql' );
+       }
+
        public function getGlobalDefaults() {
                // The default $wgDBmwschema is null, which breaks Postgres and 
other DBMSes that require
                // the use of a schema, so we need to set it here

-- 
To view, visit https://gerrit.wikimedia.org/r/316233
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I043d1e9b2056d94717dc452d87cc5b3c856e4873
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Paladox <thomasmulhall...@yahoo.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to