ahir/environment

Simple PHP environment manager.

This package's canonical repository appears to be gone and the package has been frozen as a result.

1.3.1 2015-04-28 06:45 UTC

This package is not auto-updated.

Last update: 2024-09-26 17:59:56 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