diff options
author | Lukas Schauer | 2020-12-27 14:58:55 +0100 |
---|---|---|
committer | Lukas Schauer | 2020-12-27 14:58:55 +0100 |
commit | 228da728257c2f2c4e059c8d0e5fef5f4ae2e36c (patch) | |
tree | a62d40ca8d8d564d5c40e5691a12909dbe08340f /model | |
parent | 9eb1778a4404e8de6c087ecab0661d33d691c3d7 (diff) |
add the worlds most ugliest caching code
Diffstat (limited to 'model')
-rw-r--r-- | model/Schedule.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/model/Schedule.php b/model/Schedule.php index 52eac4e..5419136 100644 --- a/model/Schedule.php +++ b/model/Schedule.php @@ -72,6 +72,11 @@ class Schedule public function getSchedule() { + $cachefile = sprintf('/tmp/getschedule-cache-%s.cache', $this->getConference()->getSlug()); + if(file_exists($cachefile) && !$GLOBALS['regenschedcache']) { + return unserialize(file_get_contents($cachefile)); + } + // download schedule-xml $schedule = $this->fetchSchedule(); @@ -261,6 +266,10 @@ class Schedule }); } + if($GLOBALS['regenschedcache']) { + file_put_contents($cachefile, serialize($program)); + } + return $program; } |