diff options
author | Gerrit Uitslag <klapinklapin@gmail.com> | 2014-12-09 17:26:28 +0100 |
---|---|---|
committer | Gerrit Uitslag <klapinklapin@gmail.com> | 2014-12-09 17:26:28 +0100 |
commit | 8702de7f7e170bddfdb622c393c3cac3446fd1c5 (patch) | |
tree | c7269ea61f5d4230a6f916dbabee4ce412e0a9fb /inc/init.php | |
parent | 1cc82e5c76ae7fcd646e448404afdc0fd458bf55 (diff) | |
parent | 9a0ca2cfd8ac42895af3be2efbd2cab7e6d33578 (diff) | |
download | rpg-8702de7f7e170bddfdb622c393c3cac3446fd1c5.tar.gz rpg-8702de7f7e170bddfdb622c393c3cac3446fd1c5.tar.bz2 |
Merge remote-tracking branch 'origin/master' into scrutinizerissues
Conflicts:
inc/media.php
inc/plugin.php
inc/template.php
lib/plugins/authplain/_test/escaping.test.php
lib/plugins/syntax.php
Diffstat (limited to 'inc/init.php')
-rw-r--r-- | inc/init.php | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/inc/init.php b/inc/init.php index d825b5250..d0d9101e6 100644 --- a/inc/init.php +++ b/inc/init.php @@ -178,14 +178,6 @@ $_REQUEST = array_merge($_GET,$_POST); // we don't want a purge URL to be digged if(isset($_REQUEST['purge']) && !empty($_SERVER['HTTP_REFERER'])) unset($_REQUEST['purge']); -// disable gzip if not available -if($conf['compression'] == 'bz2' && !function_exists('bzopen')){ - $conf['compression'] = 'gz'; -} -if($conf['compression'] == 'gz' && !function_exists('gzopen')){ - $conf['compression'] = 0; -} - // precalculate file creation modes init_creationmodes(); @@ -201,6 +193,14 @@ if (empty($plugin_controller_class)) $plugin_controller_class = 'Doku_Plugin_Con // load libraries require_once(DOKU_INC.'inc/load.php'); +// disable gzip if not available +if($conf['compression'] == 'bz2' && !function_exists('bzopen')){ + $conf['compression'] = 'gz'; +} +if($conf['compression'] == 'gz' && !function_exists('gzopen')){ + $conf['compression'] = 0; +} + // input handle class global $INPUT; $INPUT = new Input(); @@ -259,17 +259,33 @@ function init_paths(){ $conf['media_changelog'] = $conf['metadir'].'/_media.changes'; } +/** + * Load the language strings + * + * @param string $langCode language code, as passed by event handler + */ function init_lang($langCode) { //prepare language array - global $lang; + global $lang, $config_cascade; $lang = array(); //load the language files require(DOKU_INC.'inc/lang/en/lang.php'); + foreach ($config_cascade['lang']['core'] as $config_file) { + if (@file_exists($config_file . 'en/lang.php')) { + include($config_file . 'en/lang.php'); + } + } + if ($langCode && $langCode != 'en') { if (file_exists(DOKU_INC."inc/lang/$langCode/lang.php")) { require(DOKU_INC."inc/lang/$langCode/lang.php"); } + foreach ($config_cascade['lang']['core'] as $config_file) { + if (@file_exists($config_file . "$langCode/lang.php")) { + include($config_file . "$langCode/lang.php"); + } + } } } |