Rename basepath to getBasePath()
This commit is contained in:
parent
6e6fb2de02
commit
0f93a467a7
1 changed files with 16 additions and 16 deletions
32
src/App.php
32
src/App.php
|
@ -187,7 +187,7 @@ class App
|
||||||
*/
|
*/
|
||||||
public function registerStylesheet($path)
|
public function registerStylesheet($path)
|
||||||
{
|
{
|
||||||
$url = str_replace($this->basePath . DIRECTORY_SEPARATOR, '', $path);
|
$url = str_replace($this->getBasePath() . DIRECTORY_SEPARATOR, '', $path);
|
||||||
|
|
||||||
$this->stylesheets[] = trim($url, '/');
|
$this->stylesheets[] = trim($url, '/');
|
||||||
}
|
}
|
||||||
|
@ -204,7 +204,7 @@ class App
|
||||||
*/
|
*/
|
||||||
public function registerFooterScript($path)
|
public function registerFooterScript($path)
|
||||||
{
|
{
|
||||||
$url = str_replace($this->basePath . DIRECTORY_SEPARATOR, '', $path);
|
$url = str_replace($this->getBasePath() . DIRECTORY_SEPARATOR, '', $path);
|
||||||
|
|
||||||
$this->footerScripts[] = trim($url, '/');
|
$this->footerScripts[] = trim($url, '/');
|
||||||
}
|
}
|
||||||
|
@ -236,10 +236,10 @@ class App
|
||||||
$cfgBasePath = $this->config->get('system', 'basepath');
|
$cfgBasePath = $this->config->get('system', 'basepath');
|
||||||
$this->basePath = !empty($cfgBasePath) ? $cfgBasePath : $basePath;
|
$this->basePath = !empty($cfgBasePath) ? $cfgBasePath : $basePath;
|
||||||
|
|
||||||
if (!Core\System::isDirectoryUsable($this->basePath, false)) {
|
if (!Core\System::isDirectoryUsable($this->getBasePath(), false)) {
|
||||||
throw new Exception('Basepath \'' . $this->basePath . '\' isn\'t usable.');
|
throw new Exception('Basepath \'' . $this->getBasePath() . '\' isn\'t usable.');
|
||||||
}
|
}
|
||||||
$this->basePath = rtrim($this->basePath, DIRECTORY_SEPARATOR);
|
$this->basePath = rtrim($this->getBasePath(), DIRECTORY_SEPARATOR);
|
||||||
|
|
||||||
$this->checkBackend($isBackend);
|
$this->checkBackend($isBackend);
|
||||||
$this->checkFriendicaApp();
|
$this->checkFriendicaApp();
|
||||||
|
@ -275,9 +275,9 @@ class App
|
||||||
|
|
||||||
set_include_path(
|
set_include_path(
|
||||||
get_include_path() . PATH_SEPARATOR
|
get_include_path() . PATH_SEPARATOR
|
||||||
. $this->basePath . DIRECTORY_SEPARATOR . 'include' . PATH_SEPARATOR
|
. $this->getBasePath() . DIRECTORY_SEPARATOR . 'include' . PATH_SEPARATOR
|
||||||
. $this->basePath . DIRECTORY_SEPARATOR . 'library' . PATH_SEPARATOR
|
. $this->getBasePath() . DIRECTORY_SEPARATOR . 'library' . PATH_SEPARATOR
|
||||||
. $this->basePath);
|
. $this->getBasePath());
|
||||||
|
|
||||||
if (!empty($_SERVER['QUERY_STRING']) && strpos($_SERVER['QUERY_STRING'], 'pagename=') === 0) {
|
if (!empty($_SERVER['QUERY_STRING']) && strpos($_SERVER['QUERY_STRING'], 'pagename=') === 0) {
|
||||||
$this->query_string = substr($_SERVER['QUERY_STRING'], 9);
|
$this->query_string = substr($_SERVER['QUERY_STRING'], 9);
|
||||||
|
@ -352,10 +352,10 @@ class App
|
||||||
{
|
{
|
||||||
$this->determineURLPath();
|
$this->determineURLPath();
|
||||||
|
|
||||||
$this->getMode()->determine($this->basePath);
|
$this->getMode()->determine($this->getBasePath());
|
||||||
|
|
||||||
if ($this->getMode()->has(App\Mode::DBAVAILABLE)) {
|
if ($this->getMode()->has(App\Mode::DBAVAILABLE)) {
|
||||||
$loader = new ConfigCacheLoader($this->basePath, $this->getMode());
|
$loader = new ConfigCacheLoader($this->getBasePath(), $this->getMode());
|
||||||
$this->config->getCache()->load($loader->loadCoreConfig('addon'), true);
|
$this->config->getCache()->load($loader->loadCoreConfig('addon'), true);
|
||||||
|
|
||||||
$this->profiler->update(
|
$this->profiler->update(
|
||||||
|
@ -363,7 +363,7 @@ class App
|
||||||
$this->config->get('rendertime', 'callstack', false));
|
$this->config->get('rendertime', 'callstack', false));
|
||||||
|
|
||||||
Core\Hook::loadHooks();
|
Core\Hook::loadHooks();
|
||||||
$loader = new ConfigCacheLoader($this->basePath, $this->mode);
|
$loader = new ConfigCacheLoader($this->getBasePath(), $this->mode);
|
||||||
Core\Hook::callAll('load_config', $loader);
|
Core\Hook::callAll('load_config', $loader);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -516,8 +516,8 @@ class App
|
||||||
$this->urlPath = trim($parsed['path'], '\\/');
|
$this->urlPath = trim($parsed['path'], '\\/');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file_exists($this->basePath . '/.htpreconfig.php')) {
|
if (file_exists($this->getBasePath() . '/.htpreconfig.php')) {
|
||||||
include $this->basePath . '/.htpreconfig.php';
|
include $this->getBasePath() . '/.htpreconfig.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Core\Config::get('config', 'hostname') != '') {
|
if (Core\Config::get('config', 'hostname') != '') {
|
||||||
|
@ -914,9 +914,9 @@ class App
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
||||||
$resource = proc_open('cmd /c start /b ' . $cmdline, [], $foo, $this->basePath);
|
$resource = proc_open('cmd /c start /b ' . $cmdline, [], $foo, $this->getBasePath());
|
||||||
} else {
|
} else {
|
||||||
$resource = proc_open($cmdline . ' &', [], $foo, $this->basePath);
|
$resource = proc_open($cmdline . ' &', [], $foo, $this->getBasePath());
|
||||||
}
|
}
|
||||||
if (!is_resource($resource)) {
|
if (!is_resource($resource)) {
|
||||||
Core\Logger::log('We got no resource for command ' . $cmdline, Core\Logger::DEBUG);
|
Core\Logger::log('We got no resource for command ' . $cmdline, Core\Logger::DEBUG);
|
||||||
|
@ -1199,7 +1199,7 @@ class App
|
||||||
$this->module = 'maintenance';
|
$this->module = 'maintenance';
|
||||||
} else {
|
} else {
|
||||||
$this->checkURL();
|
$this->checkURL();
|
||||||
Core\Update::check($this->basePath, false);
|
Core\Update::check($this->getBasePath(), false);
|
||||||
Core\Addon::loadAddons();
|
Core\Addon::loadAddons();
|
||||||
Core\Hook::loadHooks();
|
Core\Hook::loadHooks();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue