From e3de9d7dd1331f9718e04cc98e9ca7cfa27cf4aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C3=A9cureuil?= Date: Sun, 17 May 2020 14:46:00 +0200 Subject: Sync with master of moonmoon ( version 9.0.0-rc) Source from https://github.com/Emmafrs/moonmoon/ --- common/app/classes/PlanetFeed.php | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'common/app/classes/PlanetFeed.php') diff --git a/common/app/classes/PlanetFeed.php b/common/app/classes/PlanetFeed.php index a6c7aab..3d2ea2f 100644 --- a/common/app/classes/PlanetFeed.php +++ b/common/app/classes/PlanetFeed.php @@ -9,15 +9,17 @@ class PlanetFeed extends SimplePie public $name; public $feed; public $website; + public $isDown; - public function __construct($name, $feed, $website) + public function __construct($name, $feed, $website, $isDown) { $this->name = $name; $this->feed = $feed; $this->website = $website; + $this->isDown = $isDown; parent::__construct(); $this->set_item_class('PlanetItem'); - $this->set_cache_location(dirname(__FILE__).'/../../cache'); + $this->set_cache_location(__DIR__.'/../../cache'); $this->set_autodiscovery_level(SIMPLEPIE_LOCATOR_NONE); $this->set_feed_url($this->getFeed()); $this->set_timeout(5); @@ -39,7 +41,19 @@ class PlanetFeed extends SimplePie return $this->website; } - public function compare($person1, $person2) + public function getIsDown() + { + return $this->isDown; + } + + /** + * Compare two Person by their name. + * + * @param $person1 + * @param $person2 + * @return int + */ + public static function compare($person1, $person2) { return strcasecmp($person1->name, $person2->name); } -- cgit v1.2.1