Index: trunk/phase3/maintenance/install.php |
— | — | @@ -27,6 +27,7 @@ |
28 | 28 | class CommandLineInstaller extends Maintenance { |
29 | 29 | public function __construct() { |
30 | 30 | parent::__construct(); |
| 31 | + global $IP; |
31 | 32 | |
32 | 33 | $this->addArg( 'name', 'The name of the wiki', true); |
33 | 34 | |
— | — | @@ -47,18 +48,21 @@ |
48 | 49 | $this->addOption( 'installdbpass', 'The pasword for the DB user to install as.', false, true ); |
49 | 50 | $this->addOption( 'dbuser', 'The user to use for normal operations (wikiuser)', false, true ); |
50 | 51 | $this->addOption( 'dbpass', 'The pasword for the DB user for normal operations', false, true ); |
| 52 | + $this->addOption( 'confpath', "Path to write LocalSettings.php to, default $IP", false, true ); |
51 | 53 | /* $this->addOption( 'dbschema', 'The schema for the MediaWiki DB in pg (mediawiki)', false, true ); */ |
52 | 54 | /* $this->addOption( 'dbtsearch2schema', 'The schema for the tsearch2 DB in pg (public)', false, true ); */ |
53 | 55 | /* $this->addOption( 'namespace', 'The project namespace (same as the name)', false, true ); */ |
54 | 56 | } |
55 | 57 | |
56 | 58 | public function execute() { |
| 59 | + global $IP; |
57 | 60 | $adminName = isset( $this->mArgs[1] ) ? $this->mArgs[1] : null; |
58 | 61 | |
59 | 62 | $installer = |
60 | 63 | new CliInstaller( $this->mArgs[0], $adminName, $this->mOptions ); |
61 | 64 | |
62 | 65 | $installer->execute(); |
| 66 | + $installer->writeConfigurationFile( $this->getOption( 'confpath', $IP ) ); |
63 | 67 | } |
64 | 68 | } |
65 | 69 | |
Index: trunk/phase3/includes/installer/LocalSettingsGenerator.php |
— | — | @@ -123,6 +123,15 @@ |
124 | 124 | } |
125 | 125 | |
126 | 126 | /** |
| 127 | + * Write the generated LocalSettings to a file |
| 128 | + * |
| 129 | + * @param $fileName String Full path to filename to write to |
| 130 | + */ |
| 131 | + public function writeFile( $fileName ) { |
| 132 | + file_put_contents( $fileName, $ls->getText() ); |
| 133 | + } |
| 134 | + |
| 135 | + /** |
127 | 136 | * @return String |
128 | 137 | */ |
129 | 138 | private function buildMemcachedServerList() { |
Index: trunk/phase3/includes/installer/CliInstaller.php |
— | — | @@ -85,9 +85,16 @@ |
86 | 86 | array( $this, 'startStage' ), |
87 | 87 | array( $this, 'endStage' ) |
88 | 88 | ); |
| 89 | + } |
89 | 90 | |
| 91 | + /** |
| 92 | + * Write LocalSettings.php to a given path |
| 93 | + * |
| 94 | + * @param $path String Full path to write LocalSettings.php to |
| 95 | + */ |
| 96 | + public function writeConfigurationFile( $path ) { |
90 | 97 | $ls = new LocalSettingsGenerator( $this ); |
91 | | - file_put_contents( "LocalSettings.php", $ls->getText() ); |
| 98 | + $ls->writeFile( "$path/LocalSettings.php" ); |
92 | 99 | } |
93 | 100 | |
94 | 101 | public function startStage( $step ) { |