Download the PHP package horat1us/yii2-current-environment without Composer
On this page you can find all versions of the php package horat1us/yii2-current-environment. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download horat1us/yii2-current-environment
More information about horat1us/yii2-current-environment
Files in horat1us/yii2-current-environment
Package yii2-current-environment
Short Description Yii2 Current Environment Provider
License MIT
Informations about the package yii2-current-environment
Yii2 Current Environment
Русская версия Library provides class to get current environment (YII_ENV) of Yii2 application.
Purpose
Main purpose is to make support, adaptation and modification of applications written using legacy Yii2 framework more friendly to modern programming trends.
PHP constants is used for configuring Yii2 applications environment. It makes testing environment-depending code difficult because constant redefining is impossible without external extensions.
This library provides simple solution for legacy application written using Yii2 as facade class that deals with Yii2 legacy (constant defining in libraries, global variables and static class storage).
Install
Using composer
Setup
For usage inside libraries
Use CurrentEnvironment\Facade as dependency for your services in pair with DI Container.
Example
For usage inside application
To set up CurrentEnvironment\Facade singleton inside Yii2 DI Container, both with 'env' application component use CurrentEnvironment\Bootstrap inside your application configuration.
Example
Authors
- Alexander Letnikow
All versions of yii2-current-environment with dependencies
php Version ^7.4 | 8.*
symfony/polyfill-php80 Version ^1.20
ext-json Version *