Download the PHP package futuretek/yii2-composer without Composer
On this page you can find all versions of the php package futuretek/yii2-composer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download futuretek/yii2-composer
More information about futuretek/yii2-composer
Files in futuretek/yii2-composer
Package yii2-composer
Short Description The composer plugin for Yii extension installer
License Apache-2.0
Homepage http://www.futuretek.cz/
Informations about the package yii2-composer
Yii 2 Composer Installer
This is the composer installer for Yii 2 extensions. It implements a new composer package
type named yii2-extension
, which should be used by all Yii 2 extensions if they are
distributed as composer packages.
Usage
To use Yii 2 composer installer, simply set the package type
to be yii2-extension
in your composer.json
,
like the following:
You may specify a bootstrapping class in the extra
section. The init()
method of the class will be executed each time
the Yii 2 application is responding to a request. For example,
The Installer
class also implements a static method postCreateProject()
that can be called after
a Yii 2 project is created, through the post-create-project-cmd
composer script.
A similar method exists for running tasks after each composer install
call, which sis postInstall()
.
These methods allow to run other Installer
class methods like setPermission()
or generateCookieValidationKey()
,
depending on the corresponding parameters set in the extra
section of the composer.json
file.
For example,
Added features
- Auto registering translations from extension to main application PHPMessageSource
- Extensions can propagate settings to yii config via
/vendor/futuretek/*.php
files
TODO
- Better documentation