PHP code example of devinci-it / envngine

1. Go to this page and download the library: Download devinci-it/envngine library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

devinci-it / envngine example snippets




use DevinciIT\EnvNgine\EnvBuilder;

return EnvBuilder::make()
    ->string('APP_NAME')
    ->default('EnvNgine App')
    ->description('Application display name')

    ->string('APP_ENV')
    ->default('local')

    ->bool('APP_DEBUG')
    ->default(false)

    ->int('APP_PORT')
    ->default(8000)
    ->

Env::boot(__DIR__ . '/config/env.php');

$appName = Env::string('APP_NAME', 'My App');
$appEnv = Env::string('APP_ENV', 'local');
$appDebug = Env::bool('APP_DEBUG', false);
$appPort = Env::int('APP_PORT', 8000);
$hosts = Env::array('ALLOWED_HOSTS', ['localhost']);
$dbHost = Env::string('DB_HOST', '127.0.0.1');

env_boot(__DIR__ . '/config/env.php');
$registry = env_registry();
$value = Env::get('KEY', 'fallback');