Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pyncerrc/pyncer-dotenv
A phpdotenv implementation to read and write .env values from and to constants.
https://github.com/pyncerrc/pyncer-dotenv
dotenv php pyncer
Last synced: about 1 month ago
JSON representation
A phpdotenv implementation to read and write .env values from and to constants.
- Host: GitHub
- URL: https://github.com/pyncerrc/pyncer-dotenv
- Owner: pyncerrc
- License: unlicense
- Created: 2022-12-18T17:55:37.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-25T15:00:44.000Z (11 months ago)
- Last Synced: 2024-04-26T07:22:21.787Z (9 months ago)
- Topics: dotenv, php, pyncer
- Language: PHP
- Homepage: https://pyncer.com/dotenv
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Pyncer Dotenv
A [phpdotenv](https://github.com/vlucas/phpdotenv) implementation to read and write .env values from and to constants.## Installation
Install via [Composer](https://getcomposer.org):
```bash
$ composer require pyncer/dotenv
```## Example
```php
use Dotenv\Dotenv;
use Dotenv\Repository\RepositoryBuilder;
use Pyncer\Dotenv\ConstAdapter;// ...
$repository = RepositoryBuilder::createWithNoAdapters()
->addAdapter(new ConstAdapter('Vendor\\Namespace'))
->immutable()
->make();$dotenv = Dotenv::create($repository, getcwd());
$dotenv->load();// ...
echo \Vendor\Namespace\MY_ENV_VARIABLE;
```