pug / installer
Enable installation callbacks on composer libraries
Fund package maintenance!
kylekatarnls
Open Collective
Tidelift
Installs: 76 758
Dependents: 3
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Type:composer-plugin
Requires
- php: >=5.3.0
- composer-plugin-api: ^1.0 || ^2.0
Requires (Dev)
- codeclimate/php-test-reporter: >=0.3
- composer/composer: ^1.2
- phpunit/phpunit: >=4.8 <6.0
README
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" ] }