src/Cornford/Backup/BackupFilesystem.php
public function locateCommand($command)
	{
		switch ($this->getOperatingSystem()) {
			case self::OS_OSX:
			case self::OS_LINUX:
				exec(sprintf('/usr/bin/which %s', $command), $result, $returnCode);
				if (isset($result[0])) {
					$result = $result[0];
				}
				break;
			case self::OS_WIN:
				exec(sprintf('where %s', $command), $result, $returnCode);
				if (isset($result[0])) {
					$result = $result[0];
				}
				break;
			default:
				return false;
		}

		if (empty($result)) {
			return false;
		}

		return $result;
	}
public function locateCommand($command)
	{
		switch ($this->getOperatingSystem()) {
			case self::OS_OSX:
			case self::OS_LINUX:
				exec(sprintf('/usr/bin/which %s', $command), $result, $returnCode);
				if (isset($result[0])) {
					$result = $result[0];
				}
				break;
			case self::OS_WIN:
				exec(sprintf('where %s', $command), $result, $returnCode);
				if (isset($result[0])) {
					$result = $result[0];
				}
				break;
			default:
				return false;
		}

		if (empty($result)) {
			return false;
		}

		return $result;
	}
public function locateCommand ( $ command ) { switch ( $ this -> getOperatingSystem ( ) ) { case self :: OS_OSX : case self :: OS_LINUX : exec ( sprintf ( '/usr/bin/which %s' , $ command ) , $ result , $ returnCode ) ; if ( isset ( $ result [ 0 ] ) ) { $ result = $ result [ 0 ] ; } break ; case self :: OS_WIN : exec ( sprintf ( 'where %s' , $ command ) , $ result , $ returnCode ) ; if ( isset ( $ result [ 0 ] ) ) { $ result = $ result [ 0 ] ; } break ; default : return false ; } if ( empty ( $ result ) ) { return false ; } return $ result ; }
Locate command location.

@param string $command

@return string|false
Locate command location .