add view_cache_safe() for https://github.com/opnsense/ui_devtools/issues/3 as a result of https://github.com/opnsense/core/issues/2367
This commit is contained in:
parent
4465697f3a
commit
0453bdf58c
|
@ -72,6 +72,21 @@ function view_file_exists($filename)
|
|||
return file_exists($filename);
|
||||
}
|
||||
|
||||
/**
|
||||
* return appended version string with a hash for proper caching for currently installed version
|
||||
* @param string $url to make cache-safe
|
||||
* @return string
|
||||
*/
|
||||
function view_cache_safe($url)
|
||||
{
|
||||
$myview = \Phalcon\DI::getDefault()->get('view');
|
||||
if (!empty($myview->product_hash)) {
|
||||
return "{$url}?v={$myview->product_hash}";
|
||||
}
|
||||
return $url;
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
/**
|
||||
* Read the configuration
|
||||
|
|
Loading…
Reference in New Issue