ahir/environment

Simple PHP environment manager.

1.3.1 2015-04-28 06:45 UTC

This package is not auto-updated.

Last update: 2023-08-29 17:40:04 UTC


README

This is a environment library for quick environment setup.

Installation

To install through composer, simply put the following in your composer.json file:

{
    "require": {
        "ahir/environment": "1.*",
    }
}

Usage

index.php

$environment = new Ahir\Environment\Environment;
$environment->path('/')
            ->detectEnvironment([
                'local' => ['your-machine-name']
            ]);

index.php

$environment = new Ahir\Environment\Environment;
$environment->file('/home/')
            ->detectEnvironment([
                'local' => ['your-machine-name']
            ]);

You can check your machine name with hostname command.

.env.local.php

return [
        
        'secret-password' => 'secret-password-value'

    ];

.env.local.json

{
    "environment": "development"
}
$secret = getenv('secret-password');

Facades

If you wish, you can use environment library with facade connector. Please visit for guideline. ahir/facades

License

MIT