Index: trunk/phase3/maintenance/install.php |
— | — | @@ -55,6 +55,7 @@ |
56 | 56 | $this->addOption( 'installdbpass', 'The pasword for the DB user to install as.', false, true ); |
57 | 57 | $this->addOption( 'dbuser', 'The user to use for normal operations (wikiuser)', false, true ); |
58 | 58 | $this->addOption( 'dbpass', 'The pasword for the DB user for normal operations', false, true ); |
| 59 | + $this->addOption( 'dbpassfile', 'An alternative way to provide dbpass option, as the contents of this file', false, true ); |
59 | 60 | $this->addOption( 'confpath', "Path to write LocalSettings.php to, default $IP", false, true ); |
60 | 61 | /* $this->addOption( 'dbschema', 'The schema for the MediaWiki DB in pg (mediawiki)', false, true ); */ |
61 | 62 | /* $this->addOption( 'namespace', 'The project namespace (same as the name)', false, true ); */ |
— | — | @@ -67,6 +68,17 @@ |
68 | 69 | $adminName = isset( $this->mArgs[1] ) ? $this->mArgs[1] : null; |
69 | 70 | $wgTitle = Title::newFromText( 'Installer script' ); |
70 | 71 | |
| 72 | + $dbpassfile = $this->getOption( 'dbpassfile', false ); |
| 73 | + if ( $dbpassfile !== false ) { |
| 74 | + wfSuppressWarnings(); |
| 75 | + $dbpass = file_get_contents( $dbpassfile ); |
| 76 | + wfRestoreWarnings(); |
| 77 | + if ( $dbpass === false ) { |
| 78 | + $this->error( "Couldn't open $dbpassfile", true ); |
| 79 | + } |
| 80 | + $this->mOptions['dbpass'] = $dbpass; |
| 81 | + } |
| 82 | + |
71 | 83 | $installer = |
72 | 84 | new CliInstaller( $siteName, $adminName, $this->mOptions ); |
73 | 85 | |