generated from yiisoft/package-template
-
-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use env variables instead of constants #193
Merged
Changes from 17 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
ab3b3f1
Use env variables instead of constants
rustamwin 988c260
Hotfix
rustamwin 1522bcd
Fixes
rustamwin ce94887
Fix CS
rustamwin de45595
Improve
vjik cb52b78
Adopt to new `yiisoft/view` and `yiisoft/yii-view` (#194)
vjik 5e573b8
Minor improvements in runners + Fix type of `YII_DEBUG` + Add entry p…
vjik b933b1d
Use env variables instead of constants
rustamwin 2969e5e
Hotfix
rustamwin dcb724f
Fixes
rustamwin 1a35fe3
Fix CS
rustamwin 497fb58
Improve
vjik e1a51d0
Merge remote-tracking branch 'origin/env' into env
rustamwin 31f4403
Improvements
rustamwin f283ca5
Apply fixes from StyleCI
samdark 21c4165
Fix psalm
rustamwin 0dee097
Merge remote-tracking branch 'origin/env' into env
rustamwin 2178c1a
Fix psalm, improve entrypoint
rustamwin fd8a756
Update psalm.xml
rustamwin 39157c0
Update yii
rustamwin 69efdd6
Rename bootstrap.php to preload.php
rustamwin bb17a48
Merge remote-tracking branch 'origin/env' into env
rustamwin 61f9cbe
Fix psalm
rustamwin 4ab2f7e
Adjustments
rustamwin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
YII_ENV= | ||
YII_DEBUG=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
rustamwin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
declare(strict_types=1); | ||
|
||
use Dotenv\Dotenv; | ||
|
||
$dotenv = Dotenv::createImmutable(__DIR__); | ||
$dotenv->load(); | ||
|
||
$_ENV['YII_ENV'] = empty($_ENV['YII_ENV']) ? null : (string)$_ENV['YII_ENV']; | ||
$_SERVER['YII_ENV'] = $_ENV['YII_ENV']; | ||
|
||
$_ENV['YII_DEBUG'] = filter_var( | ||
!empty($_ENV['YII_DEBUG']) ? $_ENV['YII_DEBUG'] : true, | ||
FILTER_VALIDATE_BOOLEAN, | ||
FILTER_NULL_ON_FAILURE | ||
) ?? true; | ||
$_SERVER['YII_DEBUG'] = $_ENV['YII_DEBUG']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about proving a default value here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default value is '/'. See config plugin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's usually not only config environment.