From c8bbb09431bd7819e045a455a4ec4d85eff781b1 Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Mon, 4 Nov 2013 01:08:27 +0000 Subject: removed deprecated third param of cleanID() --- inc/pageutils.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/inc/pageutils.php b/inc/pageutils.php index 60f326e04..c8d3cf4bb 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -94,9 +94,8 @@ function getID($param='id',$clean=true){ * @author Andreas Gohr * @param string $raw_id The pageid to clean * @param boolean $ascii Force ASCII - * @param boolean $media DEPRECATED */ -function cleanID($raw_id,$ascii=false,$media=false){ +function cleanID($raw_id,$ascii=false){ global $conf; static $sepcharpat = null; -- cgit v1.2.3 From 8c867678811e7f91159175c41ef4722a2fc5308c Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Mon, 4 Nov 2013 01:17:09 +0000 Subject: removed loading of deprecated RTL styles --- inc/config_cascade.php | 3 - inc/farm.php | 2 - inc/preload.php | 154 +++++++++++++++++++++++++++++++++++++++++++++++++ lib/exe/css.php | 15 ----- 4 files changed, 154 insertions(+), 20 deletions(-) create mode 100644 inc/preload.php diff --git a/inc/config_cascade.php b/inc/config_cascade.php index e1ab0eead..2c4f1612b 100644 --- a/inc/config_cascade.php +++ b/inc/config_cascade.php @@ -50,9 +50,6 @@ $config_cascade = array_merge( ), 'userstyle' => array( 'screen' => DOKU_CONF.'userstyle.css', - // @deprecated 2012-04-09: rtl will cease to be a mode of its own, - // please use "[dir=rtl]" in any css file in all, screen or print mode instead - 'rtl' => DOKU_CONF.'userrtl.css', 'print' => DOKU_CONF.'userprint.css', 'feed' => DOKU_CONF.'userfeed.css', 'all' => DOKU_CONF.'userall.css', diff --git a/inc/farm.php b/inc/farm.php index 54692928d..cee61816c 100644 --- a/inc/farm.php +++ b/inc/farm.php @@ -135,9 +135,7 @@ $config_cascade = array( ), ), 'userstyle' => array( - 'default' => DOKU_CONF.'userstyle.css', // 'default' was renamed to 'screen' on 2011-02-26, so will be deprecated in the next version 'screen' => DOKU_CONF.'userstyle.css', - 'rtl' => DOKU_CONF.'userrtl.css', // deprecated since version after 2012-04-09 'print' => DOKU_CONF.'userprint.css', 'feed' => DOKU_CONF.'userfeed.css', 'all' => DOKU_CONF.'userall.css', diff --git a/inc/preload.php b/inc/preload.php new file mode 100644 index 000000000..54f4d4c39 --- /dev/null +++ b/inc/preload.php @@ -0,0 +1,154 @@ + + * @author virtual host part based on conf_path() from Drupal.org's /includes/bootstrap.inc + * (see http://cvs.drupal.org/viewvc/drupal/drupal/includes/bootstrap.inc?view=markup) + */ +function conf_path($farm) { + + if (!$farm) + return DOKU_INC.'conf/'; + + // htacces based + if(isset($_REQUEST['animal'])) { + if(!is_dir($farm.'/'.$_REQUEST['animal'])) nice_die("Sorry! This Wiki doesn't exist!"); + if(!defined('DOKU_FARM')) define('DOKU_FARM', 'htaccess'); + return $farm.'/'.$_REQUEST['animal'].'/conf/'; + } + + // virtual host based + $uri = explode('/', $_SERVER['SCRIPT_NAME'] ? $_SERVER['SCRIPT_NAME'] : $_SERVER['SCRIPT_FILENAME']); + $server = explode('.', implode('.', array_reverse(explode(':', rtrim($_SERVER['HTTP_HOST'], '.'))))); + for ($i = count($uri) - 1; $i > 0; $i--) { + for ($j = count($server); $j > 0; $j--) { + $dir = implode('.', array_slice($server, -$j)) . implode('.', array_slice($uri, 0, $i)); + if(is_dir("$farm/$dir/conf/")) { + if(!defined('DOKU_FARM')) define('DOKU_FARM', 'virtual'); + return "$farm/$dir/conf/"; + } + } + } + + // default conf directory in farm + if(is_dir("$farm/default/conf/")) { + if(!defined('DOKU_FARM')) define('DOKU_FARM', 'default'); + return "$farm/default/conf/"; + } + // farmer + return DOKU_INC.'conf/'; +} + +//echo conf_path($farm); + +/* +$farm = 'W:/www/dokuwiki-farm'; +$farmerURL = 'wiki'; +if ($_SERVER['SERVER_NAME'] != $farmerURL) { + + // don't do anything if the animal doesn't exist + if(!is_dir($farm . '/' . $_SERVER['SERVER_NAME'])) nice_die("Sorry! This Wiki doesn't exist!"); + + if(!defined('DOKU_CONF')) define('DOKU_CONF', $farm . '/' . $_SERVER['SERVER_NAME'] . '/conf/'); +} else { + if(!defined('DOKU_CONF')) define('DOKU_CONF', DOKU_INC . '/conf/'); +} +*/ + + + +require_once @DOKU_INC.'inc/config_cascade.php'; + +$config_cascade = array( + 'main' => array( + 'default' => array(DOKU_INC.'conf/dokuwiki.php'), + 'local' => array(DOKU_CONF.'local.php'), + 'protected' => array(DOKU_CONF.'local.protected.php'), + ), + 'acronyms' => array( + 'default' => array(DOKU_INC.'conf/acronyms.conf'), + 'local' => array(DOKU_CONF.'acronyms.local.conf'), + ), + 'entities' => array( + 'default' => array(DOKU_INC.'conf/entities.conf'), + 'local' => array(DOKU_CONF.'entities.local.conf'), + ), + 'interwiki' => array( + 'default' => array(DOKU_INC.'conf/interwiki.conf'), + 'local' => array(DOKU_CONF.'interwiki.local.conf'), + ), + 'license' => array( + 'default' => array(DOKU_INC.'conf/license.php'), + 'local' => array(DOKU_CONF.'license.local.php'), + ), + 'mediameta' => array( + 'default' => array(DOKU_INC.'conf/mediameta.php'), + 'local' => array(DOKU_CONF.'mediameta.local.php'), + ), + 'mime' => array( + 'default' => array(DOKU_INC.'conf/mime.conf'), + 'local' => array(DOKU_CONF.'mime.local.conf'), + ), + 'scheme' => array( + 'default' => array(DOKU_INC.'conf/scheme.conf'), + 'local' => array(DOKU_CONF.'scheme.local.conf'), + ), + 'smileys' => array( + 'default' => array(DOKU_INC.'conf/smileys.conf'), + 'local' => array(DOKU_CONF.'smileys.local.conf'), + ), + 'wordblock' => array( + 'default' => array(DOKU_INC.'conf/wordblock.conf'), + 'local' => array(DOKU_CONF.'wordblock.local.conf'), + ), + // whatever + 'acl' => array( + 'default' => DOKU_CONF.'acl.auth.php', + ), + 'plainauth.users' => array( + 'default' => DOKU_CONF.'users.auth.php', + ), + 'userstyle' => array( + 'default' => DOKU_CONF.'userstyle.css', + 'print' => DOKU_CONF.'userprint.css', + 'feed' => DOKU_CONF.'userfeed.css', + 'all' => DOKU_CONF.'userall.css', + ), + 'userscript' => array( + 'default' => DOKU_CONF.'userscript.js' + ), + 'plugins' => array( + 'local' => array(DOKU_CONF.'plugins.local.php'), + 'protected' => array( + DOKU_INC.'conf/plugins.required.php', + DOKU_CONF.'plugins.protected.php', + ), + ), + /*'plugins' => array( + 'default' => array(DOKU_CONF.'plugins.php'), + 'local' => array(DOKU_CONF.'plugins.local.php'), + 'protected' => array(DOKU_CONF.'plugins.protected.php'), + ),*/ +); + diff --git a/lib/exe/css.php b/lib/exe/css.php index f0bd24b43..87fb779eb 100644 --- a/lib/exe/css.php +++ b/lib/exe/css.php @@ -84,16 +84,6 @@ function css_out(){ if(isset($config_cascade['userstyle'][$mediatype])){ $files[$mediatype][$config_cascade['userstyle'][$mediatype]] = DOKU_BASE; } - // load rtl styles - // note: this adds the rtl styles only to the 'screen' media type - // @deprecated 2012-04-09: rtl will cease to be a mode of its own, - // please use "[dir=rtl]" in any css file in all, screen or print mode instead - if ($mediatype=='screen') { - if($lang['direction'] == 'rtl'){ - if (isset($styleini['stylesheets']['rtl'])) $files[$mediatype] = array_merge($files[$mediatype], $styleini['stylesheets']['rtl']); - if (isset($config_cascade['userstyle']['rtl'])) $files[$mediatype][$config_cascade['userstyle']['rtl']] = DOKU_BASE; - } - } $cache_files = array_merge($cache_files, array_keys($files[$mediatype])); } @@ -447,11 +437,6 @@ function css_pluginstyles($mediatype='screen'){ $list[DOKU_PLUGIN."$p/style.css"] = DOKU_BASE."lib/plugins/$p/"; $list[DOKU_PLUGIN."$p/style.less"] = DOKU_BASE."lib/plugins/$p/"; } - // @deprecated 2012-04-09: rtl will cease to be a mode of its own, - // please use "[dir=rtl]" in any css file in all, screen or print mode instead - if($lang['direction'] == 'rtl'){ - $list[DOKU_PLUGIN."$p/rtl.css"] = DOKU_BASE."lib/plugins/$p/"; - } } return $list; } -- cgit v1.2.3 From 0045ec49e6995048e7a0057ebd33d4373bf56239 Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Mon, 4 Nov 2013 01:22:10 +0000 Subject: removed deprecated tpl_getFavicon() --- inc/template.php | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/inc/template.php b/inc/template.php index 41f398016..60e178d1a 100644 --- a/inc/template.php +++ b/inc/template.php @@ -1693,18 +1693,6 @@ function tpl_includeFile($file) { } } -/** - * Returns icon from data/media root directory if it exists, otherwise - * the one in the template's image directory. - * - * @deprecated Use tpl_getMediaFile() instead - * @author Anika Henke - */ -function tpl_getFavicon($abs = false, $fileName = 'favicon.ico') { - $look = array(":wiki:$fileName", ":$fileName", "images/$fileName"); - return tpl_getMediaFile($look, $abs); -} - /** * Returns tag for various icon types (favicon|mobile|generic) * -- cgit v1.2.3 From b1f535eb5e822dc2e16f687bb0a69c8643224d87 Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Mon, 4 Nov 2013 01:24:22 +0000 Subject: removed deprecated html_attbuild() --- inc/html.php | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/inc/html.php b/inc/html.php index bbe29e371..7f473cdb6 100644 --- a/inc/html.php +++ b/inc/html.php @@ -27,20 +27,6 @@ function html_wikilink($id,$name=null,$search=''){ return $xhtml_renderer->internallink($id,$name,$search,true,'navigation'); } -/** - * Helps building long attribute lists - * - * @deprecated Use buildAttributes instead - * @author Andreas Gohr - */ -function html_attbuild($attributes){ - $ret = ''; - foreach ( $attributes as $key => $value ) { - $ret .= $key.'="'.formText($value).'" '; - } - return trim($ret); -} - /** * The loginform * -- cgit v1.2.3 From a9d0f1c468fc51bc74c65a9ad127b45f718a9d75 Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Mon, 4 Nov 2013 01:39:18 +0000 Subject: removed deprecated images --- lib/images/_deprecated.txt | 12 +----------- lib/images/arrow_down.gif | Bin 273 -> 0 bytes lib/images/arrow_up.gif | Bin 274 -> 0 bytes lib/images/at.gif | Bin 57 -> 0 bytes lib/images/close.png | Bin 137 -> 0 bytes lib/images/del.png | Bin 355 -> 0 bytes lib/images/edit.gif | Bin 142 -> 0 bytes lib/images/list-minus.gif | Bin 64 -> 0 bytes lib/images/list-plus.gif | Bin 67 -> 0 bytes lib/images/pencil.png | Bin 391 -> 0 bytes 10 files changed, 1 insertion(+), 11 deletions(-) delete mode 100644 lib/images/arrow_down.gif delete mode 100644 lib/images/arrow_up.gif delete mode 100644 lib/images/at.gif delete mode 100644 lib/images/close.png delete mode 100644 lib/images/del.png delete mode 100644 lib/images/edit.gif delete mode 100644 lib/images/list-minus.gif delete mode 100644 lib/images/list-plus.gif delete mode 100644 lib/images/pencil.png diff --git a/lib/images/_deprecated.txt b/lib/images/_deprecated.txt index bccea2049..a347f8b3c 100644 --- a/lib/images/_deprecated.txt +++ b/lib/images/_deprecated.txt @@ -1,12 +1,2 @@ -== @deprecated 2012-10-06 == - -arrow_down.gif -arrow_up.gif -at.gif -close.png -del.png -edit.gif -list-minus.gif -list-plus.gif -pencil.png +(none) diff --git a/lib/images/arrow_down.gif b/lib/images/arrow_down.gif deleted file mode 100644 index ff13b9585..000000000 Binary files a/lib/images/arrow_down.gif and /dev/null differ diff --git a/lib/images/arrow_up.gif b/lib/images/arrow_up.gif deleted file mode 100644 index d491c18db..000000000 Binary files a/lib/images/arrow_up.gif and /dev/null differ diff --git a/lib/images/at.gif b/lib/images/at.gif deleted file mode 100644 index 8bdf40d54..000000000 Binary files a/lib/images/at.gif and /dev/null differ diff --git a/lib/images/close.png b/lib/images/close.png deleted file mode 100644 index 4ccef0603..000000000 Binary files a/lib/images/close.png and /dev/null differ diff --git a/lib/images/del.png b/lib/images/del.png deleted file mode 100644 index e59ded55f..000000000 Binary files a/lib/images/del.png and /dev/null differ diff --git a/lib/images/edit.gif b/lib/images/edit.gif deleted file mode 100644 index a2a23de7b..000000000 Binary files a/lib/images/edit.gif and /dev/null differ diff --git a/lib/images/list-minus.gif b/lib/images/list-minus.gif deleted file mode 100644 index 36902f159..000000000 Binary files a/lib/images/list-minus.gif and /dev/null differ diff --git a/lib/images/list-plus.gif b/lib/images/list-plus.gif deleted file mode 100644 index adc3fac8a..000000000 Binary files a/lib/images/list-plus.gif and /dev/null differ diff --git a/lib/images/pencil.png b/lib/images/pencil.png deleted file mode 100644 index 78142b61e..000000000 Binary files a/lib/images/pencil.png and /dev/null differ -- cgit v1.2.3 From 9b47ccb8d0bb02c6f5a7a67d261a43f0fd31413c Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Mon, 4 Nov 2013 10:42:19 +0000 Subject: deleted wrongly added file --- inc/farm.php | 146 ----------------------------------------------------------- 1 file changed, 146 deletions(-) delete mode 100644 inc/farm.php diff --git a/inc/farm.php b/inc/farm.php deleted file mode 100644 index cee61816c..000000000 --- a/inc/farm.php +++ /dev/null @@ -1,146 +0,0 @@ -/subdir/ will need the subdirectory '$farm/subdir/'. - * * A virtual host based setup needs animal directory names which have to reflect - * the domain name: If an animal resides in http://www.example.org:8080/mysite/test/, - * directories that will match range from '$farm/8080.www.example.org.mysite.test/' - * to a simple '$farm/domain/'. - * - * @author Anika Henke - * @author Michael Klier - * @author Christopher Smith - * @author virtual host part of farm_confpath() based on conf_path() from Drupal.org's /includes/bootstrap.inc - * (see https://github.com/drupal/drupal/blob/7.x/includes/bootstrap.inc#L537) - * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) - */ - -// DOKU_FARMDIR needs to be set in preload.php, here the fallback is the same as DOKU_INC would be (if it was set already) -if(!defined('DOKU_FARMDIR')) define('DOKU_FARMDIR', fullpath(dirname(__FILE__).'/../').'/'); -if(!defined('DOKU_CONF')) define('DOKU_CONF', farm_confpath(DOKU_FARMDIR)); -if(!defined('DOKU_FARM')) define('DOKU_FARM', false); - - -/** - * Find the appropriate configuration directory. - * - * If the .htaccess based setup is used, the configuration directory can be - * any subdirectory of the farm directory. - * - * Otherwise try finding a matching configuration directory by stripping the - * website's hostname from left to right and pathname from right to left. The - * first configuration file found will be used; the remaining will ignored. - * If no configuration file is found, return the default confdir './conf'. - */ -function farm_confpath($farm) { - - // htaccess based or cli - // cli usage example: animal=your_animal bin/indexer.php - if(isset($_REQUEST['animal']) || ('cli' == php_sapi_name() && isset($_SERVER['animal']))) { - $mode = isset($_REQUEST['animal']) ? 'htaccess' : 'cli'; - $animal = $mode == 'htaccess' ? $_REQUEST['animal'] : $_SERVER['animal']; - // check that $animal is a string and just a directory name and not a path - if (!is_string($animal) || strpbrk($animal, '\\/') !== false) - nice_die('Sorry! Invalid animal name!'); - if(!is_dir($farm.'/'.$animal)) - nice_die("Sorry! This Wiki doesn't exist!"); - if(!defined('DOKU_FARM')) define('DOKU_FARM', $mode); - return $farm.'/'.$animal.'/conf/'; - } - - // virtual host based - $uri = explode('/', $_SERVER['SCRIPT_NAME'] ? $_SERVER['SCRIPT_NAME'] : $_SERVER['SCRIPT_FILENAME']); - $server = explode('.', implode('.', array_reverse(explode(':', rtrim($_SERVER['HTTP_HOST'], '.'))))); - for ($i = count($uri) - 1; $i > 0; $i--) { - for ($j = count($server); $j > 0; $j--) { - $dir = implode('.', array_slice($server, -$j)) . implode('.', array_slice($uri, 0, $i)); - if(is_dir("$farm/$dir/conf/")) { - if(!defined('DOKU_FARM')) define('DOKU_FARM', 'virtual'); - return "$farm/$dir/conf/"; - } - } - } - - // default conf directory in farm - if(is_dir("$farm/default/conf/")) { - if(!defined('DOKU_FARM')) define('DOKU_FARM', 'default'); - return "$farm/default/conf/"; - } - // farmer - return DOKU_INC.'conf/'; -} - -/* Use default config files and local animal config files */ -$config_cascade = array( - 'main' => array( - 'default' => array(DOKU_INC.'conf/dokuwiki.php'), - 'local' => array(DOKU_CONF.'local.php'), - 'protected' => array(DOKU_CONF.'local.protected.php'), - ), - 'acronyms' => array( - 'default' => array(DOKU_INC.'conf/acronyms.conf'), - 'local' => array(DOKU_CONF.'acronyms.local.conf'), - ), - 'entities' => array( - 'default' => array(DOKU_INC.'conf/entities.conf'), - 'local' => array(DOKU_CONF.'entities.local.conf'), - ), - 'interwiki' => array( - 'default' => array(DOKU_INC.'conf/interwiki.conf'), - 'local' => array(DOKU_CONF.'interwiki.local.conf'), - ), - 'license' => array( - 'default' => array(DOKU_INC.'conf/license.php'), - 'local' => array(DOKU_CONF.'license.local.php'), - ), - 'mediameta' => array( - 'default' => array(DOKU_INC.'conf/mediameta.php'), - 'local' => array(DOKU_CONF.'mediameta.local.php'), - ), - 'mime' => array( - 'default' => array(DOKU_INC.'conf/mime.conf'), - 'local' => array(DOKU_CONF.'mime.local.conf'), - ), - 'scheme' => array( - 'default' => array(DOKU_INC.'conf/scheme.conf'), - 'local' => array(DOKU_CONF.'scheme.local.conf'), - ), - 'smileys' => array( - 'default' => array(DOKU_INC.'conf/smileys.conf'), - 'local' => array(DOKU_CONF.'smileys.local.conf'), - ), - 'wordblock' => array( - 'default' => array(DOKU_INC.'conf/wordblock.conf'), - 'local' => array(DOKU_CONF.'wordblock.local.conf'), - ), - 'acl' => array( - 'default' => DOKU_CONF.'acl.auth.php', - ), - 'plainauth.users' => array( - 'default' => DOKU_CONF.'users.auth.php', - ), - 'plugins' => array( // needed since Angua - 'default' => array(DOKU_INC.'conf/plugins.php'), - 'local' => array(DOKU_CONF.'plugins.local.php'), - 'protected' => array( - DOKU_INC.'conf/plugins.required.php', - DOKU_CONF.'plugins.protected.php', - ), - ), - 'userstyle' => array( - 'screen' => DOKU_CONF.'userstyle.css', - 'print' => DOKU_CONF.'userprint.css', - 'feed' => DOKU_CONF.'userfeed.css', - 'all' => DOKU_CONF.'userall.css', - ), - 'userscript' => array( - 'default' => DOKU_CONF.'userscript.js' - ), -); -- cgit v1.2.3 From 3f0e8c6cf19f88f23fb4db76b031a92a5951101f Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Mon, 4 Nov 2013 10:44:49 +0000 Subject: deleted another wronlgy added file --- inc/preload.php | 154 -------------------------------------------------------- 1 file changed, 154 deletions(-) delete mode 100644 inc/preload.php diff --git a/inc/preload.php b/inc/preload.php deleted file mode 100644 index 54f4d4c39..000000000 --- a/inc/preload.php +++ /dev/null @@ -1,154 +0,0 @@ - - * @author virtual host part based on conf_path() from Drupal.org's /includes/bootstrap.inc - * (see http://cvs.drupal.org/viewvc/drupal/drupal/includes/bootstrap.inc?view=markup) - */ -function conf_path($farm) { - - if (!$farm) - return DOKU_INC.'conf/'; - - // htacces based - if(isset($_REQUEST['animal'])) { - if(!is_dir($farm.'/'.$_REQUEST['animal'])) nice_die("Sorry! This Wiki doesn't exist!"); - if(!defined('DOKU_FARM')) define('DOKU_FARM', 'htaccess'); - return $farm.'/'.$_REQUEST['animal'].'/conf/'; - } - - // virtual host based - $uri = explode('/', $_SERVER['SCRIPT_NAME'] ? $_SERVER['SCRIPT_NAME'] : $_SERVER['SCRIPT_FILENAME']); - $server = explode('.', implode('.', array_reverse(explode(':', rtrim($_SERVER['HTTP_HOST'], '.'))))); - for ($i = count($uri) - 1; $i > 0; $i--) { - for ($j = count($server); $j > 0; $j--) { - $dir = implode('.', array_slice($server, -$j)) . implode('.', array_slice($uri, 0, $i)); - if(is_dir("$farm/$dir/conf/")) { - if(!defined('DOKU_FARM')) define('DOKU_FARM', 'virtual'); - return "$farm/$dir/conf/"; - } - } - } - - // default conf directory in farm - if(is_dir("$farm/default/conf/")) { - if(!defined('DOKU_FARM')) define('DOKU_FARM', 'default'); - return "$farm/default/conf/"; - } - // farmer - return DOKU_INC.'conf/'; -} - -//echo conf_path($farm); - -/* -$farm = 'W:/www/dokuwiki-farm'; -$farmerURL = 'wiki'; -if ($_SERVER['SERVER_NAME'] != $farmerURL) { - - // don't do anything if the animal doesn't exist - if(!is_dir($farm . '/' . $_SERVER['SERVER_NAME'])) nice_die("Sorry! This Wiki doesn't exist!"); - - if(!defined('DOKU_CONF')) define('DOKU_CONF', $farm . '/' . $_SERVER['SERVER_NAME'] . '/conf/'); -} else { - if(!defined('DOKU_CONF')) define('DOKU_CONF', DOKU_INC . '/conf/'); -} -*/ - - - -require_once @DOKU_INC.'inc/config_cascade.php'; - -$config_cascade = array( - 'main' => array( - 'default' => array(DOKU_INC.'conf/dokuwiki.php'), - 'local' => array(DOKU_CONF.'local.php'), - 'protected' => array(DOKU_CONF.'local.protected.php'), - ), - 'acronyms' => array( - 'default' => array(DOKU_INC.'conf/acronyms.conf'), - 'local' => array(DOKU_CONF.'acronyms.local.conf'), - ), - 'entities' => array( - 'default' => array(DOKU_INC.'conf/entities.conf'), - 'local' => array(DOKU_CONF.'entities.local.conf'), - ), - 'interwiki' => array( - 'default' => array(DOKU_INC.'conf/interwiki.conf'), - 'local' => array(DOKU_CONF.'interwiki.local.conf'), - ), - 'license' => array( - 'default' => array(DOKU_INC.'conf/license.php'), - 'local' => array(DOKU_CONF.'license.local.php'), - ), - 'mediameta' => array( - 'default' => array(DOKU_INC.'conf/mediameta.php'), - 'local' => array(DOKU_CONF.'mediameta.local.php'), - ), - 'mime' => array( - 'default' => array(DOKU_INC.'conf/mime.conf'), - 'local' => array(DOKU_CONF.'mime.local.conf'), - ), - 'scheme' => array( - 'default' => array(DOKU_INC.'conf/scheme.conf'), - 'local' => array(DOKU_CONF.'scheme.local.conf'), - ), - 'smileys' => array( - 'default' => array(DOKU_INC.'conf/smileys.conf'), - 'local' => array(DOKU_CONF.'smileys.local.conf'), - ), - 'wordblock' => array( - 'default' => array(DOKU_INC.'conf/wordblock.conf'), - 'local' => array(DOKU_CONF.'wordblock.local.conf'), - ), - // whatever - 'acl' => array( - 'default' => DOKU_CONF.'acl.auth.php', - ), - 'plainauth.users' => array( - 'default' => DOKU_CONF.'users.auth.php', - ), - 'userstyle' => array( - 'default' => DOKU_CONF.'userstyle.css', - 'print' => DOKU_CONF.'userprint.css', - 'feed' => DOKU_CONF.'userfeed.css', - 'all' => DOKU_CONF.'userall.css', - ), - 'userscript' => array( - 'default' => DOKU_CONF.'userscript.js' - ), - 'plugins' => array( - 'local' => array(DOKU_CONF.'plugins.local.php'), - 'protected' => array( - DOKU_INC.'conf/plugins.required.php', - DOKU_CONF.'plugins.protected.php', - ), - ), - /*'plugins' => array( - 'default' => array(DOKU_CONF.'plugins.php'), - 'local' => array(DOKU_CONF.'plugins.local.php'), - 'protected' => array(DOKU_CONF.'plugins.protected.php'), - ),*/ -); - -- cgit v1.2.3 From 13054fbf5e7e9dd2c2544a358603cd8f195f9996 Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Mon, 4 Nov 2013 10:46:06 +0000 Subject: Revert "deleted wrongly added file" This reverts commit 9b47ccb8d0bb02c6f5a7a67d261a43f0fd31413c. --- inc/farm.php | 146 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 inc/farm.php diff --git a/inc/farm.php b/inc/farm.php new file mode 100644 index 000000000..cee61816c --- /dev/null +++ b/inc/farm.php @@ -0,0 +1,146 @@ +/subdir/ will need the subdirectory '$farm/subdir/'. + * * A virtual host based setup needs animal directory names which have to reflect + * the domain name: If an animal resides in http://www.example.org:8080/mysite/test/, + * directories that will match range from '$farm/8080.www.example.org.mysite.test/' + * to a simple '$farm/domain/'. + * + * @author Anika Henke + * @author Michael Klier + * @author Christopher Smith + * @author virtual host part of farm_confpath() based on conf_path() from Drupal.org's /includes/bootstrap.inc + * (see https://github.com/drupal/drupal/blob/7.x/includes/bootstrap.inc#L537) + * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) + */ + +// DOKU_FARMDIR needs to be set in preload.php, here the fallback is the same as DOKU_INC would be (if it was set already) +if(!defined('DOKU_FARMDIR')) define('DOKU_FARMDIR', fullpath(dirname(__FILE__).'/../').'/'); +if(!defined('DOKU_CONF')) define('DOKU_CONF', farm_confpath(DOKU_FARMDIR)); +if(!defined('DOKU_FARM')) define('DOKU_FARM', false); + + +/** + * Find the appropriate configuration directory. + * + * If the .htaccess based setup is used, the configuration directory can be + * any subdirectory of the farm directory. + * + * Otherwise try finding a matching configuration directory by stripping the + * website's hostname from left to right and pathname from right to left. The + * first configuration file found will be used; the remaining will ignored. + * If no configuration file is found, return the default confdir './conf'. + */ +function farm_confpath($farm) { + + // htaccess based or cli + // cli usage example: animal=your_animal bin/indexer.php + if(isset($_REQUEST['animal']) || ('cli' == php_sapi_name() && isset($_SERVER['animal']))) { + $mode = isset($_REQUEST['animal']) ? 'htaccess' : 'cli'; + $animal = $mode == 'htaccess' ? $_REQUEST['animal'] : $_SERVER['animal']; + // check that $animal is a string and just a directory name and not a path + if (!is_string($animal) || strpbrk($animal, '\\/') !== false) + nice_die('Sorry! Invalid animal name!'); + if(!is_dir($farm.'/'.$animal)) + nice_die("Sorry! This Wiki doesn't exist!"); + if(!defined('DOKU_FARM')) define('DOKU_FARM', $mode); + return $farm.'/'.$animal.'/conf/'; + } + + // virtual host based + $uri = explode('/', $_SERVER['SCRIPT_NAME'] ? $_SERVER['SCRIPT_NAME'] : $_SERVER['SCRIPT_FILENAME']); + $server = explode('.', implode('.', array_reverse(explode(':', rtrim($_SERVER['HTTP_HOST'], '.'))))); + for ($i = count($uri) - 1; $i > 0; $i--) { + for ($j = count($server); $j > 0; $j--) { + $dir = implode('.', array_slice($server, -$j)) . implode('.', array_slice($uri, 0, $i)); + if(is_dir("$farm/$dir/conf/")) { + if(!defined('DOKU_FARM')) define('DOKU_FARM', 'virtual'); + return "$farm/$dir/conf/"; + } + } + } + + // default conf directory in farm + if(is_dir("$farm/default/conf/")) { + if(!defined('DOKU_FARM')) define('DOKU_FARM', 'default'); + return "$farm/default/conf/"; + } + // farmer + return DOKU_INC.'conf/'; +} + +/* Use default config files and local animal config files */ +$config_cascade = array( + 'main' => array( + 'default' => array(DOKU_INC.'conf/dokuwiki.php'), + 'local' => array(DOKU_CONF.'local.php'), + 'protected' => array(DOKU_CONF.'local.protected.php'), + ), + 'acronyms' => array( + 'default' => array(DOKU_INC.'conf/acronyms.conf'), + 'local' => array(DOKU_CONF.'acronyms.local.conf'), + ), + 'entities' => array( + 'default' => array(DOKU_INC.'conf/entities.conf'), + 'local' => array(DOKU_CONF.'entities.local.conf'), + ), + 'interwiki' => array( + 'default' => array(DOKU_INC.'conf/interwiki.conf'), + 'local' => array(DOKU_CONF.'interwiki.local.conf'), + ), + 'license' => array( + 'default' => array(DOKU_INC.'conf/license.php'), + 'local' => array(DOKU_CONF.'license.local.php'), + ), + 'mediameta' => array( + 'default' => array(DOKU_INC.'conf/mediameta.php'), + 'local' => array(DOKU_CONF.'mediameta.local.php'), + ), + 'mime' => array( + 'default' => array(DOKU_INC.'conf/mime.conf'), + 'local' => array(DOKU_CONF.'mime.local.conf'), + ), + 'scheme' => array( + 'default' => array(DOKU_INC.'conf/scheme.conf'), + 'local' => array(DOKU_CONF.'scheme.local.conf'), + ), + 'smileys' => array( + 'default' => array(DOKU_INC.'conf/smileys.conf'), + 'local' => array(DOKU_CONF.'smileys.local.conf'), + ), + 'wordblock' => array( + 'default' => array(DOKU_INC.'conf/wordblock.conf'), + 'local' => array(DOKU_CONF.'wordblock.local.conf'), + ), + 'acl' => array( + 'default' => DOKU_CONF.'acl.auth.php', + ), + 'plainauth.users' => array( + 'default' => DOKU_CONF.'users.auth.php', + ), + 'plugins' => array( // needed since Angua + 'default' => array(DOKU_INC.'conf/plugins.php'), + 'local' => array(DOKU_CONF.'plugins.local.php'), + 'protected' => array( + DOKU_INC.'conf/plugins.required.php', + DOKU_CONF.'plugins.protected.php', + ), + ), + 'userstyle' => array( + 'screen' => DOKU_CONF.'userstyle.css', + 'print' => DOKU_CONF.'userprint.css', + 'feed' => DOKU_CONF.'userfeed.css', + 'all' => DOKU_CONF.'userall.css', + ), + 'userscript' => array( + 'default' => DOKU_CONF.'userscript.js' + ), +); -- cgit v1.2.3