X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Fmwdocgen.php;h=3439b74f179c3d182fb7c67e186e5ee7579901ee;hb=a492cf4c3498edbea090c5eccc2515b4d4a1724b;hp=756db6cf5071957765dc9269fcaed425a16376ef;hpb=0d76bceabd9ed9dadc249d59ef78a2cc4bc4f82d;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/mwdocgen.php b/maintenance/mwdocgen.php index 756db6cf50..3439b74f17 100644 --- a/maintenance/mwdocgen.php +++ b/maintenance/mwdocgen.php @@ -61,7 +61,7 @@ $doxygenTemplate = $mwPath . 'maintenance/Doxyfile'; $doxygenInputFilter = "php {$mwPath}maintenance/mwdoc-filter.php"; /** where Phpdoc should output documentation */ -$doxyOutput = $mwPath . 'docs' . DIRECTORY_SEPARATOR ; +$doxyOutput = $mwPath . 'docs' . DIRECTORY_SEPARATOR; $doxyVersion = 'master'; @@ -88,7 +88,7 @@ $doxyGenerateMan = false; # define( 'MEDIAWIKI', true ); -require_once( "$mwPath/includes/GlobalFunctions.php" ); +require_once "$mwPath/includes/GlobalFunctions.php"; /** * Read a line from the shell @@ -122,14 +122,14 @@ function generateConfigFile( $doxygenTemplate, $outputDirectory, $stripFromPath, // Replace template placeholders by correct values. $replacements = array( '{{OUTPUT_DIRECTORY}}' => $outputDirectory, - '{{STRIP_FROM_PATH}}' => $stripFromPath, - '{{CURRENT_VERSION}}' => $currentVersion, - '{{INPUT}}' => $input, - '{{EXCLUDE}}' => $exclude, + '{{STRIP_FROM_PATH}}' => $stripFromPath, + '{{CURRENT_VERSION}}' => $currentVersion, + '{{INPUT}}' => $input, + '{{EXCLUDE}}' => $exclude, '{{EXCLUDE_PATTERNS}}' => $excludePatterns, - '{{HAVE_DOT}}' => `which dot` ? 'YES' : 'NO', - '{{GENERATE_MAN}}' => $doxyGenerateMan ? 'YES' : 'NO', - '{{INPUT_FILTER}}' => $doxygenInputFilter, + '{{HAVE_DOT}}' => `which dot` ? 'YES' : 'NO', + '{{GENERATE_MAN}}' => $doxyGenerateMan ? 'YES' : 'NO', + '{{INPUT_FILTER}}' => $doxygenInputFilter, ); $tmpCfg = str_replace( array_keys( $replacements ), array_values( $replacements ), $template ); $tmpFileName = tempnam( wfTempDir(), 'mwdocgen-' ); @@ -145,13 +145,23 @@ function generateConfigFile( $doxygenTemplate, $outputDirectory, $stripFromPath, unset( $file ); if ( is_array( $argv ) ) { - for ($i = 0; $i < count($argv); $i++ ) { - switch( $argv[$i] ) { - case '--all': $input = 0; break; - case '--includes': $input = 1; break; - case '--languages': $input = 2; break; - case '--maintenance': $input = 3; break; - case '--skins': $input = 4; break; + for ( $i = 0; $i < count( $argv ); $i++ ) { + switch ( $argv[$i] ) { + case '--all': + $input = 0; + break; + case '--includes': + $input = 1; + break; + case '--languages': + $input = 2; + break; + case '--maintenance': + $input = 3; + break; + case '--skins': + $input = 4; + break; case '--file': $input = 5; $i++; @@ -159,7 +169,9 @@ if ( is_array( $argv ) ) { $file = $argv[$i]; } break; - case '--no-extensions': $input = 6; break; + case '--no-extensions': + $input = 6; + break; case '--output': $i++; if ( isset( $argv[$i] ) ) { @@ -198,7 +210,7 @@ Other options: END; - exit(0); + exit( 0 ); break; } } @@ -217,8 +229,7 @@ Several documentation possibilities: 5 : only a given file 6 : all but the extensions directory OPTIONS; - while ( !is_numeric( $input ) ) - { + while ( !is_numeric( $input ) ) { $input = readaline( "\nEnter your choice [0]:" ); if ( $input == '' ) { $input = 0; @@ -227,11 +238,21 @@ OPTIONS; } switch ( $input ) { -case 0: $input = $mwPath; break; -case 1: $input = $mwPathI; break; -case 2: $input = $mwPathL; break; -case 3: $input = $mwPathM; break; -case 4: $input = $mwPathS; break; +case 0: + $input = $mwPath; + break; +case 1: + $input = $mwPathI; + break; +case 2: + $input = $mwPathL; + break; +case 3: + $input = $mwPathM; + break; +case 4: + $input = $mwPathS; + break; case 5: if ( !isset( $file ) ) { $file = readaline( "Enter file name $mwPath" ); @@ -260,7 +281,8 @@ $command TEXT; -passthru( $command ); +$exitcode = 1; +passthru( $command, $exitcode ); echo <<