summaryrefslogtreecommitdiffstats
path: root/common/app/classes/PlanetFeed.php
diff options
context:
space:
mode:
authorNicolas Lécureuil <neoclust@mageia.org>2020-05-17 14:46:00 +0200
committerNicolas Lécureuil <neoclust@mageia.org>2020-05-17 14:46:00 +0200
commite3de9d7dd1331f9718e04cc98e9ca7cfa27cf4aa (patch)
tree336981502f93ceb9fa5ed33ea3b47dcefc5a8402 /common/app/classes/PlanetFeed.php
parentff32e499745367b816d10f25e63ff3328214c32f (diff)
downloadplanet-e3de9d7dd1331f9718e04cc98e9ca7cfa27cf4aa.tar
planet-e3de9d7dd1331f9718e04cc98e9ca7cfa27cf4aa.tar.gz
planet-e3de9d7dd1331f9718e04cc98e9ca7cfa27cf4aa.tar.bz2
planet-e3de9d7dd1331f9718e04cc98e9ca7cfa27cf4aa.tar.xz
planet-e3de9d7dd1331f9718e04cc98e9ca7cfa27cf4aa.zip
Sync with master of moonmoon ( version 9.0.0-rc)HEADuser/wally/upstream-10-devmaster
Source from https://github.com/Emmafrs/moonmoon/
Diffstat (limited to 'common/app/classes/PlanetFeed.php')
-rw-r--r--common/app/classes/PlanetFeed.php20
1 files changed, 17 insertions, 3 deletions
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);
}