summaryrefslogtreecommitdiff
path: root/inc/init.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/init.php')
-rw-r--r--inc/init.php25
1 files changed, 16 insertions, 9 deletions
diff --git a/inc/init.php b/inc/init.php
index d57e12d7b..a28050736 100644
--- a/inc/init.php
+++ b/inc/init.php
@@ -3,7 +3,9 @@
* Initialize some defaults needed for DokuWiki
*/
-// start timing Dokuwiki execution
+/**
+ * timing Dokuwiki execution
+ */
function delta_time($start=0) {
return microtime(true)-((float)$start);
}
@@ -197,6 +199,10 @@ if (empty($plugin_controller_class)) $plugin_controller_class = 'Doku_Plugin_Con
// load libraries
require_once(DOKU_INC.'inc/load.php');
+// input handle class
+global $INPUT;
+$INPUT = new Input();
+
// initialize plugin controller
$plugin_controller = new $plugin_controller_class();
@@ -233,10 +239,11 @@ function init_paths(){
'lockdir' => 'locks',
'tmpdir' => 'tmp');
- foreach($paths as $c => $p){
- if(empty($conf[$c])) $conf[$c] = $conf['savedir'].'/'.$p;
- $conf[$c] = init_path($conf[$c]);
- if(empty($conf[$c])) nice_die("The $c ('$p') does not exist, isn't accessible or writable.
+ foreach($paths as $c => $p) {
+ $path = empty($conf[$c]) ? $conf['savedir'].'/'.$p : $conf[$c];
+ $conf[$c] = init_path($path);
+ if(empty($conf[$c]))
+ nice_die("The $c ('$p') at $path is not found, isn't accessible or writable.
You should check your config and permission settings.
Or maybe you want to <a href=\"install.php\">run the
installer</a>?");
@@ -265,7 +272,7 @@ function init_lang($langCode) {
}
/**
- * Checks the existance of certain files and creates them if missing.
+ * Checks the existence of certain files and creates them if missing.
*/
function init_files(){
global $conf;
@@ -307,12 +314,12 @@ function init_files(){
* Returns absolute path
*
* This tries the given path first, then checks in DOKU_INC.
- * Check for accessability on directories as well.
+ * Check for accessibility on directories as well.
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
function init_path($path){
- // check existance
+ // check existence
$p = fullpath($path);
if(!@file_exists($p)){
$p = fullpath(DOKU_INC.$path);
@@ -560,7 +567,7 @@ function fullpath($path,$exists=false){
}
$finalpath = $root.implode('/', $newpath);
- // check for existance when needed (except when unit testing)
+ // check for existence when needed (except when unit testing)
if($exists && !defined('DOKU_UNITTEST') && !@file_exists($finalpath)) {
return false;
}