symfony - Symfony2 Composer post-install-cmd -
i need install symfony2 bundle on composer , stuff after install process. "stuff" after install add 1 line "post-install-cmd" in composer.json
servicebundle\\core\\platform::registerservice
and calls function, fine
public static function registerservice(event $event) { //some stuff exit; }
the command use:
php composer.phar update serviceplatform/bundles/poll
now question: possible name "serviceplatform/bundles/poll" or pass arguments statement? need path bundle after install.
extra
node you're looking - https://getcomposer.org/doc/04-schema.md#extra
in composer.json
:
"extra": { "your-parameter": "serviceplatform/bundles/poll" }
then, in servicebundle\core\platform::registerservice
:
public static function registerservice(event $event) { $extras = $event->getcomposer()->getpackage()->getextra(); $yourparameter = $extras['your-parameter']; //do stuff }
it should trick.
Comments
Post a Comment