| @@ 37-49 (lines=13) @@ | ||
| 34 | * @param string $path remote source path |
|
| 35 | * @return bool true when the resource exists, false otherwise |
|
| 36 | */ |
|
| 37 | public function exists($path) |
|
| 38 | { |
|
| 39 | if (false === isset($this->_exists[$path])) { |
|
| 40 | $remoteCommand = sprintf("test -e %s", $path); |
|
| 41 | $commandline = sprintf("ssh %s@%s \"%s\"", $this->getUser(), $this->getHost(), $remoteCommand); |
|
| 42 | ||
| 43 | $exitCode = $this->cli->execute($commandline); |
|
| 44 | ||
| 45 | $this->_exists[$path] = (0 === $exitCode); |
|
| 46 | } |
|
| 47 | ||
| 48 | return $this->_exists[$path]; |
|
| 49 | } |
|
| 50 | ||
| 51 | /** |
|
| 52 | * Create a directory on the remote server |
|
| @@ 37-49 (lines=13) @@ | ||
| 34 | * @param string $path remote source path |
|
| 35 | * @return bool true when the resource exists, false otherwise |
|
| 36 | */ |
|
| 37 | public function exists($path) |
|
| 38 | { |
|
| 39 | if (false === isset($this->_exists[$path])) { |
|
| 40 | $remoteCommand = sprintf("test -e %s", $path); |
|
| 41 | $commandline = sprintf("ssh %s@%s \"%s\"", $this->getUser(), $this->getHost(), $remoteCommand); |
|
| 42 | ||
| 43 | $exitCode = $this->cli->execute($commandline); |
|
| 44 | ||
| 45 | $this->_exists[$path] = (0 === $exitCode); |
|
| 46 | } |
|
| 47 | ||
| 48 | return $this->_exists[$path]; |
|
| 49 | } |
|
| 50 | ||
| 51 | /** |
|
| 52 | * Create a directory on the remote server |
|