Differences
This shows you the differences between two versions of the page.
code:dokuwiki-sql [2020/02/12 21:48] 84.186.32.111 created |
code:dokuwiki-sql [2020/02/12 21:53] (current) 84.186.32.111 |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | sample preload.php snippet | ||
+ | <file php preload.php> | ||
+ | $http_host = $_SERVER['HTTP_HOST']; | ||
+ | if( strpos( $http_host, ':' ) !== false ) { | ||
+ | list( $http_host, $http_port ) = explode( ':', $http_host ); | ||
+ | } | ||
+ | $animal = str_replace( 'www.', '', $http_host ); | ||
+ | $request_id = $_SERVER['REQUEST_URI']; | ||
+ | |||
+ | require_once( $farmbasedir.'/conf/animal_alias.php' ); // normalizes animal names and stuff | ||
+ | |||
+ | $farmdir = "$farmbasedir/domains/$animal/"; | ||
+ | if( !$animal || !is_dir( $farmdir )) { | ||
+ | $animal = $farmer; | ||
+ | $farmdir = "$farmbasedir/domains/$animal/"; } | ||
+ | |||
+ | if( !is_dir( $farmdir )) { die( 'nofarm' ); } | ||
+ | define( 'FARMDIR', $farmdir ); | ||
+ | |||
+ | if( !defined( 'DOKU_CONF' )) define( 'DOKU_CONF', DOKU_FARMDIR.'/'.$animal.'/conf/' ); | ||
+ | if( !defined( 'ACL_DOM' )) define( 'ACL_DOM', $animal ); // for auth psql in .protected.php | ||
+ | if( !defined( 'ACL_TOPDOM' )) define( 'ACL_TOPDOM', 'notomorrow.de' ); // for auth psql in .protected.php | ||
+ | |||
+ | if( !defined( 'DOKU_CONF_DEFAULT' )) define( 'DOKU_CONF_DEFAULT', $farmbasedir.'/dokuwiki/conf/' ); | ||
+ | if( !defined( 'DOKU_CONF' )) define( 'DOKU_CONF', $farmdir.'conf/' ); | ||
+ | |||
+ | require_once( $farmbasedir.'/dokuwiki/inc/config_cascade.php' ); | ||
+ | require_once( $farmbasedir.'/conf/cascade.php' ); | ||
+ | |||
+ | </file> | ||
+ | |||
+ | sample farm.protected.php snippet | ||
<code php> | <code php> | ||
$conf['plugin']['authpgsql']['checkPass'] = "SELECT pass | $conf['plugin']['authpgsql']['checkPass'] = "SELECT pass |