Add PUBLIC_* constants to constants.php for easier backwards compatible support of 4.0 and 4.1

This commit is contained in:
Daniel Hensby 2018-01-17 15:16:15 +00:00
parent 6aaee429db
commit 3eaa83ed82
No known key found for this signature in database
GPG Key ID: B00D1E9767F0B06E

View File

@ -22,6 +22,8 @@ use SilverStripe\Core\TempFolder;
* - THEMES_PATH: Absolute filepath, e.g. "/var/www/my-webroot/themes" * - THEMES_PATH: Absolute filepath, e.g. "/var/www/my-webroot/themes"
* - FRAMEWORK_DIR: Path relative to webroot, e.g. "framework" * - FRAMEWORK_DIR: Path relative to webroot, e.g. "framework"
* - FRAMEWORK_PATH:Absolute filepath, e.g. "/var/www/my-webroot/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_DIR: Path relative to webroot, e.g. "framework/thirdparty"
* - THIRDPARTY_PATH: Absolute filepath, e.g. "/var/www/my-webroot/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 // Allow a first class env var to be set that disables .env file loading
if (!Environment::getEnv('SS_IGNORE_DOT_ENV')) { if (!Environment::getEnv('SS_IGNORE_DOT_ENV')) {
call_user_func(function () { call_user_func(function () {