From 86515a1560c77def9404eb484e088b19fca4da64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Fri, 8 Jul 2016 19:26:07 +0200 Subject: [PATCH] core: use proxy when defined in RssExpander MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- lib/Bridge.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/Bridge.php b/lib/Bridge.php index b2010ec0..cca4b5a8 100644 --- a/lib/Bridge.php +++ b/lib/Bridge.php @@ -77,7 +77,7 @@ abstract class BridgeAbstract implements BridgeInterface{ /** * Define default bridge name - */ + */ public function getName(){ return $this->name; } @@ -166,7 +166,7 @@ abstract class BridgeAbstract implements BridgeInterface{ * After all, rss-bridge is not respaw, isn't it ? */ abstract class HttpCachingBridgeAbstract extends BridgeAbstract { - + /** * Maintain locally cached versions of pages to download to avoid multiple doiwnloads. * A file name is generated by replacing all "/" by "_", and the file is saved below this bridge cache @@ -213,7 +213,7 @@ abstract class HttpCachingBridgeAbstract extends BridgeAbstract { $this->get_cached($url); } return filectime($filename); - } + } private function refresh_in_cache($pageCacheDir, $filename) { $currentPath = $filename; @@ -267,7 +267,7 @@ class Bridge{ } $pathBridge = self::getDir() . $nameBridge . '.php'; - + if( !file_exists($pathBridge) ){ throw new \Exception('The bridge you looking for does not exist. It should be at path '.$pathBridge); } @@ -349,8 +349,11 @@ abstract class RssExpander extends HttpCachingBridgeAbstract{ } // $this->message("Loading from ".$param['url']); // Notice WE DO NOT use cache here on purpose : we want a fresh view of the RSS stream each time - $rssContent = simplexml_load_file($name) or $this->returnServerError('Could not request '.$name); -// $this->message("loaded RSS from ".$param['url']); + $content=$this->getContents($name) or + $this->returnServerError('Could not request '.$name); + + $rssContent = simplexml_load_string($content); + // $this->message("loaded RSS from ".$param['url']); // TODO insert RSS format detection // we suppose for now, we have some RSS 2.0 $this->collect_RSS_2_0_data($rssContent);