Before Flex, we could extend Sensio's DistributionBundle Composer/ScriptHandler.php to hook into bin/console and run commands as part of composer's "post-update-cmd" .
Unfortunately Flex eliminates the ScriptHandler file. What's the best approach with Flex? I tried creating an Application instead of ScriptHandler and calling that from "post-update-cmd":
#!/usr/bin/env php
<?php
// application.php
require __DIR__.'/vendor/autoload.php';
use Symfony\Component\Console\Application;
use Mybundle\MyUpdateCommand;
$application = new Application();
// ... register commands
$application->add(new MyUpdateCommand());
$application->run();
But this throws an error "event returned with error code 127". Thanks!