Skip to content

Env Service

Configurations

Env Service Provider

PROVIDER_ENV=\Zemit\Provider\Env\ServiceProvider

Env Configurations Object

<?php
new Config([
    'providers' => [
        \Zemit\Provider\Env\ServiceProvider::class => Env::get('PROVIDER_ENV', \Zemit\Provider\Env\ServiceProvider::class),
    ],
]);

Env Service (env)

Env Service Provider

Env Service Provider (env): \Zemit\Provider\Env\ServiceProvider

<?php
// Retrieving the service from an Injectable
$env = $this->env;

// Retrieving the service from the DI
$env = $this->di->get('env');

// Retrieving the service from the getDI()
$env = $this->getDI()->get('env');

// Retrieving the service from anywhere
$env = Di::getDefault()->get('env');