Replace the version hashing with git revision hashing to fix browser

caching
This commit is contained in:
Albert Santoni 2015-02-19 10:01:09 -05:00
parent 5a644ae0b8
commit 73cb14155c
3 changed files with 11 additions and 4 deletions

View file

@ -1,2 +0,0 @@
PRODUCT_ID=Airtime
PRODUCT_RELEASE=2.5.3

View file

@ -8,14 +8,17 @@
class Config { class Config {
private static $CC_CONFIG = null; private static $CC_CONFIG = null;
private static $rootDir;
public static function loadConfig() { public static function loadConfig() {
self::$rootDir = __DIR__."/../..";
$CC_CONFIG = array( $CC_CONFIG = array(
/* ================================================ storage configuration */ /* ================================================ storage configuration */
'soundcloud-client-id' => '2CLCxcSXYzx7QhhPVHN4A', 'soundcloud-client-id' => '2CLCxcSXYzx7QhhPVHN4A',
'soundcloud-client-secret' => 'pZ7beWmF06epXLHVUP1ufOg2oEnIt9XhE8l8xt0bBs', '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: //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() { public static function setAirtimeVersion() {
$airtime_version = Application_Model_Preference::GetAirtimeVersion(); $airtime_version = Application_Model_Preference::GetAirtimeVersion();
$uniqueid = Application_Model_Preference::GetUniqueId(); $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() { public static function getConfig() {

5
build.sh Executable file
View file

@ -0,0 +1,5 @@
#!/bin/bash
composer install
git rev-parse HEAD > VERSION