diff --git a/application/config/config.php b/application/config/config.php index 1c0993c92..591b84f2c 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -503,3 +503,15 @@ $config['rewrite_short_tags'] = FALSE; | Array: array('10.0.1.200', '192.168.5.0/24') */ $config['proxy_ips'] = ''; + +/* +|-------------------------------------------------------------------------- +| FHComplete Build Version +|-------------------------------------------------------------------------- +| +| Version Number of the Current Build +| This is used to invalidate Cache for JS and CSS Files +| +| Example: 2019102901 +*/ +$config['fhcomplete_build_version'] = '2019102903'; diff --git a/application/helpers/hlp_header_helper.php b/application/helpers/hlp_header_helper.php index 611325722..1a0d9dc49 100644 --- a/application/helpers/hlp_header_helper.php +++ b/application/helpers/hlp_header_helper.php @@ -46,13 +46,16 @@ function generateCSSsInclude($CSSs) { $cssLink = ''; + $ci =& get_instance(); + $cachetoken = '?'.$ci->config->item('fhcomplete_build_version'); + if (isset($CSSs)) { $tmpCSSs = is_array($CSSs) ? $CSSs : array($CSSs); for ($tmpCSSsCounter = 0; $tmpCSSsCounter < count($tmpCSSs); $tmpCSSsCounter++) { - $toPrint = sprintf($cssLink, base_url($tmpCSSs[$tmpCSSsCounter])).PHP_EOL; + $toPrint = sprintf($cssLink, base_url($tmpCSSs[$tmpCSSsCounter]).$cachetoken).PHP_EOL; if ($tmpCSSsCounter > 0) $toPrint = "\t\t".$toPrint; @@ -108,13 +111,16 @@ function generateJSsInclude($JSs) { $jsInclude = ''; + $ci =& get_instance(); + $cachetoken = '?'.$ci->config->item('fhcomplete_build_version'); + if (isset($JSs)) { $tmpJSs = is_array($JSs) ? $JSs : array($JSs); for ($tmpJSsCounter = 0; $tmpJSsCounter < count($tmpJSs); $tmpJSsCounter++) { - $toPrint = sprintf($jsInclude, base_url($tmpJSs[$tmpJSsCounter])).PHP_EOL; + $toPrint = sprintf($jsInclude, base_url($tmpJSs[$tmpJSsCounter].$cachetoken)).PHP_EOL; if ($tmpJSsCounter > 0) $toPrint = "\t\t".$toPrint;