Remove Subversion code, and begin replacing with Git code. Also unset the filters.
[xhtml-compiler.git] / XHTMLCompiler / DOMFilter / Subversion.php
blob552ec0221afc338deea6c0b0b2e104e13a3be331
1 <?php
3 /**
4 * Collects Subversion data from the HTML document using keywords and
5 * adds them to the Page object for other Subversion-dependent filters
6 * to use.
7 * @deprecated
8 */
9 class XHTMLCompiler_DOMFilter_Subversion extends XHTMLCompiler_DOMFilter
12 protected $name = 'Subversion';
13 protected $prefix = 'svn';
15 // svn:date = $Date$
16 // svn:revision = $Revision$
17 // svn:author = $Author$
18 // svn:head-url = $HeadURL$
19 // // svn:id = $Id$ (redundant, but should be accepted)
21 // All can be determined from a `svn status` call, but that's
22 // expensive and should be avoided.
24 public function process(DOMDocument $dom, $page, $manager) {
26 // TODO: Id can be used to grab date, author and revision info
27 // Not HeadURL, unfortunantely, so there'll need to be two
29 // retrieve unparsed values
30 $keys = array('date', 'revision', 'author', 'head-url'); // 'id'
31 $vals = array();
32 foreach ($keys as $key) {
33 $vals[$key] = $this->confiscateAttr(
34 $dom->documentElement, $this->ns, $key
38 // parse the values
39 foreach ($vals as $key => $val) {
40 if ($val === '') {
41 $val = false; // technically unnecessary, but be explicit
42 continue;
44 $vals[$key] = substr(
45 $val,
46 $l = strpos($val, ' ') + 1, // index of first space + 1
47 strlen($val) - $l - 2 // exclude last two characters
51 // insert into page object
52 $page->registerSVNKeywords(
53 $vals['date'], $vals['revision'], $vals['author'], $vals['head-url']