diff --git a/modules/backend/classes/BackendController.php b/modules/backend/classes/BackendController.php index 818828e2d..75decc64d 100644 --- a/modules/backend/classes/BackendController.php +++ b/modules/backend/classes/BackendController.php @@ -62,7 +62,7 @@ class BackendController extends ControllerBase if ($controllerObj = $this->findController( $controllerClass, $action, - Config::get('cms.pluginsDir', '/plugins') + plugins_path() )) { return $controllerObj->run($action, $controllerParams); } @@ -81,14 +81,17 @@ class BackendController extends ControllerBase * @param string $action Specifies a method name to execute. * @return ControllerBase Returns the backend controller object */ - protected function findController($controller, $action, $dirPrefix = null) + protected function findController($controller, $action, $inPath = null) { /* * Workaround: Composer does not support case insensitivity. */ if (!class_exists($controller)) { + if (!$inPath) { + $inPath = base_path(); + } $controller = Str::normalizeClassName($controller); - $controllerFile = PATH_BASE.$dirPrefix.strtolower(str_replace('\\', '/', $controller)) . '.php'; + $controllerFile = $inPath.strtolower(str_replace('\\', '/', $controller)) . '.php'; if ($controllerFile = File::existsInsensitive($controllerFile)) { include_once($controllerFile); } diff --git a/modules/backend/classes/Skin.php b/modules/backend/classes/Skin.php index 13fc1ccf8..47facbaac 100644 --- a/modules/backend/classes/Skin.php +++ b/modules/backend/classes/Skin.php @@ -48,7 +48,7 @@ abstract class Skin */ public function __construct() { - $this->defaultSkinPath = PATH_BASE . '/modules/backend'; + $this->defaultSkinPath = base_path() . '/modules/backend'; /* * Guess the skin path diff --git a/modules/backend/controllers/index/_warnings.htm b/modules/backend/controllers/index/_warnings.htm index 5a058d578..d2965ced0 100644 --- a/modules/backend/controllers/index/_warnings.htm +++ b/modules/backend/controllers/index/_warnings.htm @@ -1,21 +1,19 @@ extension_loaded('gd'), @@ -26,7 +24,7 @@ $requiredExtensions = [ ]; foreach ($writablePaths as $path) { - if (!is_writable(PATH_BASE.$path)) + if (!is_writable($path)) $warnings[] = Lang::get('backend::lang.warnings.permissions', ['name' => ''.$path.'']); } foreach ($requiredExtensions as $extension => $installed) { diff --git a/modules/cms/classes/ComponentBase.php b/modules/cms/classes/ComponentBase.php index 1c6dcd60b..41cfeef3d 100644 --- a/modules/cms/classes/ComponentBase.php +++ b/modules/cms/classes/ComponentBase.php @@ -108,7 +108,7 @@ abstract class ComponentBase extends Extendable */ public function getPath() { - return base_path().Config::get('cms.pluginsDir').$this->dirName; + return plugins_path().$this->dirName; } /** diff --git a/modules/system/classes/PluginManager.php b/modules/system/classes/PluginManager.php index 28b2f88ab..66bbeae8e 100644 --- a/modules/system/classes/PluginManager.php +++ b/modules/system/classes/PluginManager.php @@ -201,14 +201,6 @@ class PluginManager $this->booted = true; } - /** - * Returns the absolute plugin path. - */ - public function getPath() - { - return base_path() . Config::get('cms.pluginsDir'); - } - /** * Returns the directory path to a plugin */ @@ -306,7 +298,7 @@ class PluginManager { $plugins = []; - $dirPath = $this->getPath(); + $dirPath = plugins_path(); if (!File::isDirectory($dirPath)) { return $plugins; } diff --git a/storage/cms/.gitignore b/storage/cms/.gitignore index 1670e9066..978564824 100644 --- a/storage/cms/.gitignore +++ b/storage/cms/.gitignore @@ -1,6 +1 @@ -config.php -routes.php -compiled.php -services.json -events.scanned.php -routes.scanned.php +disabled.json