Skip to content

Commit

Permalink
Merge pull request #12 from fr3nch13/dev
Browse files Browse the repository at this point in the history
Fallback to ROOT constant.
  • Loading branch information
fr3nch13 authored Jun 12, 2023
2 parents 3adc06a + 7f8bf0f commit 126a09e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"cs-check": "php -d memory_limit=-1 ./vendor/bin/phpcs --colors -p -s --extensions=php ./src ./tests",
"cs-checkstyle": "php -d memory_limit=-1 ./vendor/bin/phpcs --report=checkstyle --extensions=php ./src ./tests",
"cs-fix": "php -d memory_limit=-1 ./vendor/bin/phpcbf --colors --extensions=php ./src ./tests",
"phpstan": "php -d memory_limit=-1 ./vendor/bin/phpstan --no-progress -vvv --xdebug",
"phpstan": "php -d memory_limit=-1 ./vendor/bin/phpstan --no-progress -vvv",
"phpstan-github": "php -d memory_limit=-1 ./vendor/bin/phpstan --no-progress -vvv --error-format=github",
"test": "php -d memory_limit=-1 ./vendor/bin/phpunit --colors=always --testdox",
"coverage": "php -d memory_limit=-1 -d xdebug.mode=coverage ./vendor/bin/phpunit --log-junit tmp/coverage/unitreport.xml --coverage-html tmp/coverage --testdox",
Expand Down
4 changes: 3 additions & 1 deletion src/View/Helper/VersionsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ public function __construct(View $View, array $config = [])
throw new \Exception(__('Unable to find the `git` command.'));
}
}
$rootDir = getenv('LOCK_DIR') ? getenv('LOCK_DIR') : getenv('ROOT');
// use an environment vairable if set like in config/.env
// otherwise use the constant ROOT from the source application
$rootDir = getenv('LOCK_DIR') ? getenv('LOCK_DIR') : (getenv('ROOT') ?: ROOT);
if (isset($config['rootDir'])) {
$rootDir = $config['rootDir'];
}
Expand Down

0 comments on commit 126a09e

Please sign in to comment.