From 73cb14155cb5c18ff106c8c259686bf3b71a27aa Mon Sep 17 00:00:00 2001 From: Albert Santoni Date: Thu, 19 Feb 2015 10:01:09 -0500 Subject: [PATCH] Replace the version hashing with git revision hashing to fix browser caching --- VERSION | 2 -- airtime_mvc/application/configs/conf.php | 8 ++++++-- build.sh | 5 +++++ 3 files changed, 11 insertions(+), 4 deletions(-) delete mode 100644 VERSION create mode 100755 build.sh diff --git a/VERSION b/VERSION deleted file mode 100644 index b7fd8620d..000000000 --- a/VERSION +++ /dev/null @@ -1,2 +0,0 @@ -PRODUCT_ID=Airtime -PRODUCT_RELEASE=2.5.3 diff --git a/airtime_mvc/application/configs/conf.php b/airtime_mvc/application/configs/conf.php index 6af950882..d38a03797 100644 --- a/airtime_mvc/application/configs/conf.php +++ b/airtime_mvc/application/configs/conf.php @@ -8,14 +8,17 @@ class Config { private static $CC_CONFIG = null; + private static $rootDir; public static function loadConfig() { + + self::$rootDir = __DIR__."/../.."; $CC_CONFIG = array( /* ================================================ storage configuration */ 'soundcloud-client-id' => '2CLCxcSXYzx7QhhPVHN4A', 'soundcloud-client-secret' => 'pZ7beWmF06epXLHVUP1ufOg2oEnIt9XhE8l8xt0bBs', - "rootDir" => __DIR__."/../.." + "rootDir" => self::$rootDir ); //In the unit testing environment, we always want to use our local airtime.conf in airtime_mvc/application/test: @@ -89,7 +92,8 @@ class Config { public static function setAirtimeVersion() { $airtime_version = Application_Model_Preference::GetAirtimeVersion(); $uniqueid = Application_Model_Preference::GetUniqueId(); - self::$CC_CONFIG['airtime_version'] = md5($airtime_version.$uniqueid); + $buildVersion = file_get_contents(self::$rootDir."/../VERSION"); + self::$CC_CONFIG['airtime_version'] = md5($airtime_version.$buildVersion); } public static function getConfig() { diff --git a/build.sh b/build.sh new file mode 100755 index 000000000..0a16dcdab --- /dev/null +++ b/build.sh @@ -0,0 +1,5 @@ +#!/bin/bash +composer install + +git rev-parse HEAD > VERSION +