mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-26 09:53:34 +03:00
Added asset_helper file and cache busting token config.
This commit is contained in:
parent
e0f49c1d54
commit
3bc482adf4
2 changed files with 41 additions and 0 deletions
|
@ -262,6 +262,18 @@ $config['log_date_format'] = 'Y-m-d H:i:s';
|
||||||
*/
|
*/
|
||||||
$config['cache_path'] = __DIR__ . '/../../storage/cache/';
|
$config['cache_path'] = __DIR__ . '/../../storage/cache/';
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Cache Busting Token
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This token will be appending to asset URLs in order to invalidate the browser
|
||||||
|
| cache and enforce end clients to fetch new files. Update the token with each
|
||||||
|
| new release.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
$config['cache_busting_token'] = 'dfsg8s09df8g098';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Encryption Key
|
| Encryption Key
|
||||||
|
|
29
src/application/helpers/asset_helper.php
Normal file
29
src/application/helpers/asset_helper.php
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
<?php defined('BASEPATH') OR exit('No direct script access allowed');
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------------
|
||||||
|
* Easy!Appointments - Open Source Web Scheduler
|
||||||
|
*
|
||||||
|
* @package EasyAppointments
|
||||||
|
* @author A.Tselegidis <alextselegidis@gmail.com>
|
||||||
|
* @copyright Copyright (c) 2013 - 2017, Alex Tselegidis
|
||||||
|
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3
|
||||||
|
* @link http://easyappointments.org
|
||||||
|
* @since v1.3.0
|
||||||
|
* ---------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Assets URL helper function.
|
||||||
|
*
|
||||||
|
* This function will create an asset file URL that includes a cache busting parameter in order
|
||||||
|
* to invalidate the browser cache in case of an update.
|
||||||
|
*
|
||||||
|
* @param string $uri Relative URI (just like the one used in the base_url helper).
|
||||||
|
* @param string|null $protocol Valid URI protocol.
|
||||||
|
*
|
||||||
|
* @return string Returns the final asset URL.
|
||||||
|
*/
|
||||||
|
function asset_url($uri = '', $protocol = NULL) {
|
||||||
|
$ci =& get_instance();
|
||||||
|
|
||||||
|
return base_url($uri . '?' . $ci->config->item('cache_busting_token'), $protocol);
|
||||||
|
}
|
Loading…
Reference in a new issue