[_] svn:keywords
Adam
adam.bcn at gmail.com
Wed Feb 27 14:51:21 GMT 2008
You could maybe just take the 4th line from the file ./.svn/entries. ~Adam On 27/02/2008, Wills Fidell <wills at endeavourcode.co.uk> wrote: > > Tom Gidden wrote: > > On 27 Feb 2008, at 13:54, Joel Hughes wrote: > >> Rather than substitute into the HTML footer direct, if I have SVN > >> substitue into what happens to be a PHP var then I can simply regex > >> out > >> the bit I want and then echo out the result. I think. > > > > That trick is quite common, especially in Perl. There are a few > > variants. This is one from ExtUtils/MakeMaker.pm: > > > > ($Revision = q$Revision: 4535 $) =~ /Revision:\s+(\S+)/; > > > > An equivalent PHPism might be: > > > > $rev = preg_replace('/^.+?(\d+).*?$/', '$1', '$Revision: 1234 $'); > > > > or for your original request: > > > > print preg_replace('/^.+?(\d+).*?$/', 'revision: $1', '$Revision: > > 1234 $'); > > > > or if you want to avoid regexps for whatever reason: > > > > list($junk, $rev, $junk) = split(' ', '$Revision: 1234 $'); > > print "revision: $rev"; > > > > [If you'd said this was PHP rather than the assumed plain HTML, it > > would've been easier!] > > > > Tom > > > > > > I was just thinking of doing it in the Smarty templates and the regexp > modifier. > > > Wills > > > > -- > underscore_ list info/archive -> > http://www.under-score.org.uk/mailman/listinfo/underscore >