share(function () { return new ExecutableFinder(); }); $app['driver.binary-finder'] = $app->protect(function ($name, $configName) use ($app) { $extraDirs = []; if (is_dir($app['root.path'] . '/node_modules')) { $extraDirs[] = $app['root.path'] . '/node_modules/.bin'; } if (!$app['configuration.store']->isSetup()) { return $app['executable-finder']->find($name, null, $extraDirs); } if ($app['conf']->has(['main', 'binaries', $configName])) { return $app['conf']->get(['main', 'binaries', $configName]); } return $app['executable-finder']->find($name, null, $extraDirs); }); $app['driver.composer'] = $app->share(function (Application $app) { $composerBinary = $app['driver.binary-finder']('composer', 'composer_binary'); if (null === $composerBinary) { throw new RuntimeException('Unable to find composer executable.'); } return ComposerDriver::create(['composer.binaries' => $composerBinary, 'timeout' => 300], $app['monolog']); }); } public function boot(Application $app) { } }