Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/Alchemy/BinaryDriver/AbstractBinary.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ abstract class AbstractBinary extends EventEmitter implements BinaryInterface
/** @var Listeners */
private $listenersManager;

/** @var Process */
private $lastProcess;

public function __construct(ProcessBuilderFactoryInterface $factory, LoggerInterface $logger, ConfigurationInterface $configuration)
{
$this->factory = $factory;
Expand Down Expand Up @@ -134,7 +137,17 @@ public function command($command, $bypassErrors = false, $listeners = null)
$command = array($command);
}

return $this->run($this->factory->create($command), $bypassErrors, $listeners);
// what if we still need to access the process object?
$this->lastProcess = $this->factory->create($command);
return $this->run($this->lastProcess, $bypassErrors, $listeners);
}

/**
* @return Process Last ran process
*/
public function getLastProcess()
{
return $this->lastProcess;
}

/**
Expand Down