From 7f2c3b674bd81ae9e8b9d8382815c9139ae3d7db Mon Sep 17 00:00:00 2001 From: elitasson Date: Wed, 27 Aug 2014 09:29:26 +0200 Subject: [PATCH 1/4] bugfix for when file is called from another path --- config.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config.php b/config.php index 8fb52c6..7655b53 100644 --- a/config.php +++ b/config.php @@ -3,6 +3,8 @@ /* NOTE! User configuration is now added in `config.local.php`. See * `config.default.php` for help. */ +chdir(dirname(__FILE__)); + require('config.default.php'); if ( file_exists('config.local.php') ){ require('config.local.php'); From de7235f1544caf501559d757da480b72a0788263 Mon Sep 17 00:00:00 2001 From: elitasson Date: Thu, 28 Aug 2014 21:33:01 +0200 Subject: [PATCH 2/4] new approach --- config.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config.php b/config.php index 7655b53..541e3c7 100644 --- a/config.php +++ b/config.php @@ -3,11 +3,11 @@ /* NOTE! User configuration is now added in `config.local.php`. See * `config.default.php` for help. */ -chdir(dirname(__FILE__)); +$baseurl = dirname(path)(__FILE__); -require('config.default.php'); -if ( file_exists('config.local.php') ){ - require('config.local.php'); +require($baseurl . '/config.default.php'); +if ( file_exists($baseurl . '/config.local.php') ){ + require($baseurl . '/config.local.php'); } if ( substr($root, 0, 1) != '/' ) $root = "/$root"; /* force leading slash */ From fd4ffa80358d5cbbf257a30e9d94fad894254f7e Mon Sep 17 00:00:00 2001 From: elitasson Date: Thu, 28 Aug 2014 21:35:01 +0200 Subject: [PATCH 3/4] typo --- config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.php b/config.php index 541e3c7..32eea7d 100644 --- a/config.php +++ b/config.php @@ -3,7 +3,7 @@ /* NOTE! User configuration is now added in `config.local.php`. See * `config.default.php` for help. */ -$baseurl = dirname(path)(__FILE__); +$baseurl = dirname(__FILE__); require($baseurl . '/config.default.php'); if ( file_exists($baseurl . '/config.local.php') ){ From 03bbf6577838b9aacf18900674e9ae33795af080 Mon Sep 17 00:00:00 2001 From: elitasson Date: Sat, 30 Aug 2014 17:56:00 +0200 Subject: [PATCH 4/4] new variable name --- config.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config.php b/config.php index 32eea7d..6f46502 100644 --- a/config.php +++ b/config.php @@ -3,11 +3,11 @@ /* NOTE! User configuration is now added in `config.local.php`. See * `config.default.php` for help. */ -$baseurl = dirname(__FILE__); +$basedir = dirname(__FILE__); -require($baseurl . '/config.default.php'); -if ( file_exists($baseurl . '/config.local.php') ){ - require($baseurl . '/config.local.php'); +require($basedir . '/config.default.php'); +if ( file_exists($basedir . '/config.local.php') ){ + require($basedir . '/config.local.php'); } if ( substr($root, 0, 1) != '/' ) $root = "/$root"; /* force leading slash */