summaryrefslogtreecommitdiffstats
path: root/common/app/classes/PlanetFeed.php
diff options
context:
space:
mode:
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);
}