return true;
}
+
/**
* @param $local string
* @param $remote string
* @return bool
*/
public function send($local, $remote, $mode = 0644) {
+ if (!file_exists($local)) {
+ throw new \Exception('Local file ' . $local . ' not found');
+ }
+ $dir = dirname($remote);
+ $this->mkdir($dir);
+ $cmd = 'scp -P' . $this->getPort() . ' ' . $local . ' ' . $this->getUsername() . '@' . $this->getHost() . ':/' . ltrim($remote, '/');
+ return `$cmd`;
+ }
+
+
+ /**
+ * @param $remote string
+ * @param $local string
+ * @return bool
+ */
+ public function recv($remote, $local) {
+ $cmd = 'scp -P' . $this->getPort() . ' ' . $this->getUsername() . '@' . $this->getHost() . ':/' . ltrim($remote, '/') . ' ' . $local;
+ return `$cmd`;
+ }
+
+ /**
+ * @param $local string
+ * @param $remote string
+ * @param $mode int
+ * @return bool
+ */
+ public function slowsend($local, $remote, $mode = 0644) {
if (!file_exists($local)) {
throw new \Exception('Local file ' . $local . ' not found');
}
* @param $local string
* @return bool
*/
- public function recv($remote, $local) {
+ public function slowrecv($remote, $local) {
return $this->_copy($this->_filename($remote), $local, false);
}