src/mako/reactor/traits/FireTrait.php
protected function fire(string $command, Closure $handler, bool $sameEnvironment = true): int
	{
		$process = popen($this->buildCommand($command, false, $sameEnvironment), 'r');

		while(!feof($process))
		{
			$handler(fread($process, 4096));
		}

		return pclose($process);
	}
protected function fire(string $command, Closure $handler, bool $sameEnvironment = true): int
	{
		$process = popen($this->buildCommand($command, false, $sameEnvironment), 'r');

		while(!feof($process))
		{
			$handler(fread($process, 4096));
		}

		return pclose($process);
	}
protected function fire ( string $ command , Closure $ handler , bool $ sameEnvironment = true ) : int { $ process = popen ( $ this -> buildCommand ( $ command , false , $ sameEnvironment ) , 'r' ) ; while ( ! feof ( $ process ) ) { $ handler ( fread ( $ process , 4096 ) ) ; } return pclose ( $ process ) ; }
Runs command as a separate process and feeds output to handler.

@param  string   $command         Command
@param  \Closure $handler         Output handler
@param  bool     $sameEnvironment Run command using the same environment?
@return int
Runs command as a separate process and feeds output to handler .