public function spawn($commands = array(), $quiet = false) {
		
		// set-up a default
		$processes = array();
		
		// add the default processes sent to the spawner
		if (!empty($commands)) {
			foreach ($commands as $command) {
				$processes[] = $this->buildProcess($command);
			}
		}
		
		// add the processes sent to the spawner from plugins
		foreach ($this->pluginProcesses as $pluginProcess) {
			$processes[] = $this->buildProcess($pluginProcess);
		}
		
		// if there are processes to spawn do so
		if (!empty($processes)) {
			
			// start the processes
			foreach ($processes as $process) {
				$process["process"]->start();
			}
			
			// check on them and produce output
			while (true) {
				foreach ($processes as $process) {
					try {
						if ($process["process"]->isRunning()) {
							$process["process"]->checkTimeout();
							if (!$quiet && $process["output"]) {
								print $process["process"]->getIncrementalOutput();
								$cmd = $process["process"]->getCommandLine();
								if (strpos($cmd,"router.php") != (strlen($cmd) - 10)) {
									print $process["process"]->getIncrementalErrorOutput();
								}
							}
						}
					} catch (ProcessTimedOutException $e) {
						if ($e->isGeneralTimeout()) {
							Console::writeError("pattern lab processes should never time out. yours did...");
						} else if ($e->isIdleTimeout()) {
							Console::writeError("pattern lab processes automatically time out if their is no command line output in 30 minutes...");
						}
					}
				}
				usleep(100000);
			}
		}
		
	}
public function spawn($commands = array(), $quiet = false) {
		
		// set-up a default
		$processes = array();
		
		// add the default processes sent to the spawner
		if (!empty($commands)) {
			foreach ($commands as $command) {
				$processes[] = $this->buildProcess($command);
			}
		}
		
		// add the processes sent to the spawner from plugins
		foreach ($this->pluginProcesses as $pluginProcess) {
			$processes[] = $this->buildProcess($pluginProcess);
		}
		
		// if there are processes to spawn do so
		if (!empty($processes)) {
			
			// start the processes
			foreach ($processes as $process) {
				$process["process"]->start();
			}
			
			// check on them and produce output
			while (true) {
				foreach ($processes as $process) {
					try {
						if ($process["process"]->isRunning()) {
							$process["process"]->checkTimeout();
							if (!$quiet && $process["output"]) {
								print $process["process"]->getIncrementalOutput();
								$cmd = $process["process"]->getCommandLine();
								if (strpos($cmd,"router.php") != (strlen($cmd) - 10)) {
									print $process["process"]->getIncrementalErrorOutput();
								}
							}
						}
					} catch (ProcessTimedOutException $e) {
						if ($e->isGeneralTimeout()) {
							Console::writeError("pattern lab processes should never time out. yours did...");
						} else if ($e->isIdleTimeout()) {
							Console::writeError("pattern lab processes automatically time out if their is no command line output in 30 minutes...");
						}
					}
				}
				usleep(100000);
			}
		}
		
	}
public function spawn ( $ commands = array ( ) , $ quiet = false ) { // set-up a default $ processes = array ( ) ; // add the default processes sent to the spawner if ( ! empty ( $ commands ) ) { foreach ( $ commands as $ command ) { $ processes [ ] = $ this -> buildProcess ( $ command ) ; } } // add the processes sent to the spawner from plugins foreach ( $ this -> pluginProcesses as $ pluginProcess ) { $ processes [ ] = $ this -> buildProcess ( $ pluginProcess ) ; } // if there are processes to spawn do so if ( ! empty ( $ processes ) ) { // start the processes foreach ( $ processes as $ process ) { $ process [ "process" ] -> start ( ) ; } // check on them and produce output while ( true ) { foreach ( $ processes as $ process ) { try { if ( $ process [ "process" ] -> isRunning ( ) ) { $ process [ "process" ] -> checkTimeout ( ) ; if ( ! $ quiet && $ process [ "output" ] ) { print $ process [ "process" ] -> getIncrementalOutput ( ) ; $ cmd = $ process [ "process" ] -> getCommandLine ( ) ; if ( strpos ( $ cmd , "router.php" ) != ( strlen ( $ cmd ) - 10 ) ) { print $ process [ "process" ] -> getIncrementalErrorOutput ( ) ; } } } } catch ( ProcessTimedOutException $ e ) { if ( $ e -> isGeneralTimeout ( ) ) { Console :: writeError ( "pattern lab processes should never time out. yours did..." ) ; } else if ( $ e -> isIdleTimeout ( ) ) { Console :: writeError ( "pattern lab processes automatically time out if their is no command line output in 30 minutes..." ) ; } } } usleep ( 100000 ) ; } } }
Spawn the passed commands and those collected from plugins
@param  {Array}       a list of commands to spawn
@param  {Boolean}     if this should be run in quiet mode
Spawn the passed commands and those collected from plugins