From 6aaee429db69c57f1b9ac0c94bdcfe7f60096ed9 Mon Sep 17 00:00:00 2001 From: Daniel Hensby Date: Wed, 17 Jan 2018 15:15:38 +0000 Subject: [PATCH 1/2] Remove inaccurate comment from constants.php --- src/includes/constants.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/includes/constants.php b/src/includes/constants.php index b560a0521..2002a2321 100644 --- a/src/includes/constants.php +++ b/src/includes/constants.php @@ -8,7 +8,6 @@ use SilverStripe\Core\TempFolder; * This file is the Framework constants bootstrap. It will prepare some basic common constants. * * It takes care of: - * - Normalisation of $_SERVER values * - Initialisation of necessary constants (mostly paths) * * Initialized constants: From 3eaa83ed828ad58e368444ec35553065fc8d3ab9 Mon Sep 17 00:00:00 2001 From: Daniel Hensby Date: Wed, 17 Jan 2018 15:16:15 +0000 Subject: [PATCH 2/2] Add PUBLIC_* constants to constants.php for easier backwards compatible support of 4.0 and 4.1 --- src/includes/constants.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/includes/constants.php b/src/includes/constants.php index 2002a2321..89d386494 100644 --- a/src/includes/constants.php +++ b/src/includes/constants.php @@ -22,6 +22,8 @@ use SilverStripe\Core\TempFolder; * - THEMES_PATH: Absolute filepath, e.g. "/var/www/my-webroot/themes" * - FRAMEWORK_DIR: Path relative to webroot, e.g. "framework" * - FRAMEWORK_PATH:Absolute filepath, e.g. "/var/www/my-webroot/framework" + * - PUBLIC_DIR: Webroot path relative to project root, e.g. "public" or "" + * - PUBLIC_PATH: Absolute path to webroot, e.g. "/var/www/project/public" * - THIRDPARTY_DIR: Path relative to webroot, e.g. "framework/thirdparty" * - THIRDPARTY_PATH: Absolute filepath, e.g. "/var/www/my-webroot/framework/thirdparty" */ @@ -56,6 +58,14 @@ if (!defined('BASE_PATH')) { })); } +// Set public webroot dir / path +if (!defined('PUBLIC_DIR')) { + define('PUBLIC_DIR', ''); +} +if (!defined('PUBLIC_PATH')) { + define('PUBLIC_PATH', BASE_PATH); +} + // Allow a first class env var to be set that disables .env file loading if (!Environment::getEnv('SS_IGNORE_DOT_ENV')) { call_user_func(function () {