PHPackages                             treptowkolleg/env - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. treptowkolleg/env

ActivePackage[File &amp; Storage](/categories/file-storage)

treptowkolleg/env
=================

file system package

1.0.6(1y ago)0361mitPHPPHP &gt;=8.1

Since Dec 1Pushed 1y ago1 watchersCompare

[ Source](https://github.com/treptowkolleg/env)[ Packagist](https://packagist.org/packages/treptowkolleg/env)[ RSS](/packages/treptowkolleg-env/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)DependenciesVersions (8)Used By (1)

Environment &amp; Filesystem Manager
====================================

[](#environment--filesystem-manager)

- [Environment &amp; Filesystem Manager](#environment--filesystem-manager)
    - [Installation](#installation)
    - [Usage](#usage)
        - [Env Files](#env-files)
        - [Environment](#environment)
        - [Add Attribute Containers](#add-attribute-containers)
        - [Implement Own Container](#implement-own-container)
        - [Get Container Parameter](#get-container-parameter)
    - [Example](#example)

Installation
------------

[](#installation)

```
composer require treptowkolleg/env
```

Usage
-----

[](#usage)

### Env Files

[](#env-files)

DotEnv files (`.env`) are used to store risky credentials out of client code. Make sure `.env` is added to `.gitignore` **before commit**.

```
# db credentials
DB_HOST=localhost
DB_NAME=databaseName
DB_USER=databaseUsername
DB_PASS=1234

# custom vars
VAR_1=x
VAR_2=y
VAR_3=z
```

### Environment

[](#environment)

ParameterTypeOptionsDescriptionpath`TreptowKolleg\Env\Path``LOCAL_DIR, USER_DIR, PUBLIC_DIR, CUSTOM_DIR`where to look for `.env.local` or `.env`subDir`string`path to sub directorycustomEnv`string`if using `CUSTOM_DIR` wich **ENV**-var to use```
