Skip to content
This repository has been archived by the owner on Sep 1, 2023. It is now read-only.

Commit

Permalink
Update ComposerPlugin.php (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
azjezz authored and fredemmott committed Jan 22, 2019
1 parent 84a3ee1 commit 5d3fdbf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ComposerPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
use Composer\Plugin\PluginInterface;
use Composer\Script\Event;
use Composer\Script\ScriptEvents;
use Composer\Util\ProcessExecutor;
use Symfony\Component\Process\ExecutableFinder;

/** Plugin for PHP composer to automatically update the autoload map whenever
* dependencies are changed or updated.
Expand Down Expand Up @@ -58,6 +60,10 @@ public static function getSubscribedEvents() {
*/
public function onPostAutoloadDump(Event $event) {
$args = $event->isDevMode() ? '' : ' --no-dev';
shell_exec('hhvm '.escapeshellarg($this->vendor.'/bin/hh-autoload').$args);
$finder = new ExecutableFinder();
$hhvm = $finder->find('hhvm', 'hhvm');
$executor = new ProcessExecutor($this->io);
$command = $hhvm . ' ' . ProcessExecutor::escape($this->vendor.'/bin/hh-autoload') . $args;
$executor->execute($command);
}
}

0 comments on commit 5d3fdbf

Please sign in to comment.