Re: [PHP-PEAR] RCS tags
[email protected] ("Stig S. Bakken")
| Newsgroups | php.pear |
|---|---|
| Organization | Fast Search & Transfer |
| Message-ID | <[email protected]> |
Colin Viebrock wrote:
>
> > Definitely better than version, since file revision numbers often
> > have nothing
> > to do with actual versions. One other point, though: making this a class
> > variable makes it useless for static classes (there's no way to
> > get at it).
> > Maybe a standardized constant, instead (CLASS_NAME_REVISION_ID, or some
> > such...)?
>
> What about a standard method?
>
> function _get_rcs_id() {
> return '$Id$';
> }
I think a constant named after the file is best, it's the solution with
the lowest overhead. And after all, it is the version of the _file_ we
are talking about here.
Examples:
define('DB_RCSID', '$Id$');
define('DB_MYSQL_RCSID', '$Id$');
define('NET_SMTP_RCSID', '$Id$');
Constant naming:
constant=`echo $filename | tr a-z A-Z | sed -e 's/\.PHP$//' -e
's/[^A-Z0-9]/_/g'`_RCSID
- Stig