r97103 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97102‎ | r97103 | r97104 >
Date:21:38, 14 September 2011
Author:brion
Status:ok
Tags:
Comment:
* (bug 30894) Add --output option to mwdocgen.php to override output directory

Note that files go into the 'html' subdir of wherever you point.
Modified paths:
  • /trunk/phase3/maintenance/mwdocgen.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/mwdocgen.php
@@ -180,20 +180,51 @@
181181
182182 unset( $file );
183183
184 -if ( is_array( $argv ) && isset( $argv[1] ) ) {
185 - switch( $argv[1] ) {
186 - case '--all': $input = 0; break;
187 - case '--includes': $input = 1; break;
188 - case '--languages': $input = 2; break;
189 - case '--maintenance': $input = 3; break;
190 - case '--skins': $input = 4; break;
191 - case '--file':
192 - $input = 5;
193 - if ( isset( $argv[2] ) ) {
194 - $file = $argv[2];
 184+if ( is_array( $argv ) ) {
 185+ for ($i = 0; $i < count($argv); $i++ ) {
 186+ switch( $argv[$i] ) {
 187+ case '--all': $input = 0; break;
 188+ case '--includes': $input = 1; break;
 189+ case '--languages': $input = 2; break;
 190+ case '--maintenance': $input = 3; break;
 191+ case '--skins': $input = 4; break;
 192+ case '--file':
 193+ $input = 5;
 194+ $i++;
 195+ if ( isset( $argv[$i] ) ) {
 196+ $file = $argv[$i];
 197+ }
 198+ break;
 199+ case '--no-extensions': $input = 6; break;
 200+ case '--output':
 201+ $i++;
 202+ if ( isset( $argv[$i] ) ) {
 203+ $doxyOutput = realpath( $argv[$i] );
 204+ }
 205+ break;
 206+ case '--help':
 207+ print <<<END
 208+Usage: php mwdocgen.php [<command>] [<options>]
 209+
 210+Commands:
 211+ --all Process entire codebase
 212+ --includes Process only files in includes/ dir
 213+ --languages Process only files in languages/ dir
 214+ --maintenance Process only files in maintenance/ dir
 215+ --skins Process only files in skins/ dir
 216+ --file <file> Process only the given file
 217+
 218+If no command is given, you will be prompted.
 219+
 220+Other options:
 221+ --output <dir> Set output directory (default $doxyOutput)
 222+ --help Show this help and exit.
 223+
 224+
 225+END;
 226+ exit(0);
 227+ break;
195228 }
196 - break;
197 - case '--no-extensions': $input = 6; break;
198229 }
199230 }
200231

Follow-up revisions

RevisionCommit summaryAuthorDate
r97173Merged revisions 97087,97091-97092,97094,97096-97098,97100-97101,97103,97136,...dantman16:19, 15 September 2011

Status & tagging log