From 4af6db95a9105de03c76128622bd058b13fc134c Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Tue, 22 Jul 2008 21:07:28 -0600 Subject: [PATCH] Remove Subversion specific classes, as they are no longer being maintained. Signed-off-by: Edward Z. Yang --- XHTMLCompiler/DOMFilter/RSSFromSVN.php | 111 --------------------------------- XHTMLCompiler/DOMFilter/Subversion.php | 60 ------------------ smoketests/DOMFilter/RSSFromSVN.xhtml | 19 ------ 3 files changed, 190 deletions(-) delete mode 100644 XHTMLCompiler/DOMFilter/RSSFromSVN.php delete mode 100644 XHTMLCompiler/DOMFilter/Subversion.php delete mode 100644 smoketests/DOMFilter/RSSFromSVN.xhtml diff --git a/XHTMLCompiler/DOMFilter/RSSFromSVN.php b/XHTMLCompiler/DOMFilter/RSSFromSVN.php deleted file mode 100644 index 1862017..0000000 --- a/XHTMLCompiler/DOMFilter/RSSFromSVN.php +++ /dev/null @@ -1,111 +0,0 @@ - and other places - */ - protected $title = 'Changelog for %s'; - - protected $xcAttr = array('rss-from-svn'); - - public function process(DOMDocument $dom, $page, $manager) { - - $xc = XHTMLCompiler::getInstance(); - $viewvc_url = $xc->getConf('viewvc_url'); - - // see if we need to make the link ourself - $trigger = $this->confiscateAttr($dom->documentElement, $this->ns, 'rss-from-svn'); - if ($trigger == 'yes') { - // alright, set it up ourselves - $link = $dom->createElement('link'); - $link->setAttribute('rel', 'alternate'); - $link->setAttribute('type', 'application/rss+xml'); - $link->setAttribute('title', str_replace('%s', $page->getCachePath(), $this->title)); - $link->setAttribute('href', $page->getPathStem() . '.rss'); - $head = $this->query('//html:head')->item(0); - $head->appendChild($link); - } else { - // grab the document's links to RSS feeds - // link must be marked with xc:rss-from-svn - // only one allowed - $link = $this->query('//html:link[@xc:rss-from-svn]')->item(0); - if (!$link) return; // nothing to do - - $trigger = $this->confiscateAttr($link, $this->ns, 'rss-from-svn'); - if ($trigger != 'yes') return; - } - - $path = $page->getWebPath(); - - $rss = new XHTMLCompiler_RSSFeed( - $link->getAttribute('title'), - $path, - str_replace('%s', $page->getCachePath(), $this->description), - $dom->documentElement->getAttribute('xml:lang') - ); - - // must be accessible by this script, but not necessarily the - // general public - $url = $page->getSVNHeadURLMunged(); - - if (!$url) { - // file is not versioned, fail silently: it might work later - return; - } - - // Extension not enabled, fail silently - if (!function_exists('svn_log')) return; - $logs = svn_log_limit($url, $this->limit, $page); - - $page_link = $page->getWebPath(); - - date_default_timezone_set('UTC'); - foreach ($logs as $log) { - // link to ViewVC snapshot if possible - if ($viewvc_url) { - $item_link = $viewvc_url . '/' . $page->getSourcePath() . - '?r1=' . ($log['rev'] - 1) . '&r2=' . $log['rev']; - } else { - $item_link = $page_link . '#svn_r' . $log['rev']; - } - // generate short message (first line) for title - $lines = explode("\n", wordwrap($log['msg'], 40)); - $short_msg = $lines[0]; - - $rss->addItem( - $item_link, - 'Revision ' . $log['rev'] . ': ' . htmlspecialchars($short_msg), - $d = gmdate('r', strtotime($log['date'])), - htmlspecialchars($log['msg']) - ); - } - - $rss->save( - $page->normalizePath( - $link->getAttribute('href') - ) - ); - - } - -} - -?> \ No newline at end of file diff --git a/XHTMLCompiler/DOMFilter/Subversion.php b/XHTMLCompiler/DOMFilter/Subversion.php deleted file mode 100644 index 552ec02..0000000 --- a/XHTMLCompiler/DOMFilter/Subversion.php +++ /dev/null @@ -1,60 +0,0 @@ -confiscateAttr( - $dom->documentElement, $this->ns, $key - ); - } - - // parse the values - foreach ($vals as $key => $val) { - if ($val === '') { - $val = false; // technically unnecessary, but be explicit - continue; - } - $vals[$key] = substr( - $val, - $l = strpos($val, ' ') + 1, // index of first space + 1 - strlen($val) - $l - 2 // exclude last two characters - ); - } - - // insert into page object - $page->registerSVNKeywords( - $vals['date'], $vals['revision'], $vals['author'], $vals['head-url'] - ); - - } - -} - -?> \ No newline at end of file diff --git a/smoketests/DOMFilter/RSSFromSVN.xhtml b/smoketests/DOMFilter/RSSFromSVN.xhtml deleted file mode 100644 index 99d6228..0000000 --- a/smoketests/DOMFilter/RSSFromSVN.xhtml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - DOMFilter/RSSFromSVN.html - - - -

DOMFilter/RSSFromSVN.html

-

This is a test of the RSS generation from SVN logs.

- - \ No newline at end of file -- 2.11.4.GIT