Doc: Mention the php command in autoload.php to regenerate it
authorErik Bernhardson <ebernhardson@wikimedia.org>
Fri, 14 Nov 2014 19:00:36 +0000 (11:00 -0800)
committerUmherirrender <umherirrender_de.wp@web.de>
Mon, 17 Nov 2014 16:35:32 +0000 (16:35 +0000)
Adds a comment to the top of the generated autoload.php directing
developers to the command to regenerate the file so they may just
copy and paste the command.

Change-Id: If098a1eb51ed732378677215c0e438c73d506697

autoload.php
includes/utils/AutoloadGenerator.php
maintenance/generateLocalAutoload.php

index c5fc22c..488f9dd 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-// This file is generated, do not adjust manually
+// This file is generated by maintenance/generateLocalAutoload.php, do not adjust manually
 
 global $wgAutoloadLocalClasses;
 
index 7cf05bc..8952947 100644 (file)
@@ -118,8 +118,11 @@ class AutoloadGenerator {
        /**
         * Write out all known classes to autoload.php in
         * the provided basedir
+        *
+        * @param string $commandName Value used in file comment to direct
+        *  developers towards the appropriate way to update the autoload.
         */
-       public function generateAutoload() {
+       public function generateAutoload( $commandName = 'AutoloadGenerator' ) {
                $content = array();
 
                // We need to generate a line each rather than exporting the
@@ -152,7 +155,7 @@ class AutoloadGenerator {
                        $this->basepath . '/autoload.php',
                        <<<EOD
 <?php
-// This file is generated, do not adjust manually
+// This file is generated by $commandName, do not adjust manually
 
 global \${$this->variableName};
 
index 5e4cac6..b8caa4d 100644 (file)
@@ -21,5 +21,5 @@ foreach ( glob( $base . '/*.php' ) as $file ) {
 $generator->forceClassPath( 'MyLocalSettingsGenerator', "$base/mw-config/overrides.php" );
 
 // Write out the autoload
-$generator->generateAutoload();
+$generator->generateAutoload( 'maintenance/generateLocalAutoload.php' );