From 51b8e3315ebbe93d4043e7300c29089744c9b7de Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Wed, 18 May 2016 12:10:15 +0200 Subject: [PATCH] tweeper.php: move the loadStylesheet() method more down in the file This way all static methods are grouped together before non-static methods. --- tweeper.php | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/tweeper.php b/tweeper.php index bb2db0d..d84094e 100644 --- a/tweeper.php +++ b/tweeper.php @@ -196,29 +196,6 @@ class Tweeper { } /** - * Load a stylesheet if the web site is supported. - */ - private function loadStylesheet($host) { - $stylesheet = "file://" . __DIR__ . "/rss_converter_" . $host . ".xsl"; - if (FALSE === file_exists($stylesheet)) { - trigger_error("Conversion to RSS not supported for $host ($stylesheet not found)", E_USER_ERROR); - return NULL; - } - - $stylesheet_contents = Tweeper::getUrlContents($stylesheet); - - $xslDoc = new DOMDocument(); - $xslDoc->loadXML($stylesheet_contents); - - $xsltProcessor = new XSLTProcessor(); - $xsltProcessor->registerPHPFunctions(); - $xsltProcessor->setParameter('', 'generate-enclosure', $this->generate_enclosure); - $xsltProcessor->importStylesheet($xslDoc); - - return $xsltProcessor; - } - - /** * Convert json to XML. */ private static function jsonToXml($json, $root_node_name) { @@ -302,6 +279,29 @@ class Tweeper { } /** + * Load a stylesheet if the web site is supported. + */ + private function loadStylesheet($host) { + $stylesheet = "file://" . __DIR__ . "/rss_converter_" . $host . ".xsl"; + if (FALSE === file_exists($stylesheet)) { + trigger_error("Conversion to RSS not supported for $host ($stylesheet not found)", E_USER_ERROR); + return NULL; + } + + $stylesheet_contents = Tweeper::getUrlContents($stylesheet); + + $xslDoc = new DOMDocument(); + $xslDoc->loadXML($stylesheet_contents); + + $xsltProcessor = new XSLTProcessor(); + $xsltProcessor->registerPHPFunctions(); + $xsltProcessor->setParameter('', 'generate-enclosure', $this->generate_enclosure); + $xsltProcessor->importStylesheet($xslDoc); + + return $xsltProcessor; + } + + /** * Convert the site content to RSS. */ public function tweep($src_url) { -- 2.1.4