-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
I am wondering if it is possible to load a list of key value pairs from an array instead of a file. To explain why I want to do this, i'll explain my use case (basicly caching the config to enable opcache performance gains):
First Request:
- Load/parse .env file normally
- (IF environment = production): Extract config as array (with
toArray()) and store it as php file withvar_export - Populate
$_ENV,$_SERVER, ...
Next Request:
- The .env file isn't parsed because the php-cache file with the array is required instead.
- A DotEnv Loader is created and filled with the variables from the cache file.
- Populate
$_ENV,$_SERVER, ...
-> In both cases i could proceeed the same way, no matter where the variables came from (checking Expections, put them to $_ENV etc.).
Currently I haven't found a way to load the variables from an array to work with them the same way as I do with the .env-loaded variables.
Metadata
Metadata
Assignees
Labels
No labels