2017 © Pedro Peláez
 

yii2-extension yii2-environment

Environment class for Yii 2, used to set configuration for console and web apps depending on the server environment.

image

janisto/yii2-environment

Environment class for Yii 2, used to set configuration for console and web apps depending on the server environment.

  • Wednesday, June 1, 2016
  • by janisto
  • Repository
  • 7 Watchers
  • 17 Stars
  • 14,862 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 5 Forks
  • 1 Open issues
  • 7 Versions
  • 6 % Grown

The README.md

Yii 2 Environment

Environment class for Yii 2, used to set configuration for console and web apps depending on the server environment., (*1)

Software License Build Status Code Quality Code Coverage Packagist Version Total Downloads, (*2)

Installation

If you do not have Composer, you may install it by following the instructions at getcomposer.org., (*3)

You can then install this package using the following command:, (*4)

php composer.phar require "janisto/yii2-environment" "*"

or add, (*5)

"janisto/yii2-environment": "*"

to the require section of your application's composer.json file., (*6)

Usage

web index.php

<?php
require(dirname(__DIR__) . '/vendor/autoload.php');

$env = new \janisto\environment\Environment(dirname(__DIR__) . '/config');
$env->setup();
(new yii\web\Application($env->web))->run();

or if you have multiple configuration locations, (*7)

<?php
require(dirname(__DIR__) . '/vendor/autoload.php');

$env = new \janisto\environment\Environment([
    dirname(__DIR__) . '/common/config',
    dirname(__DIR__) . '/backend/config'
]);
$env->setup();
(new yii\web\Application($env->web))->run();

console yii

#!/usr/bin/env php
<?php

require(__DIR__ . '/vendor/autoload.php');

// fcgi doesn't have STDIN and STDOUT defined by default
defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));
defined('STDOUT') or define('STDOUT', fopen('php://stdout', 'w'));

$env = new \janisto\environment\Environment(__DIR__ . '/config');
$env->setup();
$exitCode = (new yii\console\Application($env->console))->run();
exit($exitCode);

Use yii, (*8)

export YII_ENV='dev' && ./yii

Documentation

See examples/., (*9)

Contributing

Please see CONTRIBUTING for details., (*10)

Credits

License

Public domain. Please see License File for more information., (*11)

The Versions

01/06 2016

dev-master

9999999-dev https://github.com/janisto/yii2-environment

Environment class for Yii 2, used to set configuration for console and web apps depending on the server environment.

  Sources   Download

public domain

The Requires

 

The Development Requires

by Jani Mikkonen

extension configuration yii2 environment

01/06 2016

1.3.0

1.3.0.0 https://github.com/janisto/yii2-environment

Environment class for Yii 2, used to set configuration for console and web apps depending on the server environment.

  Sources   Download

public domain

The Requires

 

The Development Requires

by Jani Mikkonen

extension configuration yii2 environment

26/06 2015

1.2.0

1.2.0.0 https://github.com/janisto/yii2-environment

Environment class for Yii 2, used to set configuration for console and web apps depending on the server environment.

  Sources   Download

public domain

The Requires

 

The Development Requires

by Jani Mikkonen

extension configuration yii2 environment

09/04 2015

1.1.1

1.1.1.0 https://github.com/janisto/yii2-environment

Environment class for Yii 2, used to set configuration for console and web apps depending on the server environment.

  Sources   Download

public domain

The Requires

 

The Development Requires

by Jani Mikkonen

extension configuration yii2 environment

08/04 2015

1.1.0

1.1.0.0 https://github.com/janisto/yii2-environment

Environment class for Yii 2, used to set configuration for console and web apps depending on the server environment.

  Sources   Download

public domain

The Requires

 

The Development Requires

by Jani Mikkonen

extension configuration yii2 environment

27/10 2014

1.0.1

1.0.1.0 https://github.com/janisto/yii2-environment

Environment class for Yii 2, used to set configuration for console and web apps depending on the server environment.

  Sources   Download

public domain

The Requires

 

by Jani Mikkonen

extension yii environment

27/10 2014

1.0.0

1.0.0.0 https://github.com/janisto/yii2-environment

Environment class for Yii 2, used to set configuration for console and web apps depending on the server environment.

  Sources   Download

public domain

The Requires

 

by Jani Mikkonen

extension yii environment