Avoid basepath problems
This commit is contained in:
parent
225eea2ca6
commit
7b833834f9
1 changed files with 10 additions and 10 deletions
20
src/App.php
20
src/App.php
|
@ -132,8 +132,14 @@ class App {
|
||||||
|
|
||||||
$hostname = '';
|
$hostname = '';
|
||||||
|
|
||||||
if (file_exists('.htpreconfig.php')) {
|
if (! static::directory_usable($basepath, false)) {
|
||||||
include '.htpreconfig.php';
|
throw new Exception('Basepath ' . $basepath . ' isn\'t usable.');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->basepath = rtrim($basepath, DIRECTORY_SEPARATOR);
|
||||||
|
|
||||||
|
if (file_exists($this->basepath.DIRECTORY_SEPARATOR.'.htpreconfig.php')) {
|
||||||
|
include $this->basepath.DIRECTORY_SEPARATOR.'.htpreconfig.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->timezone = ((x($default_timezone)) ? $default_timezone : 'UTC');
|
$this->timezone = ((x($default_timezone)) ? $default_timezone : 'UTC');
|
||||||
|
@ -201,12 +207,6 @@ class App {
|
||||||
$this->hostname = $hostname;
|
$this->hostname = $hostname;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! static::directory_usable($basepath, false)) {
|
|
||||||
throw new Exception('Basepath ' . $basepath . ' isn\'t usable.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->basepath = rtrim($basepath, DIRECTORY_SEPARATOR);
|
|
||||||
|
|
||||||
set_include_path(
|
set_include_path(
|
||||||
get_include_path() . PATH_SEPARATOR
|
get_include_path() . PATH_SEPARATOR
|
||||||
. $this->basepath . DIRECTORY_SEPARATOR . 'include' . PATH_SEPARATOR
|
. $this->basepath . DIRECTORY_SEPARATOR . 'include' . PATH_SEPARATOR
|
||||||
|
@ -416,8 +416,8 @@ class App {
|
||||||
$this->path = trim($parsed['path'], '\\/');
|
$this->path = trim($parsed['path'], '\\/');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file_exists('.htpreconfig.php')) {
|
if (file_exists($this->basepath.DIRECTORY_SEPARATOR.'.htpreconfig.php')) {
|
||||||
include '.htpreconfig.php';
|
include $this->basepath.DIRECTORY_SEPARATOR.'.htpreconfig.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config::get('config', 'hostname') != '') {
|
if (Config::get('config', 'hostname') != '') {
|
||||||
|
|
Loading…
Reference in a new issue