public function call($hostname, $source, $destination, array $config = [])
    {
        $defaults = [
            'timeout' => null,
            'options' => [],
        ];
        $config = array_merge($defaults, $config);

        $escapedSource = escapeshellarg($source);
        $escapedDestination = escapeshellarg($destination);
        $rsync = "rsync -azP " . implode(' ', $config['options']) . " $escapedSource $escapedDestination";

        $this->pop->command($hostname, $rsync);

        $process = new Process($rsync);
        $process
            ->setTimeout($config['timeout'])
            ->mustRun($this->pop->callback($hostname));
    }
public function call($hostname, $source, $destination, array $config = [])
    {
        $defaults = [
            'timeout' => null,
            'options' => [],
        ];
        $config = array_merge($defaults, $config);

        $escapedSource = escapeshellarg($source);
        $escapedDestination = escapeshellarg($destination);
        $rsync = "rsync -azP " . implode(' ', $config['options']) . " $escapedSource $escapedDestination";

        $this->pop->command($hostname, $rsync);

        $process = new Process($rsync);
        $process
            ->setTimeout($config['timeout'])
            ->mustRun($this->pop->callback($hostname));
    }
public function call ( $ hostname , $ source , $ destination , array $ config = [ ] ) { $ defaults = [ 'timeout' => null , 'options' => [ ] , ] ; $ config = array_merge ( $ defaults , $ config ) ; $ escapedSource = escapeshellarg ( $ source ) ; $ escapedDestination = escapeshellarg ( $ destination ) ; $ rsync = "rsync -azP " . implode ( ' ' , $ config [ 'options' ] ) . " $escapedSource $escapedDestination" ; $ this -> pop -> command ( $ hostname , $ rsync ) ; $ process = new Process ( $ rsync ) ; $ process -> setTimeout ( $ config [ 'timeout' ] ) -> mustRun ( $ this -> pop -> callback ( $ hostname ) ) ; }
Start rsync process

@param $hostname
@param $source
@param $destination
@param array $config
Start rsync process