PHPackages                             futuretek/yii2-composer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. futuretek/yii2-composer

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

futuretek/yii2-composer
=======================

The composer plugin for Yii extension installer

2.0.0(4y ago)013.1k—0%1Apache-2.0PHP

Since Sep 14Pushed 4y ago3 watchersCompare

[ Source](https://github.com/futuretek-solutions-ltd/ext-yii2-composer)[ Packagist](https://packagist.org/packages/futuretek/yii2-composer)[ Docs](http://www.futuretek.cz/)[ RSS](/packages/futuretek-yii2-composer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (5)Used By (1)

Yii 2 Composer Installer
========================

[](#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
-----

[](#usage)

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

```
{
    "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,

```
{
    "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 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,

```
{
    "name": "yiisoft/yii2-app-basic",
    "type": "project",
    ...
    "scripts": {
        "post-create-project-cmd": [
            "futuretek\\composer\\Installer::postCreateProject"
        ],
        "post-install-cmd": [
            "futuretek\\composer\\Installer::postInstall"
        ]
    },
    "extra": {
        "futuretek\\composer\\Installer::postCreateProject": {
            "setPermission": [
                {
                    "runtime": "0777",
                    "web/assets": "0777",
                    "yii": "0755"
                }
            ]
        },
        "futuretek\\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"
            ]
        }
    }
}
```

Added features
--------------

[](#added-features)

- Auto registering translations from extension to main application PHPMessageSource
- Extensions can propagate settings to yii config via `/vendor/futuretek/*.php` files

TODO
----

[](#todo)

- Better documentation

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~499 days

Total

4

Last Release

1669d ago

Major Versions

1.2.0 → 2.0.02021-10-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/1ce67c863775f4dd7237db0547fe39aaf85c9841f34773d67e88f62dcf948ae4?d=identicon)[futuretek](/maintainers/futuretek)

---

Top Contributors

[![lukascernydis](https://avatars.githubusercontent.com/u/3111717?v=4)](https://github.com/lukascernydis "lukascernydis (4 commits)")

---

Tags

composeryii2extension installer

### Embed Badge

![Health badge](/badges/futuretek-yii2-composer/health.svg)

```
[![Health](https://phpackages.com/badges/futuretek-yii2-composer/health.svg)](https://phpackages.com/packages/futuretek-yii2-composer)
```

###  Alternatives

[ergebnis/composer-normalize

Provides a composer plugin for normalizing composer.json.

1.1k37.3M2.1k](/packages/ergebnis-composer-normalize)[yiisoft/yii2-composer

The composer plugin for Yii extension installer

8628.8M55](/packages/yiisoft-yii2-composer)[pyrech/composer-changelogs

Display changelogs after each composer update

5904.0M25](/packages/pyrech-composer-changelogs)[cyclonedx/cyclonedx-php-composer

Creates CycloneDX Software Bill-of-Materials (SBOM) from PHP Composer projects

821.6M17](/packages/cyclonedx-cyclonedx-php-composer)[neronmoon/scriptsdev

Scripts-dev behaviour for Composer

691.5M41](/packages/neronmoon-scriptsdev)[slince/composer-registry-manager

Composer mirrors manager

56314.9k](/packages/slince-composer-registry-manager)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
