2017 © Pedro Peláez
 

silverstripe-module ss-mwm-env

Dot notation access of configuration, as well as overrides via $_ENV

image

milkyway-multimedia/ss-mwm-env

Dot notation access of configuration, as well as overrides via $_ENV

  • Tuesday, June 28, 2016
  • by mi3ll
  • Repository
  • 1 Watchers
  • 1 Stars
  • 2,880 Installations
  • PHP
  • 6 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 9 % Grown

The README.md

Env (Milkyway Multimedia)

Dot notation access of configuration, as well as overrides via $_ENV (environment variables), (*1)

singleton('env')

This is the new way to access configuration. Instead of using Config::inst()->get('Email', 'admin_email') you can now use singleton('env')->get('Email.admin_email'). But that is not its real feature., (*2)

Features

  1. Access deep array configuration: singleton('env')->get('Email.site_emails.staff')
  2. Override configuration using $_ENV variables, good for when you are developing locally
  3. Use configuration fallbacks: singleton('env')->get('FacebookPage|Facebook.admin_id')
    • Will check FacebookPage, and then check Facebook
  4. Add callbacks to check in between namespaces
  5. Cached

vlucas/phpdotenv

For development, you can use a .env.php file to override variables, but it requires some manual installation., (*3)

You need to install the package: vlucas/phpdotenv via composer.json, and then follow the instructions in that package., (*4)

If you want the environment to work, you should add the following to your ss_environment.php:, (*5)

   require_once BASE_PATH . '/mwm-env/code/dev/Environment.php';

Install

Add the following to your composer.json file, (*6)


"require" : { "milkyway-multimedia/ss-mwm-env": "~0.3" }

License

  • MIT

Version

  • Version 0.3 (Alpha)

Contact

Mellisa Hankins

  • E-mail: mellisa.hankins@me.com
  • Twitter: @mi3ll
  • Website: mellimade.com.au

The Versions

28/06 2016

dev-master

9999999-dev

Dot notation access of configuration, as well as overrides via $_ENV

  Sources   Download

MIT

The Development Requires

by Mellisa Hankins

silverstripe utilities mwm