pug/installer

There is no license information available for the latest version (0.1.3) of this package.

Enable installation callbacks on composer libraries

Installs: 30 548

Dependents: 3

Suggesters: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

Type:composer-plugin

0.1.3 2017-08-14 16:56 UTC

README

Latest Stable Version Build Status StyleCI Test Coverage Code Climate

Allow you to call scripts and sub-installations after package installed.

Usage

Edit composer.json like this:

...
"require": {
    "pug/installer": "*"
},
"extra": {
    "installer": "MyClass::install"
},
"scripts": {
    "post-install-cmd": [
        "Pug\\Installer\\Installer::onAutoloadDump"
    ],
    "post-update-cmd": [
        "Pug\\Installer\\Installer::onAutoloadDump"
    ]
},
...

Then in your MyClass::install method (MyClass must be available via some PSR autoload you defined in composer.json).

<?php

use Composer\Script\Event;
use Pug\Installer\Installer;

class MyClass
{
    public static install(Event $event, Installer, $installer)
    {
        $installer->install('pug/pug');
        $event->getIO()->write('pug/pug has been installed');
    }
}

The following will install pug/pug after your own package.

You can pass multiple installers like this:

"extra": {
    "installer": [
        "Foo::install",
        "Bar::install"
    ]
}