summaryrefslogtreecommitdiff
path: root/inc/init.php
diff options
context:
space:
mode:
authorDominik Eckelmann <deckelmann@gmail.com>2012-03-14 12:52:36 +0100
committerDominik Eckelmann <deckelmann@gmail.com>2012-03-14 12:52:36 +0100
commit3a6d76070be7220b8e5f7c04443aa923bc8cddf2 (patch)
treedfd00b5d0c5f58ee313eb376a8cb1ee99512bf83 /inc/init.php
parent03d7247e047c21d2733f837148a1499f56784ae3 (diff)
parentd0caa5642f6e322a026bd5bdac4585ff1b2f40da (diff)
downloadrpg-3a6d76070be7220b8e5f7c04443aa923bc8cddf2.tar.gz
rpg-3a6d76070be7220b8e5f7c04443aa923bc8cddf2.tar.bz2
Merge branch 'master' of https://github.com/splitbrain/dokuwiki
Conflicts: lib/exe/xmlrpc.php
Diffstat (limited to 'inc/init.php')
-rw-r--r--inc/init.php36
1 files changed, 22 insertions, 14 deletions
diff --git a/inc/init.php b/inc/init.php
index ba62fe079..d57e12d7b 100644
--- a/inc/init.php
+++ b/inc/init.php
@@ -30,8 +30,8 @@ if (!defined('DOKU_E_LEVEL') && @file_exists(DOKU_CONF.'report_e_all')) {
define('DOKU_E_LEVEL', E_ALL);
}
if (!defined('DOKU_E_LEVEL')) {
- if(defined('E_DEPRECATED')){ // since php 5.3
- error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
+ if(defined('E_DEPRECATED')){ // since php 5.3, since php 5.4 E_STRICT is part of E_ALL
+ error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT);
}else{
error_reporting(E_ALL ^ E_NOTICE);
}
@@ -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()
global $license;
$license = array();
@@ -118,11 +108,11 @@ if (!defined('DOKU_COOKIE')) define('DOKU_COOKIE', 'DW'.md5(DOKU_REL.(($conf['se
// define main script
if(!defined('DOKU_SCRIPT')) define('DOKU_SCRIPT','doku.php');
-// define Template baseURL
+// DEPRECATED, use tpl_basedir() instead
if(!defined('DOKU_TPL')) define('DOKU_TPL',
DOKU_BASE.'lib/tpl/'.$conf['template'].'/');
-// define real Template directory
+// DEPRECATED, use tpl_incdir() instead
if(!defined('DOKU_TPLINC')) define('DOKU_TPLINC',
DOKU_INC.'lib/tpl/'.$conf['template'].'/');
@@ -214,6 +204,10 @@ $plugin_controller = new $plugin_controller_class();
global $EVENT_HANDLER;
$EVENT_HANDLER = new Doku_Event_Handler();
+$local = $conf['lang'];
+trigger_event('INIT_LANG_LOAD', $local, 'init_lang', true);
+
+
// setup authentication system
if (!defined('NOSESSION')) {
auth_setup();
@@ -256,6 +250,20 @@ function init_paths(){
$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.
*/