com phpruntests: Added "generated file" comment to generated class map file.: src/BuildClassMap.php

From: Date: Mon, 11 May 2009 13:20:55 +0000
Subject: com phpruntests: Added "generated file" comment to generated class map file.: src/BuildClassMap.php
Groups: php.qa 
Request: Send a blank email to php-qa+get-66488@lists.php.net to get a copy of this message
Commit: 00c7aff852ae9ce675c179a43564b59ea315f04f Author: Stefan Priebsch <spriebsch@php.net> Mon, 11 May 2009 13:20:55 +0000 Parents: f8fbf60737d61aa71d94c12ae3fa8d603914c747 Branches: master Link: http://git.php.net/?p=phpruntests.git;a=commitdiff;h=00c7aff852ae9ce675c179a43564b59ea315f04f Log: Added "generated file" comment to generated class map file. Changed paths: M src/BuildClassMap.php Diff: diff --git a/src/BuildClassMap.php b/src/BuildClassMap.php index 7c6ff42..9a91b5d 100644 --- a/src/BuildClassMap.php +++ b/src/BuildClassMap.php @@ -1,5 +1,5 @@ <?php -/* +/** * This is stand alone code to build the file rtClassMap used by rtAutoload to find classes. * It assumes that all classes have the same name at the file name (less .php) and all are prefixed by 'rt' * @@ -16,8 +16,16 @@ class BuildClassMap $sourceFiles = $this->getSourceList($thisDir); - $mapString = '<?php'."\n"; - $mapString .= ' $rtClassMap = array('."\n"; + $mapString = '<?php' . "\n"; + $mapString .= '/**' . "\n"; + $mapString .= ' * Autoload Class Map' . "\n"; + $mapString .= ' *' . "\n"; + $mapString .= ' * This is a generated file. Do not edit!' . "\n"; + $mapString .= ' *' . "\n"; + $mapString .= ' * To re-generate this file, run the script ' . basename(__FILE__) . '.' . "\n"; + $mapString .= ' */' . "\n"; + + $mapString .= '$rtClassMap = array('."\n"; sort($sourceFiles); @@ -31,7 +39,7 @@ class BuildClassMap $mapString .= " ".'\''.$className.'\''. $spaces. " => ".'\''.$relativeLocation.'\','."\n"; } - $mapString .= ' );'."\n"; + $mapString .= ');'."\n"; $mapString .= '?>'."\n"; file_put_contents($thisDir.'/rtClassMap.php', $mapString);

« previous php.qa (#66488) next »