abacaphiliac / zend-phpdotenv
ZF2 Module that loads vlucas/phpdotenv
Installs: 32 721
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 3
Open Issues: 2
Requires
Requires (Dev)
This package is auto-updated.
Last update: 2024-12-25 11:02:42 UTC
README
zend-phpdotenv
ZF2 Module that loads vlucas/phpdotenv.
Module attaches a listener to EVENT_LOAD_MODULE
on ModuleManager's EventManager to load environment variables while the module is loaded.
Installation
composer require abacaphiliac/zend-phpdotenv
Usage
- Add
Abacaphiliac\ZendPhpDotEnv
to your ZF2 application module config. - Create a
.env
file in the root directory of your ZF2 application. - Use
getenv()
anywhere in your code (or config) to pull environment variables.
Dependencies
php >=5.3.9 and ZF >=2
See composer.json.
Contributing
composer install && vendor/bin/phing
This library attempts to comply with PSR-1, PSR-2, and PSR-4. If you notice compliance oversights, please send a patch via pull request.