Use shell_exec instead of backtick
authorMatthew Flaschen <mflaschen@wikimedia.org>
Thu, 6 Jul 2017 23:14:38 +0000 (19:14 -0400)
committerMatthew Flaschen <mflaschen@wikimedia.org>
Thu, 6 Jul 2017 23:14:38 +0000 (19:14 -0400)
They are exactly equivalent, but shell_exec is more readable.
We just imported a sniff to forbid backtick into mediawiki-codesniffer.

It's not deployed here yet, but this will facilitate it.

Change-Id: I4b58ed78e1792ff83e1bf99425f8f19123cfe911

maintenance/mwdocgen.php

index d005629..43041a4 100644 (file)
@@ -105,7 +105,7 @@ class MWDocGen extends Maintenance {
                        $this->excludePatterns[] = 'extensions';
                }
 
-               $this->doDot = `which dot`;
+               $this->doDot = shell_exec( 'which dot' );
                $this->doMan = $this->hasOption( 'generate-man' );
        }