protected function run(Process $process, $bypassErrors = false, $listeners = null)
    {
        if (null !== $listeners) {
            if (!is_array($listeners)) {
                $listeners = array($listeners);
            }

            $listenersManager = clone $this->listenersManager;

            foreach ($listeners as $listener) {
                $listenersManager->register($listener, $this);
            }
        } else {
            $listenersManager = $this->listenersManager;
        }

        return $this->processRunner->run($process, $listenersManager->storage, $bypassErrors);
    }
protected function run(Process $process, $bypassErrors = false, $listeners = null)
    {
        if (null !== $listeners) {
            if (!is_array($listeners)) {
                $listeners = array($listeners);
            }

            $listenersManager = clone $this->listenersManager;

            foreach ($listeners as $listener) {
                $listenersManager->register($listener, $this);
            }
        } else {
            $listenersManager = $this->listenersManager;
        }

        return $this->processRunner->run($process, $listenersManager->storage, $bypassErrors);
    }
protected function run ( Process $ process , $ bypassErrors = false , $ listeners = null ) { if ( null !== $ listeners ) { if ( ! is_array ( $ listeners ) ) { $ listeners = array ( $ listeners ) ; } $ listenersManager = clone $ this -> listenersManager ; foreach ( $ listeners as $ listener ) { $ listenersManager -> register ( $ listener , $ this ) ; } } else { $ listenersManager = $ this -> listenersManager ; } return $ this -> processRunner -> run ( $ process , $ listenersManager -> storage , $ bypassErrors ) ; }
Executes a process, logs events

@param Process                 $process
@param Boolean                 $bypassErrors Set to true to disable throwing ExecutionFailureExceptions
@param ListenerInterface|array $listeners    A listener or an array of listener to register for this unique run

@return string The Process output

@throws ExecutionFailureException in case of process failure.
Executes a process logs events