Searched hist:"04 dc6bd5ea109d147325d067c41825ebd6997604" (Results 1 – 1 of 1) sorted by relevance
| /plugin/farmer/ |
| H A D | DokuWikiFarmCore.php | 04dc6bd5ea109d147325d067c41825ebd6997604 Fri Sep 21 11:02:29 UTC 2018 Szymon Olewniczak <solewniczak@rid.pl> quite unusual use case but maybe it'll be useful for you too.
I run the following script by php-cli:
``` <?php
//include base config $inc = realpath(__DIR__.'/../../..'); define('DOKU_INC', $inc.'/');
// load and initialize the core system require_once(DOKU_INC.'inc/init.php');
//... ```
The script requires the dokuwiki DOKU_URL to be set properly but getBaseURL function in inc/init.php leads to bad results when $conf['baseurl'] isn't set:
``` function getBaseURL($abs=null){ global $conf; //if canonical url enabled always return absolute if(is_null($abs)) $abs = $conf['canonical'];
if(!empty($conf['basedir'])){ $dir = $conf['basedir']; }elseif(substr($_SERVER['SCRIPT_NAME'],-4) == '.php'){ $dir = dirname($_SERVER['SCRIPT_NAME']); // <- this is wrong when run on command line } ```
This commits fixes that behaviour for host based animal setup.
|