qunit: Preserve context in QUnit module environment override
[lhc/web/wiklou.git] / maintenance / mwdoc-filter.php
index ab05a3e..c80981b 100644 (file)
  * @file
  */
 
+if ( PHP_SAPI != 'cli' ) {
+       die( "This filter can only be run from the command line.\n" );
+}
+
 $source = file_get_contents( $argv[1] );
 $regexp = '#\@var\s+([^\s]+)([^/]+)/\s+(var|public|protected|private)\s+(\$[^\s;=]+)#';
 $replac = '${2} */ ${3} ${1} ${4}';
-$source = preg_replace($regexp, $replac, $source);
+$source = preg_replace( $regexp, $replac, $source );
 
 echo $source;