diff options
author | MaZderMind | 2015-09-02 17:03:16 +0200 |
---|---|---|
committer | MaZderMind | 2015-09-02 17:03:16 +0200 |
commit | cbddca3d7ef394c048aaebd67ebf3d14f035e464 (patch) | |
tree | a2593f80f149dd730c6152a1ac3f94df81ca2f13 /model/Schedule.php | |
parent | 77683e1d5aaf6954f1d5c10937333ea98983ef37 (diff) |
remove impractical apcu cache
Diffstat (limited to 'model/Schedule.php')
-rw-r--r-- | model/Schedule.php | 43 |
1 files changed, 1 insertions, 42 deletions
diff --git a/model/Schedule.php b/model/Schedule.php index 7ff66af..bce1719 100644 --- a/model/Schedule.php +++ b/model/Schedule.php @@ -42,9 +42,6 @@ class Schedule extends ModelBase public function getSchedule() { - if($schedule = $this->getCached()) - return $schedule; - // download schedule-xml try { @@ -193,7 +190,7 @@ class Schedule extends ModelBase } } - return $this->doCache($program); + return $program; } @@ -220,44 +217,6 @@ class Schedule extends ModelBase return $this->get('SCHEDULE.URL'); } - private function isCacheEnabled() - { - return $this->has('SCHEDULE.CACHE') && function_exists('apc_fetch') && function_exists('apc_store'); - } - - private function getCacheDuration() - { - return $this->get('SCHEDULE.CACHE', 60*10 /* 10 minutes */); - } - - private $localCache = null; - private function getCached() - { - if($this->localCache) - return $this->localCache; - - if(!$this->isCacheEnabled()) - return null; - - return apc_fetch($this->getCacheKey()); - } - - private function doCache($value) - { - $this->localCache = $value; - - if(!$this->isCacheEnabled()) - return $value; - - apc_store($this->getCacheKey(), $value, $this->getCacheDuration()); - return $value; - } - - private function getCacheKey() - { - return 'SCHEDULE.'.$this->getScheduleUrl(); - } - public function getScheduleToRoomSlugMapping() { $mapping = array(); |