library/FileCopier.php
public function copyFiles($source, $target, $setPermissions = false)
    {
        if (strpos($target, ':') !== false && strpos($target, '@') !== false) {
            if (is_dir($source)) {
                $source .= "/.";
            }
            $command = "scp -rp " . escapeshellarg($source) . " " . escapeshellarg($target);
            if ($setPermissions) {
                $command = "rsync -rp --perms --chmod=u+rwx,g+rwx,o+rwx " . escapeshellarg($source) . " " . escapeshellarg($target);
            }
        } else {
            $command = "cp -frT " . escapeshellarg($source) . " " . escapeshellarg($target);
            if ($setPermissions) {
                $command .= " && chmod 777 " . escapeshellarg($target);
            }
        }
        $this->executeCommand($command);
    }
public function copyFiles($source, $target, $setPermissions = false)
    {
        if (strpos($target, ':') !== false && strpos($target, '@') !== false) {
            if (is_dir($source)) {
                $source .= "/.";
            }
            $command = "scp -rp " . escapeshellarg($source) . " " . escapeshellarg($target);
            if ($setPermissions) {
                $command = "rsync -rp --perms --chmod=u+rwx,g+rwx,o+rwx " . escapeshellarg($source) . " " . escapeshellarg($target);
            }
        } else {
            $command = "cp -frT " . escapeshellarg($source) . " " . escapeshellarg($target);
            if ($setPermissions) {
                $command .= " && chmod 777 " . escapeshellarg($target);
            }
        }
        $this->executeCommand($command);
    }
public function copyFiles ( $ source , $ target , $ setPermissions = false ) { if ( strpos ( $ target , ':' ) !== false && strpos ( $ target , '@' ) !== false ) { if ( is_dir ( $ source ) ) { $ source .= "/." ; } $ command = "scp -rp " . escapeshellarg ( $ source ) . " " . escapeshellarg ( $ target ) ; if ( $ setPermissions ) { $ command = "rsync -rp --perms --chmod=u+rwx,g+rwx,o+rwx " . escapeshellarg ( $ source ) . " " . escapeshellarg ( $ target ) ; } } else { $ command = "cp -frT " . escapeshellarg ( $ source ) . " " . escapeshellarg ( $ target ) ; if ( $ setPermissions ) { $ command .= " && chmod 777 " . escapeshellarg ( $ target ) ; } } $ this -> executeCommand ( $ command ) ; }
Copy files to shop

@param string $source          File or directory to copy.
@param string $target          Path where to copy.
@param bool   $setPermissions Whether to set given Target permissions to 777.
Copy files to shop