Inheritance: use trait Webiny\Component\StdLib\StdLibTrait
Example #1
0
 public function testGetAll()
 {
     $_ENV = ["APP_ENV" => "development", "DEBUG_IP" => "127.0.0.1"];
     $env = new Env();
     $this->assertSame($_ENV, $env->getAll());
 }
Example #2
0
 /**
  * Get a value from $_ENV param for the given $key.
  * If key doesn't not exist, $value will be returned and assigned under that key.
  *
  * @param string $key   Key for which you wish to get the value.
  * @param mixed  $value Default value that will be returned if $key doesn't exist.
  *
  * @return mixed Value of the given $key.
  */
 public function env($key = null, $value = null)
 {
     return $this->isNull($key) ? $this->env->getAll() : $this->env->get($key, $value);
 }