You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
phpdotenv doesn't always work. Env variables sometimes return null on page load. Laravel has also stopped using phpdotenv variable loading for this particular reason. See issues: vlucas/phpdotenv#109 vlucas/phpdotenv#76 (comment)
I think we should use Yii2's BootstrapInterface to load global variables. It's good to use as many 'vanilla' Yii2 features as possible to decrease dependencies on third party packages, and it will work 100% of the time rather than 90% of the time compared to phpdotenv.
We can't use yii bootstrap process here, because it is invoked after config file has been loaded.
We need our settings inside config file, so they should be set before execution enters it.
@trntv Good point. Dotenv also appears to work properly when on a webserver. It only has issues locally. Is there some sort of fix we can implement i.e. setting a timeout or refresh period until dotenv is read?
Suggested solution for the issue reported at #377
phpdotenv
doesn't always work. Env variables sometimes return null on page load. Laravel has also stopped using phpdotenv variable loading for this particular reason. See issues:vlucas/phpdotenv#109
vlucas/phpdotenv#76 (comment)
I think we should use Yii2's
BootstrapInterface
to load global variables. It's good to use as many 'vanilla' Yii2 features as possible to decrease dependencies on third party packages, and it will work 100% of the time rather than 90% of the time compared to phpdotenv.See top answer for integration: http://stackoverflow.com/questions/27778477/how-to-make-custom-settings-data-available-globally-in-yii-2
The text was updated successfully, but these errors were encountered: