Display error if Installer->execute() doesn't return a good status object
[lhc/web/wiklou.git] / maintenance / mwdocgen.php
index 2d6a0be..f600f13 100644 (file)
@@ -33,6 +33,8 @@
  * @version first release
  */
 
+use MediaWiki\Shell\Shell;
+
 require_once __DIR__ . '/Maintenance.php';
 
 /**
@@ -40,6 +42,26 @@ require_once __DIR__ . '/Maintenance.php';
  * @ingroup Maintenance
  */
 class MWDocGen extends Maintenance {
+       /** @var string */
+       private $doxygen;
+       /** @var string */
+       private $mwVersion;
+       /** @var string */
+       private $output;
+       /** @var string */
+       private $input;
+       /** @var string */
+       private $inputFilter;
+       /** @var string */
+       private $template;
+       /** @var string[] */
+       private $excludes;
+       /** @var string[] */
+       private $excludePatterns;
+       /** @var bool */
+       private $doDot;
+       /** @var bool */
+       private $doMan;
 
        /**
         * Prepare Maintenance class
@@ -54,8 +76,6 @@ class MWDocGen extends Maintenance {
                $this->addOption( 'version',
                        'Pass a MediaWiki version',
                        false, true );
-               $this->addOption( 'generate-man',
-                       'Whether to generate man files' );
                $this->addOption( 'file',
                        "Only process given file or directory. Multiple values " .
                        "accepted with comma separation. Path relative to \$IP.",
@@ -88,7 +108,7 @@ class MWDocGen extends Maintenance {
 
                // Do not use wfShellWikiCmd, because mwdoc-filter.php is not
                // a Maintenance script.
-               $this->inputFilter = wfEscapeShellArg( [
+               $this->inputFilter = Shell::escape( [
                        $wgPhpCli,
                        $IP . '/maintenance/mwdoc-filter.php'
                ] );
@@ -97,6 +117,7 @@ class MWDocGen extends Maintenance {
                $this->excludes = [
                        'vendor',
                        'node_modules',
+                       'resources/lib',
                        'images',
                        'static',
                ];
@@ -106,7 +127,6 @@ class MWDocGen extends Maintenance {
                }
 
                $this->doDot = shell_exec( 'which dot' );
-               $this->doMan = $this->hasOption( 'generate-man' );
        }
 
        public function execute() {
@@ -131,7 +151,6 @@ class MWDocGen extends Maintenance {
                                '{{EXCLUDE}}' => $exclude,
                                '{{EXCLUDE_PATTERNS}}' => $excludePatterns,
                                '{{HAVE_DOT}}' => $this->doDot ? 'YES' : 'NO',
-                               '{{GENERATE_MAN}}' => $this->doMan ? 'YES' : 'NO',
                                '{{INPUT_FILTER}}' => $this->inputFilter,
                        ]
                );