From d2598603fb586b1323302b9227528b7c9b216ede Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Mon, 28 Nov 2022 04:41:13 -0800 Subject: [PATCH] `@craftcms` alias --- bootstrap/bootstrap.php | 3 ++- src/console/controllers/ServeController.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bootstrap/bootstrap.php b/bootstrap/bootstrap.php index c29de1b3502..3303fb9b4ab 100644 --- a/bootstrap/bootstrap.php +++ b/bootstrap/bootstrap.php @@ -190,13 +190,14 @@ defined('CURLOPT_CONNECTTIMEOUT_MS') || define('CURLOPT_CONNECTTIMEOUT_MS', 156); // Load the files -$cmsPath = $vendorPath . DIRECTORY_SEPARATOR . 'craftcms' . DIRECTORY_SEPARATOR . 'cms'; +$cmsPath = dirname(__DIR__); $libPath = $cmsPath . DIRECTORY_SEPARATOR . 'lib'; $srcPath = $cmsPath . DIRECTORY_SEPARATOR . 'src'; require $libPath . DIRECTORY_SEPARATOR . 'yii2' . DIRECTORY_SEPARATOR . 'Yii.php'; require $srcPath . DIRECTORY_SEPARATOR . 'Craft.php'; // Set aliases +Craft::setAlias('@craftcms', $cmsPath); Craft::setAlias('@root', $rootPath); Craft::setAlias('@lib', $libPath); Craft::setAlias('@craft', $srcPath); diff --git a/src/console/controllers/ServeController.php b/src/console/controllers/ServeController.php index ec136043f1e..73ca0c4568f 100644 --- a/src/console/controllers/ServeController.php +++ b/src/console/controllers/ServeController.php @@ -31,7 +31,7 @@ class ServeController extends BaseServeController /** * @inheritdoc */ - public $router = '@app/../bootstrap/router.php'; + public $router = '@craftcms/bootstrap/router.php'; /** * @inheritdoc