Skip to content
Snippets Groups Projects
Commit 0990161c authored by Michael Hamann's avatar Michael Hamann
Browse files

Add cli support to farm implementation

Now the animal can be specified in the animal environment variable.
parent 33df55c7
No related branches found
No related tags found
No related merge requests found
......@@ -41,12 +41,15 @@ if(!defined('DOKU_FARM')) define('DOKU_FARM', false);
*/
function conf_path($farm) {
// htaccess based
if(isset($_REQUEST['animal'])) {
if(!is_dir($farm.'/'.$_REQUEST['animal']))
// 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'];
if(!is_dir($farm.'/'.$animal))
nice_die("Sorry! This Wiki doesn't exist!");
if(!defined('DOKU_FARM')) define('DOKU_FARM', 'htaccess');
return $farm.'/'.$_REQUEST['animal'].'/conf/';
if(!defined('DOKU_FARM')) define('DOKU_FARM', $mode);
return $farm.'/'.$animal.'/conf/';
}
// virtual host based
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment