namespace Cubist\Net\Transfer;
use Cubist\Util\CommandLine\Rsync;
+use Cubist\Util\Files\Files;
class Local extends Driver
{
}
}
- protected function synchronizeFiles($source, $dest, $mirror = false, $dryrun = false) {
+ protected function synchronizeFiles($source, $dest, $mirror = false, $dryrun = false)
+ {
//
}
public function copy($source, $dest, $mirror = false, $dryrun = false)
{
- if($this->checkConnexion() !== true) {
- throw new \Exception('Unabled to connect to this server (error code : '. $this->checkConnexion() .' )');
+ if ($this->checkConnexion() !== true) {
+ throw new \Exception('Unabled to connect to this server (error code : ' . $this->checkConnexion() . ' )');
}
$rsync = new Rsync($source, $dest);
$rsync->setServer($this->getServer());
protected function _basePath()
{
- return rtrim($this->getRootPath(), '/') . '/' . ltrim($this->getServer()->getBasePath(), '/');
+ return Files::mkdir(rtrim($this->getRootPath(), '/') . '/' . ltrim($this->getServer()->getBasePath(), '/'));
}
public function copyFile($source, $dest)
return copy($source, $this->_basePath() . '/' . $dest);
}
- public function checkConnexion($data = []) {
- if(file_exists($this->getRootPath().'status')) {
+ public function checkConnexion($data = [])
+ {
+ if (file_exists($this->getRootPath() . 'status')) {
return true;
} else {
return static::ERROR_FOLDER_UNMOUNT;