Dietcube\Dispatcher::getEnv PHP Метод

getEnv() публичный статический Метод

public static getEnv ( $env = 'production' )
    public static function getEnv($env = 'production')
    {
        if (isset($_SERVER['DIET_ENV'])) {
            $env = $_SERVER['DIET_ENV'];
        } elseif (getenv('DIET_ENV')) {
            $env = getenv('DIET_ENV');
        }
        return $env;
    }

Usage Example

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $app = new Application(dirname(dirname(__DIR__) . '/app'), Dispatcher::getEnv());
     $dispatcher = new Dispatcher($app);
     $dispatcher->boot();
     $user_service = new UserService();
     $body_measure_service = new BodyMeasureService($app->getContainer(), $app->getTmpDir());
     $users = $user_service->getUsers();
     $response = $body_measure_service->getData($users);
     $post_service = new PostService($app->getContainer());
     $post_service->post($response);
 }
All Usage Examples Of Dietcube\Dispatcher::getEnv