X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Fmwdocgen.php;h=d0056299b2057cc066802279720bfdcfe8992b9c;hb=5fde3c998fdd56ec74655cba2b2e46e3b3f4ec39;hp=35fca8e0508e8d836f1b06156352c0e4139dc4e7;hpb=1f2706b49939bfc85ec5abc8ccc24aacd938eed0;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/mwdocgen.php b/maintenance/mwdocgen.php index 35fca8e050..d0056299b2 100644 --- a/maintenance/mwdocgen.php +++ b/maintenance/mwdocgen.php @@ -72,7 +72,7 @@ class MWDocGen extends Maintenance { } protected function init() { - global $IP; + global $wgPhpCli, $IP; $this->doxygen = $this->getOption( 'doxygen', 'doxygen' ); $this->mwVersion = $this->getOption( 'version', 'master' ); @@ -86,15 +86,21 @@ class MWDocGen extends Maintenance { $this->output = $this->getOption( 'output', "$IP/docs" ); - $this->inputFilter = wfShellWikiCmd( $IP . '/maintenance/mwdoc-filter.php' ); + // Do not use wfShellWikiCmd, because mwdoc-filter.php is not + // a Maintenance script. + $this->inputFilter = wfEscapeShellArg( [ + $wgPhpCli, + $IP . '/maintenance/mwdoc-filter.php' + ] ); + $this->template = $IP . '/maintenance/Doxyfile'; - $this->excludes = array( + $this->excludes = [ 'vendor', 'node_modules', 'images', 'static', - ); - $this->excludePatterns = array(); + ]; + $this->excludePatterns = []; if ( $this->hasOption( 'no-extensions' ) ) { $this->excludePatterns[] = 'extensions'; } @@ -117,7 +123,7 @@ class MWDocGen extends Maintenance { $excludePatterns = implode( ' ', $this->excludePatterns ); $conf = strtr( file_get_contents( $this->template ), - array( + [ '{{OUTPUT_DIRECTORY}}' => $this->output, '{{STRIP_FROM_PATH}}' => $IP, '{{CURRENT_VERSION}}' => $this->mwVersion, @@ -127,7 +133,7 @@ class MWDocGen extends Maintenance { '{{HAVE_DOT}}' => $this->doDot ? 'YES' : 'NO', '{{GENERATE_MAN}}' => $this->doMan ? 'YES' : 'NO', '{{INPUT_FILTER}}' => $this->inputFilter, - ) + ] ); $tmpFile = tempnam( wfTempDir(), 'MWDocGen-' );