src/Cornford/Backup/BackupProcess.php
public function run($command, $operation = 'default')
	{
		$this->output = null;

		try {
			$this->processInstance->setCommandLine($command);
			$this->processInstance->setTimeout(self::PROCESS_TIMEOUT);
			$this->processInstance->run();

			if (!$this->processInstance->isSuccessful()) {
				$this->output = $this->processInstance->getErrorOutput();

				return false;
			}
		} catch (Exception $exception) {
			$message = 'An error occurred that prevented the operation ' . $operation . ': ' . $exception->getMessage();

			switch ($operation) {
				case 'export':
					throw new BackupExportException($message);
				case 'restore':
					throw new BackupRestoreException($message);
				default:
					throw new BackupException($message);
			}
		}

		return true;
	}
public function run($command, $operation = 'default')
	{
		$this->output = null;

		try {
			$this->processInstance->setCommandLine($command);
			$this->processInstance->setTimeout(self::PROCESS_TIMEOUT);
			$this->processInstance->run();

			if (!$this->processInstance->isSuccessful()) {
				$this->output = $this->processInstance->getErrorOutput();

				return false;
			}
		} catch (Exception $exception) {
			$message = 'An error occurred that prevented the operation ' . $operation . ': ' . $exception->getMessage();

			switch ($operation) {
				case 'export':
					throw new BackupExportException($message);
				case 'restore':
					throw new BackupRestoreException($message);
				default:
					throw new BackupException($message);
			}
		}

		return true;
	}
public function run ( $ command , $ operation = 'default' ) { $ this -> output = null ; try { $ this -> processInstance -> setCommandLine ( $ command ) ; $ this -> processInstance -> setTimeout ( self :: PROCESS_TIMEOUT ) ; $ this -> processInstance -> run ( ) ; if ( ! $ this -> processInstance -> isSuccessful ( ) ) { $ this -> output = $ this -> processInstance -> getErrorOutput ( ) ; return false ; } } catch ( Exception $ exception ) { $ message = 'An error occurred that prevented the operation ' . $ operation . ': ' . $ exception -> getMessage ( ) ; switch ( $ operation ) { case 'export' : throw new BackupExportException ( $ message ) ; case 'restore' : throw new BackupRestoreException ( $ message ) ; default : throw new BackupException ( $ message ) ; } } return true ; }
Execute a command process.

@param string $command
@param string $operation

@throws BackupException
@throws BackupExportException
@throws BackupRestoreException

@return boolean
Execute a command process .