class FTP extends Driver {
public function copy($source, $dest, $mirror = false, $dryrun = false) {
$lftp = new LFTP();
+ $lftp->setServer($this->getServer());
$lftp->setSrc($source);
$lftp->setDest($dest);
$lftp->setMirror($mirror);
- $lftp->setServer($this->getServer());
$lftp->setDryRun($dryrun);
$lftp->execute();
return $lftp;
use Cubist\Util\CommandLine\Rsync;
class Local extends Driver {
- protected $_basePath = '';
+ protected $_rootPath = '';
- public function __construct(IServer $server, $basePath = null) {
+ public function __construct(IServer $server, $rootPath = null) {
parent::__construct($server);
- if (null !== $basePath) {
- $this->setBasePath($basePath);
+ if (null !== $rootPath) {
+ $this->setRootPath($rootPath);
}
}
/**
- * @param string $basePath
+ * @param string $rootPath
*/
- public function setBasePath($basePath) {
- $this->_basePath = $basePath;
+ public function setRootPath($rootPath) {
+ $this->_rootPath = $rootPath;
}
/**
* @return string
*/
- public function getBasePath() {
- return $this->_basePath;
+ public function getRootPath() {
+ return $this->_rootPath;
}
/**
* @return string
*/
protected function _destPath($path) {
- return rtrim($this->getBasePath(), '/') . '/' . self::_cleanInstallDir($path) . '/';
+ return rtrim($this->getRootPath(), '/') . '/' . self::_cleanInstallDir($path) . '/';
}
public function copy($source, $dest, $mirror = false, $dryrun = false) {
$rsync = new Rsync($source, $dest);
+ $rsync->setServer($this->getServer());
+ $rsync->setBasePath(rtrim($this->getRootPath(), '/') . '/' . ltrim($this->getServer()->getBasePath(), '/'));
$rsync->setMirror($mirror);
$rsync->setDryRun($dryrun);
$rsync->execute();