From 4fcd684a8a5eb25a7c51dfcb55838fbfc523858f Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Sun, 15 Jan 2012 11:30:38 +0100 Subject: Disable E_STRICT error reporting This change disables the reporting of strict standard errors in PHP 5.4, in PHP versions prior to 5.4 E_STRICT wasn't part of E_ALL so for these versions this doesn't cause any change (however E_STRICT is available in all versions of PHP 5 so this doesn't cause any problems). See also FS#2427. --- inc/init.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'inc/init.php') diff --git a/inc/init.php b/inc/init.php index b3acf2e33..14660b8d0 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); } -- cgit v1.2.3 From 6d06b26afab712379b6d070a816f0c71cc76753b Mon Sep 17 00:00:00 2001 From: Dominik Eckelmann Date: Tue, 24 Jan 2012 14:30:34 +0100 Subject: added INIT_LANG_LOAD event --- inc/init.php | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'inc/init.php') diff --git a/inc/init.php b/inc/init.php index 14660b8d0..130746f20 100644 --- a/inc/init.php +++ b/inc/init.php @@ -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(); @@ -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. */ -- cgit v1.2.3 From c4766956646b53ab644ec6ddbd17d9cba07cf872 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Mon, 30 Jan 2012 20:38:41 +0100 Subject: DOKU_TPL* considered harmful Some plugins want to dynamically switch the template based on users, namspaces or the phase of the moon. Having fixed paths in a unchangable constant prevents this. This changes deprecates the DOKU_TPL* constants in favor of two new tpl_* functions that return the correct paths based on the $conf variables which can be changed from the DOKUWIKI_STARTED event. --- inc/init.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'inc/init.php') diff --git a/inc/init.php b/inc/init.php index 14660b8d0..3aab0587b 100644 --- a/inc/init.php +++ b/inc/init.php @@ -118,11 +118,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'].'/'); -- cgit v1.2.3