Get the URL for the cached fileThis automatically registers the view with Elgg's simplecache.
$blog_js = elgg_get_simplecache_url('js', 'blog/save_draft');
elgg_register_js('elgg.blog', $blog_js);
elgg_load_js('elgg.blog');
- Parameters
-
string | $type | The file type: css or js |
string | $view | The view name after css/ or js/ |
- Returns
- string
- Since
- 1.8.0
<?php
static $FILE_PATH_CACHE;
if (!$FILE_PATH_CACHE) {
$FILE_PATH_CACHE =
new ElggFileCache($CONFIG->dataroot .
'system_cache/');
}
return $FILE_PATH_CACHE;
}
$cache->clear();
}
if ($CONFIG->system_cache_enabled) {
}
return false;
}
if ($CONFIG->system_cache_enabled) {
$cached_data = $cache->load(
$type);
if ($cached_data) {
return $cached_data;
}
}
return null;
}
$CONFIG->system_cache_enabled = 1;
}
$CONFIG->system_cache_enabled = 0;
}
}
}
}
} else {
}
}
if (preg_match(
'~(?:^|/)(css|js)(?:$|/)~',
$view,
$m)) {
} else {
return 'unknown';
}
}
}
}
}
}
$files = array_diff(scandir($dir), array(
'.',
'..'));
if (is_dir("$dir/$file")) {
} else {
unlink("$dir/$file");
}
}
return rmdir($dir);
}
if (!isset($CONFIG->views->simplecache) || !is_array($CONFIG->views->simplecache)) {
return false;
}
mkdir("{$CONFIG->dataroot}views_simplecache");
$time = time();
$CONFIG->lastcache = $time;
return true;
}
$CONFIG->system_cache_loaded = false;
$CONFIG->views = new stdClass();
return;
}
$CONFIG->views->locations = unserialize(
$data);
return;
}
$CONFIG->view_types = unserialize(
$data);
$CONFIG->system_cache_loaded = true;
}
if (!defined('UPGRADING') && empty($CONFIG->lastcache)) {
$CONFIG->lastcache = (int)
datalist_get(
'simplecache_lastupdate');
}
if ($CONFIG->system_cache_enabled && !$CONFIG->system_cache_loaded) {
}
if ($CONFIG->system_cache_enabled && !$CONFIG->i18n_loaded_from_cache) {
foreach ($CONFIG->translations as
$lang => $map) {
}
}
}