Merge "Lowered the TransactionProfiler threshold"
[lhc/web/wiklou.git] / includes / installer / PostgresInstaller.php
index 2cf4156..9e25f47 100644 (file)
@@ -83,8 +83,10 @@ class PostgresInstaller extends DatabaseInstaller {
 
        function submitConnectForm() {
                // Get variables from the request
-               $newValues = $this->setVarsFromRequest( array( 'wgDBserver', 'wgDBport',
-                       'wgDBname', 'wgDBmwschema' ) );
+               $newValues = $this->setVarsFromRequest( array(
+                       'wgDBserver', 'wgDBport','wgDBname', 'wgDBmwschema',
+                       '_InstallUser', '_InstallPassword'
+               ) );
 
                // Validate them
                $status = Status::newGood();
@@ -96,6 +98,12 @@ class PostgresInstaller extends DatabaseInstaller {
                if ( !preg_match( '/^[a-zA-Z0-9_]*$/', $newValues['wgDBmwschema'] ) ) {
                        $status->fatal( 'config-invalid-schema', $newValues['wgDBmwschema'] );
                }
+               if ( !strlen( $newValues['_InstallUser'] ) ) {
+                       $status->fatal( 'config-db-username-empty' );
+               }
+               if ( !strlen( $newValues['_InstallPassword'] ) ) {
+                       $status->fatal( 'config-db-password-empty', $newValues['_InstallUser'] );
+               }
 
                // Submit user box
                if ( $status->isOK() ) {
@@ -210,8 +218,7 @@ class PostgresInstaller extends DatabaseInstaller {
         *    - create-tables: A connection with a role suitable for creating tables.
         *
         * @throws MWException
-        * @return Status object. On success, a connection object will be in the
-        *   value member.
+        * @return Status On success, a connection object will be in the value member.
         */
        protected function openPgConnection( $type ) {
                switch ( $type ) {
@@ -406,7 +413,7 @@ class PostgresInstaller extends DatabaseInstaller {
 
        /**
         * Recursive helper for canCreateObjectsForWebUser().
-        * @param $conn DatabaseBase object
+        * @param DatabaseBase $conn
         * @param int $targetMember Role ID of the member to look for
         * @param int $group Role ID of the group to look for
         * @param int $maxDepth Maximum recursive search depth