2017 © Pedro Peláez
 

composer-plugin yii2-composer

The composer plugin for Yii extension installer

image

yiisoft/yii2-composer

The composer plugin for Yii extension installer

  • Thursday, July 5, 2018
  • by cebe
  • Repository
  • 17 Watchers
  • 42 Stars
  • 4,719,179 Installations
  • PHP
  • 72 Dependents
  • 0 Suggesters
  • 25 Forks
  • 1 Open issues
  • 12 Versions
  • 8 % Grown

The README.md

, (*1)

Yii 2 Composer Installer


This is the composer installer for Yii framework 2.0 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., (*2)

For license information check the LICENSE-file., (*3)

Latest Stable Version Total Downloads Build status, (*4)

Usage

The Yii 2 Composer Installer is automatically installed with when installing the framework via Composer., (*5)

To use Yii 2 composer installer, simply set the package type to be yii2-extension in your composer.json, like the following:, (*6)

{
    "type": "yii2-extension",
    "require": {
        "yiisoft/yii2": "~2.0.0"
    },
    ...
}

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,, (*7)

{
    "type": "yii2-extension",
    ...,
    "extra": {
        "bootstrap": "yii\\jui\\Extension"
    }
}

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 is 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,, (*8)

{
    "name": "yiisoft/yii2-app-basic",
    "type": "project",
    ...
    "scripts": {
        "post-create-project-cmd": [
            "yii\\composer\\Installer::postCreateProject"
        ],
        "post-install-cmd": [
            "yii\\composer\\Installer::postInstall"
        ]
    },
    "extra": {
        "yii\\composer\\Installer::postCreateProject": {
            "setPermission": [
                {
                    "runtime": "0777",
                    "web/assets": "0777",
                    "yii": "0755"
                }
            ]
        },
        "yii\\composer\\Installer::postInstall": {
            "copyFiles": [
                {
                    "config/templates/console-local.php": "config/console-local.php",
                    "config/templates/web-local.php": "config/web-local.php",
                    "config/templates/db-local.php": "config/db-local.php",
                    "config/templates/cache.json": ["runtime/cache.json", true]
                }
            ],
            "generateCookieValidationKey": [
                "config/web-local.php"
            ]
        }
    }
}

The Versions

05/07 2018

dev-master

9999999-dev

The composer plugin for Yii extension installer

  Sources   Download

BSD-3-Clause

The Requires

  • composer-plugin-api ^1.0

 

The Development Requires

composer yii2 extension installer

05/07 2018

2.0.7

2.0.7.0

The composer plugin for Yii extension installer

  Sources   Download

BSD-3-Clause

The Requires

  • composer-plugin-api ^1.0

 

The Development Requires

composer yii2 extension installer

21/03 2018

2.0.6

2.0.6.0

The composer plugin for Yii extension installer

  Sources   Download

BSD-3-Clause

The Requires

  • composer-plugin-api ^1.0

 

The Development Requires

composer yii2 extension installer

20/12 2016

2.0.5

2.0.5.0

The composer plugin for Yii extension installer

  Sources   Download

BSD-3-Clause

The Requires

  • composer-plugin-api ^1.0

 

The Development Requires

composer yii2 extension installer

06/02 2016

2.0.4

2.0.4.0

The composer plugin for Yii extension installer

  Sources   Download

BSD-3-Clause

The Requires

  • composer-plugin-api ^1.0

 

composer yii2 extension installer

01/03 2015

2.0.3

2.0.3.0

The composer plugin for Yii extension installer

  Sources   Download

BSD-3-Clause

The Requires

  • composer-plugin-api 1.0.0

 

composer yii2 extension installer

11/01 2015

2.0.2

2.0.2.0

The composer plugin for Yii extension installer

  Sources   Download

BSD-3-Clause

The Requires

  • composer-plugin-api 1.0.0

 

composer yii2 extension installer

07/12 2014

2.0.1

2.0.1.0

The composer plugin for Yii extension installer

  Sources   Download

BSD-3-Clause

The Requires

  • composer-plugin-api 1.0.0

 

composer yii2 extension installer

12/10 2014

2.0.0

2.0.0.0

The composer plugin for Yii extension installer

  Sources   Download

BSD-3-Clause

The Requires

  • composer-plugin-api 1.0.0

 

composer yii2 extension installer

28/09 2014

2.0.0-rc

2.0.0.0-RC

The composer plugin for Yii extension installer

  Sources   Download

BSD-3-Clause

The Requires

  • composer-plugin-api 1.0.0

 

composer yii2 extension installer

13/04 2014

2.0.0-beta

2.0.0.0-beta

The composer plugin for Yii extension installer

  Sources   Download

BSD-3-Clause

The Requires

  • composer-plugin-api 1.0.0

 

composer yii2 extension installer

01/12 2013

2.0.0-alpha

2.0.0.0-alpha

The composer plugin for Yii extension installer

  Sources   Download

BSD-3-Clause

The Requires

  • composer-plugin-api 1.0.0

 

composer yii extension installer