Skip to content
Snippets Groups Projects
Commit 9189204a authored by Andreas Gohr's avatar Andreas Gohr
Browse files

Merge branch 'jscachekey'

* jscachekey:
  trigger JS_CACHE_USE in lib/exe/js.php
  added INIT_LANG_LOAD event
  let js.php use multiple caches
parents 50fbf1b6 e67004f5
No related branches found
No related tags found
No related merge requests found
...@@ -69,16 +69,6 @@ foreach (array('default','local','protected') as $config_group) { ...@@ -69,16 +69,6 @@ foreach (array('default','local','protected') as $config_group) {
} }
} }
//prepare language array
global $lang;
$lang = array();
//load the language files
require_once(DOKU_INC.'inc/lang/en/lang.php');
if ( $conf['lang'] && $conf['lang'] != 'en' ) {
require_once(DOKU_INC.'inc/lang/'.$conf['lang'].'/lang.php');
}
//prepare license array() //prepare license array()
global $license; global $license;
$license = array(); $license = array();
...@@ -214,6 +204,10 @@ $plugin_controller = new $plugin_controller_class(); ...@@ -214,6 +204,10 @@ $plugin_controller = new $plugin_controller_class();
global $EVENT_HANDLER; global $EVENT_HANDLER;
$EVENT_HANDLER = new Doku_Event_Handler(); $EVENT_HANDLER = new Doku_Event_Handler();
$local = $conf['lang'];
trigger_event('INIT_LANG_LOAD', $local, 'init_lang', true);
// setup authentication system // setup authentication system
if (!defined('NOSESSION')) { if (!defined('NOSESSION')) {
auth_setup(); auth_setup();
...@@ -256,6 +250,20 @@ function init_paths(){ ...@@ -256,6 +250,20 @@ function init_paths(){
$conf['media_changelog'] = $conf['metadir'].'/_media.changes'; $conf['media_changelog'] = $conf['metadir'].'/_media.changes';
} }
function init_lang($langCode) {
//prepare language array
global $lang;
$lang = array();
//load the language files
require_once(DOKU_INC.'inc/lang/en/lang.php');
if ($langCode && $langCode != 'en') {
if (file_exists(DOKU_INC."inc/lang/$langCode/lang.php")) {
require_once(DOKU_INC."inc/lang/$langCode/lang.php");
}
}
}
/** /**
* Checks the existance of certain files and creates them if missing. * Checks the existance of certain files and creates them if missing.
*/ */
......
...@@ -32,8 +32,8 @@ function js_out(){ ...@@ -32,8 +32,8 @@ function js_out(){
global $config_cascade; global $config_cascade;
// The generated script depends on some dynamic options // The generated script depends on some dynamic options
$cache = new cache('scripts'.$_SERVER['HTTP_HOST'].$_SERVER['SERVER_PORT'], $cache = new cache('scripts'.$_SERVER['HTTP_HOST'].$_SERVER['SERVER_PORT'],'.js');
'.js'); $cache->_event = 'JS_CACHE_USE';
// load minified version for some files // load minified version for some files
$min = $conf['compress'] ? '.min' : ''; $min = $conf['compress'] ? '.min' : '';
...@@ -79,8 +79,8 @@ function js_out(){ ...@@ -79,8 +79,8 @@ function js_out(){
// check cache age & handle conditional request // check cache age & handle conditional request
// This may exit if a cache can be used // This may exit if a cache can be used
http_cached($cache->cache, $cache_ok = $cache->useCache(array('files' => $cache_files));
$cache->useCache(array('files' => $cache_files))); http_cached($cache->cache, $cache_ok);
// start output buffering and build the script // start output buffering and build the script
ob_start(); ob_start();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment