From 2c34af72e18c7ba577591d389ca1eff2c4bc9eaf Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Wed, 23 Aug 2017 14:20:39 +1200 Subject: [PATCH] ENHANCEMENT Log user constants during CI for debugging improvements --- .travis.yml | 3 +++ src/includes/constants.php | 5 ++--- tests/dump_constants.php | 11 +++++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 tests/dump_constants.php diff --git a/.travis.yml b/.travis.yml index 31a59d498..29b699477 100644 --- a/.travis.yml +++ b/.travis.yml @@ -78,6 +78,9 @@ before_script: # Bootstrap dependencies - if [[ $PHPUNIT_TEST == cms ]] || [[ $BEHAT_TEST == cms ]]; then php ./cms/tests/bootstrap/mysite.php; fi +# Log constants to CI for debugging purposes + - php ./tests/dump_constants.php + # Start behat services - if [[ $BEHAT_TEST ]]; then echo 'SS_BASE_URL=http://localhost:8080/' >> .env; fi - if [[ $BEHAT_TEST ]]; then mkdir artifacts; fi diff --git a/src/includes/constants.php b/src/includes/constants.php index 91ce3b9d6..d774de2b3 100644 --- a/src/includes/constants.php +++ b/src/includes/constants.php @@ -2,7 +2,6 @@ use Dotenv\Dotenv; use Dotenv\Exception\InvalidPathException; -use SilverStripe\Control\Util\IPUtils; use SilverStripe\Core\TempFolder; /** @@ -18,14 +17,14 @@ use SilverStripe\Core\TempFolder; * See Director::baseFolder(). Can be overwritten by Config::modify()->set(Director::class, 'alternate_base_folder', ). * - TEMP_FOLDER: Absolute path to temporary folder, used for manifest and template caches. Example: "/var/tmp" * See getTempFolder(). No trailing slash. + * - ASSETS_DIR: Dir for assets folder. e.g. "assets" + * - ASSETS_PATH: Full path to assets folder. e.g. "/var/www/my-webroot/assets" * - THEMES_DIR: Path relative to webroot, e.g. "themes" * - 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" * - THIRDPARTY_DIR: Path relative to webroot, e.g. "framework/thirdparty" * - THIRDPARTY_PATH: Absolute filepath, e.g. "/var/www/my-webroot/framework/thirdparty" - * - TRUSTED_PROXY: true or false, depending on whether the X-Forwarded-* HTTP - * headers from the given client are trustworthy (e.g. from a reverse proxy). */ require_once __DIR__ . '/functions.php'; diff --git a/tests/dump_constants.php b/tests/dump_constants.php new file mode 100644 index 000000000..eaea580ee --- /dev/null +++ b/tests/dump_constants.php @@ -0,0 +1,11 @@ + $value) { + echo " - {$name}: '{$value}'\n"; +} +echo "==============================\n";