Re: RCS tags
| From: | Stig S. Bakken | Date: | Fri, 09 Feb 2001 23:13:41 +0000 |
| Subject: | Re: RCS tags | ||
| References: | 1 | Groups: | php.pear |
| Request: | Send a blank email to php-pear+get-1321@lists.php.net to get a copy of this message | ||
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