PHPackages                             sweetchuck/env-var-storage - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. sweetchuck/env-var-storage

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sweetchuck/env-var-storage
==========================

@todo project description

1.x-dev(3mo ago)0719GPL-3.0-or-laterPHPPHP &gt;=7.4CI passing

Since Dec 17Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/Sweetchuck/env-var-storage)[ Packagist](https://packagist.org/packages/sweetchuck/env-var-storage)[ Docs](https://github.com/Sweetchuck/env-var-storage)[ RSS](/packages/sweetchuck-env-var-storage/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelogDependencies (11)Versions (2)Used By (0)

Environment variable storage
============================

[](#environment-variable-storage)

[![CircleCI](https://camo.githubusercontent.com/e5af741976dcbf613b79ef3a8574cc5bf1c82141973ab086f19e8c728aa64905/68747470733a2f2f636972636c6563692e636f6d2f67682f5377656574636875636b2f656e762d7661722d73746f726167652f747265652f312e782e7376673f7374796c653d737667)](https://circleci.com/gh/Sweetchuck/env-var-storage/?branch=1.x)[![codecov](https://camo.githubusercontent.com/c62024f44df1365b5c01bc3ebb08bb66bc93516155542898ca0a682728e5b5fb/68747470733a2f2f636f6465636f762e696f2f67682f5377656574636875636b2f656e762d7661722d73746f726167652f6272616e63682f312e782f67726170682f62616467652e7376673f746f6b656e3d48534631364f47507972)](https://app.codecov.io/gh/Sweetchuck/env-var-storage/branch/1.x)

This library provides a wrapper around the [\\getenv()](https://www.php.net/manual/en/function.getenv.php) and [\\putenv()](https://www.php.net/manual/en/function.putenv.php) functions.

Interface
---------

[](#interface)

[EnvVarStorageInterface](./src/EnvVarStorageInterface.php)

Implementation - real
---------------------

[](#implementation---real)

[EnvVarStorage](./src/EnvVarStorage.php) uses the real [\\getenv()](https://www.php.net/manual/en/function.getenv.php) and [\\putenv()](https://www.php.net/manual/en/function.putenv.php)functions to get/set environment variables.

Implementation - dummy
----------------------

[](#implementation---dummy)

[ArrayStorage](./src/ArrayStorage.php) uses an \\ArrayObject instance to store „environment” variables. Use this one for testing purposes.

Service definition
------------------

[](#service-definition)

```
services:
    env_var_storage:
        shared: true
        class: 'Sweetchuck\EnvVarStorage\EnvVarStorage'
```

Usage
-----

[](#usage)

```
