Add warnings to install.php for files-options
authorjan <jan@jans-seite.de>
Fri, 5 Oct 2012 22:28:39 +0000 (00:28 +0200)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Sun, 7 Oct 2012 06:26:49 +0000 (08:26 +0200)
Add warnings to install.php if dbpass and dbpassfile or pass and passfile is provided.

Change-Id: Ibf73ddd80eebbd9886e18cee8eaf32b7127b660f

maintenance/install.php

index 365791e..39e613f 100644 (file)
@@ -78,6 +78,9 @@ class CommandLineInstaller extends Maintenance {
 
                $dbpassfile = $this->getOption( 'dbpassfile', false );
                if ( $dbpassfile !== false ) {
+                       if ( $this->getOption( 'dbpass', false ) !== false ) {
+                               $this->error( 'WARNING: You provide the options "dbpass" and "dbpassfile". The content of "dbpassfile" overwrites "dbpass".' );
+                       }
                        wfSuppressWarnings();
                        $dbpass = file_get_contents( $dbpassfile );
                        wfRestoreWarnings();
@@ -89,6 +92,9 @@ class CommandLineInstaller extends Maintenance {
 
                $passfile = $this->getOption( 'passfile', false );
                if ( $passfile !== false ) {
+                       if ( $this->getOption( 'pass', false ) !== false ) {
+                               $this->error( 'WARNING: You provide the options "pass" and "passfile". The content of "passfile" overwrites "pass".' );
+                       }
                        wfSuppressWarnings();
                        $pass = file_get_contents( $passfile );
                        wfRestoreWarnings();
@@ -97,7 +103,7 @@ class CommandLineInstaller extends Maintenance {
                        }
                        $this->mOptions['pass'] = str_replace( array( "\n", "\r" ), "", $pass );
                } elseif ( $this->getOption( 'pass', false ) === false ) {
-                       $this->error( "You need to provide the option pass or passfile", true );
+                       $this->error( 'You need to provide the option "pass" or "passfile"', true );
                }
 
                $installer =