[drupal-devel] release info, introspection and debug

Gabor Hojtsy gabor at hojtsy.hu
Wed Jan 26 14:24:49 UTC 2005


> Extremely common example from C (source code to most Unixes):
> 
> #if 0
> static char sccsid[] = "@(#)w.c 8.4 (Berkeley) 4/16/94";
> #endif
> static const char rcsid[] =
>   "$FreeBSD: src/usr.bin/w/w.c,v 1.38.2.7 2003/08/15 21:58:14 rwatson 
> Exp $";
> 
> Similarly, in PHP:
> $version  = "\$Revision: 1.6 $";
> $release  = "\$Name:  build_1_2_19 $";
> 
> Any chance of doing something like that with Drupal?  If not in all 
> files, maybe just the release in common.inc?

Wuh, using these kind of variables are evil. I suggested back then to 
use the _help hook with the '#version' (or something alike) $section to 
grab the version, so this should work:

function somemodule_help($section) {
   switch($section) {
     case '#version':
       return '$Revision: 1.6 $';
   }
}

Similarly for $Name if you need it.

Goba



More information about the drupal-devel mailing list