Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ytake/hackdotenv
Loads environment vars from .env to getenv().
https://github.com/ytake/hackdotenv
dotenv hacklang hhvm
Last synced: 9 days ago
JSON representation
Loads environment vars from .env to getenv().
- Host: GitHub
- URL: https://github.com/ytake/hackdotenv
- Owner: ytake
- License: mit
- Created: 2018-09-07T08:17:09.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-03T00:20:59.000Z (over 4 years ago)
- Last Synced: 2024-10-05T22:02:48.121Z (3 months ago)
- Topics: dotenv, hacklang, hhvm
- Language: Hack
- Homepage:
- Size: 109 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hack Dotenv
Loads environment variables from .env to getenv().
[![Build Status](https://travis-ci.org/ytake/hackdotenv.svg?branch=master)](https://travis-ci.org/ytake/hackdotenv)
[vlucas/phpdotenv](https://github.com/vlucas/phpdotenv) converted for Hack
**require HHVM >=4.20**
## Install
```
$ hhvm $(which composer) require ytake/hackdotenv
```## Usage
Your application configuration to a .env file in the root of your project.
```
FOO=bar
BAR=baz
```You can then load .env in your application.
```hack
use type Ytake\Dotenv\Loader;$dotenv = new Dotenv($this->dir);
await $dotenv->loadAsync();
``````hack
use namespace Ytake\Dotenv;Dot\env('FOO');
```