From: Steve Sutton Date: Thu, 7 Jan 2016 21:15:17 +0000 (-0500) Subject: Add season proxy X-Git-Tag: v1.3.12^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=db7470ed2422419be42889f0559cd4a7fdf3f8b1;p=web%2FKeweenaw.git Add season proxy --- diff --git a/Toolkit/Page.php b/Toolkit/Page.php index b20f5fd..84a8659 100755 --- a/Toolkit/Page.php +++ b/Toolkit/Page.php @@ -1114,7 +1114,7 @@ class Toolkit_Page private function _seasons() { - $seasonMapper = new Toolkit_Seasons_Season(); + $seasonMapper = new Toolkit_Seasonator_Season(); $season = $seasonMapper->fetchById( Toolkit_Database::getInstance(), 1 @@ -1123,6 +1123,23 @@ class Toolkit_Page $season->getName() . '.css?_=' . strtotime($season->getLast_update()); } + public function getSeason() + { + $cache = new Cache_Lite($GLOBALS['cacheOptions']); + if ($season = $cache->get('seasonProxy', 'Season')) { + $output = unserialize($season); + } else { + $seasonMapper = new Toolkit_Seasonator_Season(); + $season = $seasonMapper->fetchById( + Toolkit_Database::getInstance(), + 1 + ); + $output = $season->getName() . '.css?_=' . strtotime($season->getLast_update()); + $cache->save(serialize($output), 'seasonProxy', 'Season'); + } + return $output; + } + /** * Sets the video url for the embed video if not found then set as empty * diff --git a/season.php b/season.php new file mode 100644 index 0000000..7021aa0 --- /dev/null +++ b/season.php @@ -0,0 +1,28 @@ +getSeason(); +echo $output;