示例#1
0
 public function testRsyncWithTimes()
 {
     $rsync = new Rsync();
     $rsync->setTimes(true);
     $expected = "/usr/bin/rsync -La --times /origin /target";
     $actual = $rsync->getCommand('/origin', '/target')->getCommand();
     $this->assertEquals($expected, $actual);
 }
示例#2
0
文件: Pull.php 项目: VonUniGE/consh
 public function run($args)
 {
     $cli = new CLImate();
     $origin = Setting::getSetting('remote:user') . '@' . Setting::getSetting('remote:host') . ':' . Remote::getFilesPath();
     $dest = Local::getFilesPath();
     if (!file_exists($dest)) {
         if (!mkdir($dest, 0777, true)) {
             $cli->error('Could not create local files directory');
             return false;
         }
     }
     $rsync = new Rsync();
     $rsync->setVerbose(true);
     $rsync->setExclude(Setting::getSetting('rsync:excludes'));
     $rsync->sync($origin, $dest);
 }
示例#3
0
 public function testRsyncWithRemoveSourceFile()
 {
     $rsync = new Rsync();
     $rsync->setRemoveSource(true);
     $expected = "/usr/bin/rsync -La --remove-source-files /origin /target";
     $actual = $rsync->getCommand('/origin', '/target')->getCommand();
     $this->assertEquals($expected, $actual);
 }
示例#4
0
 public function testRsyncWithOptionalParametersString()
 {
     $rsync = new Rsync();
     $rsync->setOptionalParameters('zp');
     $expected = "/usr/bin/rsync -Lzpa /origin /target";
     $actual = $rsync->getCommand('/origin', '/target')->getCommand();
 }