RFC Header Comment Blocks
| From: | Jesper Veggerby Hansen | Date: | Sat, 12 Feb 2005 18:57:32 +0000 |
| Subject: | RFC Header Comment Blocks | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-36164@lists.php.net to get a copy of this message | ||
Hi guys,
Just sat here and adjusted the headers of my code to match the new RFC when this thought just crossed my mind.
The PEPr/RFC states:
-----------------------------------------------------------------------
@package_version@ Usage
There are two ways to implement the @package_version@ replacements. The procedure depends on whether you write your own package.xml files or if you use the PackageFileManager.
For those authoring package.xml files directly, add a <replace> element for each file. The XML for such would look something like this:
<file name="Class.php">
<replace from="@package_version@" to="version" type="package-info" />
</file>
Maintainers using the PackageFileManager need to call addReplacement() for each file:
$pkg->addReplacement('filename.php', 'package-info',
'@package_version@', 'version');----------------------------------------------------------------------- My thought was: I think it's the right way to include the actual package version as the class version (I know there were a some discussion on how to actually accomplish this). I know I gave it a +1 but I (and others?) just hadn't thought about this: If a package consists of _many_ files (fx "my" package Image_Graph, currently 130+ files), is this really an optimal way of doing this (installation-performance-wise)? I mean you'd have to do the 130+ replacements when installing the package (not to say you have to write them manually into the package.xml) Or should this replacement only be performed on the main class, then I see no problem, but the RFC states: "...add a <replace> element for *each* file." Is it just me who can see an issue here or was the idea that you performed the replacement prior to packing the .tgz file? Or me just is stupid? (please don't answer that :)) regards Jesper