diff options
author | andi <andi@splitbrain.org> | 2005-06-05 12:38:42 +0200 |
---|---|---|
committer | andi <andi@splitbrain.org> | 2005-06-05 12:38:42 +0200 |
commit | f62ea8a1d1cf10eddeae777b11420624e111b7ea (patch) | |
tree | 87a15e898308a5de1ef37874645a4cdcb83c707b /inc/init.php | |
parent | 248a73214063d2fe47787c8c4aa292777cddb12b (diff) | |
download | rpg-f62ea8a1d1cf10eddeae777b11420624e111b7ea.tar.gz rpg-f62ea8a1d1cf10eddeae777b11420624e111b7ea.tar.bz2 |
directory layout cleanup !IMPORTANT
This patch changes the directory structure of dokuwiki as suggested
in http://www.freelists.org/archives/dokuwiki/06-2005/msg00045.html
As the changes.log is not managed through darcs you need to move it your
self to the new location in data/changes.log
I think I modified the code at all nessessary places, but I may have
forgotten a few things.
darcs-hash:20050605103842-9977f-af20f63c1d604888375d175d89ac6bd71566d47d.gz
Diffstat (limited to 'inc/init.php')
-rw-r--r-- | inc/init.php | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/inc/init.php b/inc/init.php index 363518b65..dd5614d42 100644 --- a/inc/init.php +++ b/inc/init.php @@ -30,14 +30,14 @@ if(!defined('DOKU_URL')) define('DOKU_URL',getBaseURL(true)); // define Plugin dir - if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'inc/plugins/'); + if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); // define main script if(!defined('DOKU_SCRIPT')) define('DOKU_SCRIPT','doku.php'); // define Template baseURL if(!defined('DOKU_TPL')) define('DOKU_TPL', - DOKU_BASE.'tpl/'.$conf['template'].'/'); + DOKU_BASE.'lib/tpl/'.$conf['template'].'/'); // make session rewrites XHTML compliant @ini_set('arg_separator.output', '&'); @@ -72,16 +72,29 @@ } // make real paths and check them - $conf['datadir'] = realpath($conf['datadir']); + $conf['datadir'] = init_path($conf['datadir']); if(!$conf['datadir']) die('Wrong datadir! Check config!'); - $conf['olddir'] = realpath($conf['olddir']); + $conf['olddir'] = init_path($conf['olddir']); if(!$conf['olddir']) die('Wrong olddir! Check config!'); - $conf['mediadir'] = realpath($conf['mediadir']); + $conf['mediadir'] = init_path($conf['mediadir']); if(!$conf['mediadir']) die('Wrong mediadir! Check config!'); // automatic upgrade to script versions of certain files - scriptify('conf/users.auth'); - scriptify('conf/acl.auth'); + scriptify(DOKU_INC.'conf/users.auth'); + scriptify(DOKU_INC.'conf/acl.auth'); + + +/** + * returns absolute path + * + * This tries the given past first, then checks in DOKU_INC + */ +function init_path($path){ + $p = realpath($path); + if($p) return $p; + $p = realpath(DOKU_INC.$path); + return $p; +} /** * remove magic quotes recursivly @@ -123,6 +136,9 @@ function getBaseURL($abs=false){ $dir = str_replace('\\','/',$dir); #bugfix for weird WIN behaviour $dir = preg_replace('#//+#','/',$dir); + + //handle script in lib/exe dir + $dir = preg_replace('!lib/exe/$!','',$dir); //finish here for relative URLs if(!$abs) return $dir; |