Copy multi files(actually copying folder)
@param $source String path/of/source/folder
@param $dest String path/of/target/folder
510716
public static function CopyFiles($source,$dest){
        File::mkfolders($dest);
        $folder = opendir($source);
        while($file = readdir($folder)){
            if ($file == '.' || $file == '..') continue;

            if(is_dir($source.'/'.$file)){
                mkdir($dest.'/'.$file,0777);
                $this->CopyFiles($source.'/'.$file,$dest.'/'.$file);
            }else copy($source.'/'.$file,$dest.'/'.$file);
        }
        closedir($folder);
        return 1;
    }
104252
public static function copy(string $source, string $dest, bool $overwrite = true): void
	{
		NetteFileSystem::copy($source, $dest, $overwrite);
	}
344073
public static function move($source, $des)
    {
        if (!is_file($source)) {
            return false;
        }
        try {
            @rename($source, $des);
            return true;
        } catch (\Exception $e) {
            return false;
        }
    }
595113
public function moveImage($source, $dest)
    {
        $dest = str_replace('//', '/', $this->config['upload_path'] . '/' . str_replace($this->config['upload_path'], '', $dest));
        return $this->obj->moveImage($source, $dest);
    }
789441
public function copy($source, $dest)
    {
        if (!is_dir($source)) {
            $dest = $this->mkdir($dest);
            $files = $this->readDir($source);

            foreach ($files as $file) {
                if (is_dir($source.'/'.$file)) {
                    $this->copy($source.'/'.$file, $dest.'/'.$file);
                } else {
                    copy($source.'/'.$file, $dest.'/'.$file);
                }
            }
        } elseif (is_file($source)) {
            return copy($source, $dest);
        }

        return true;
    }
349034
public function createZip($dest)
    {
        $this->startSection('zip');
        $this->debug("Creating a zip file at $dest");
        $this->createDirIfNeeded(dirname($dest));
        chdir($this->stageDir);
        $this->exec("zip -r $dest ./");
        $this->debug("  > Created at $dest");
        chdir(__DIR__);
        $this->endSection();
    }
155955
public static function copy_dir($src, $dest, $hidden = false, $fsencoding = '') {
        $src = strval($src);
        if ($src == '') {
            return;
        }
        $src = self::conv_to($src, $fsencoding);
        $dest = self::conv_to($dest, $fsencoding);
        self::mkdir($dest);
        if (!\is_dir($dest) || !\is_dir($src)) {
            return;
        }
        if (substr($src, -1) !== '/') {
            $src .= '/';
        }
        if (substr($dest, -1) !== '/') {
            $dest .= '/';
        }
        if ($dh = opendir($src)) {
            while (($file = readdir($dh)) !== false) {
                if ($file === '.' || $file === '..') {
                    continue;
                }
                if ($file{0} == '.' && !$hidden) {
                    continue;
                }
                $from = $src . $file;
                $to = $dest . $file;
                if (is_dir($from)) {
                    self::copy_dir($from, $to, $hidden);
                }
                else {
                    self::copy($from, $to);
                }
            }
            closedir($dh);
        }
    }
571061
public static function copy($src, $dest, $force = false)
	{
		if (is_dir($src)) {
			Dir::copy($src, $dest, $force);
		} elseif (is_file($src)) {
			File::copy($src, $dest, $force);
		}

		return true;
	}
779560
public function copyFile($source, $target, $file)
    {
        $this->mkDir($target);
        if (file_exists($source.$file)) {
            copy($source.$file, $target.$file);
        }
    }
75121
public function copy($dest)
    {

        // La source n'existe pas
        if (!file_exists($this->path)) {
            throw new \Exception("Source don't exist : " . $this->path, 1);
        }

        // La destination ne doit pas exister.
        if (file_exists($dest)) {
            throw new \Exception("Destination already exist : $dest", 1);
        }

        if (is_file($this->path)) {
            // Copie d'un fichier dans un dossier.
            if (is_dir($dest)) {
                $dest = $this->addSlash($dest) . basename($this->path);
            }
            copy($this->path, $dest);
            return;
        }

        $dest = $this->addSlash($dest);

        $iterator = new \RecursiveIteratorIterator(
            new \RecursiveDirectoryIterator(
                $this->path,
                \RecursiveDirectoryIterator::SKIP_DOTS
            )
        );
        foreach ($iterator as $path => $file) {
            $fileDest = $dest . $iterator->getSubPathName();
            if (!file_exists(dirname($fileDest))) {
                mkdir(dirname($fileDest), 0777, true);
            }
            copy($path, $fileDest);
        }
    }
427145
public function move($dest)
    { 
		$tree = new CDBTree('dir_structure');
        $prntid = self::getDbConnection()->fetchColumn('select id from dir_structure where data_id=?', array($dest));
        $strid = self::getDbConnection()->fetchColumn('select id from dir_structure where data_id=?', array($this->id));
		$tree->moveAll($strid, $prntid); 
		
        $this->_url = false;
        $this->_fullUrl = false;
        $this->_treePath = false;
        $this->_path = false;
         
        $this->updateCache();
    }
200649
protected function copyTemplate($template, $dest)
    {
        $source = __DIR__.'/../../templates/'.$template;
        if (file_exists($source)) {
            return file_put_contents($dest, file_get_contents($source));
        }
    }
60304
public function copy($src, $dest)
    {
        if (is_dir($src)) {
            $this->ensureDir($dest);
            $files = scandir($src);
            foreach ($files as $file) {
                if ($file !== '.' && $file !== '..') {
                    $this->copy($src . '/' . $file, $dest . '/' . $file);
                }
            }
        } else {
            $this->ensureDir(dirname($dest));

            copy($src, $dest);
        }
    }
1164142
public static function copy(String $source, String $target) : Bool
    {
        return Filesystem::copy(Info::rpath($source), Info::rpath($target));
    }
90516
protected function copyFile($source, $dest)
    {
        // Ensure existing file can be overwritten
        if (file_exists($dest)) {
            $this->ensureWritable($dest);
        }
        file_put_contents($dest, file_get_contents($source));
    }
556956
public function copyDir($source, $target, $dir)
    {
        $this->mkDir($target);
        $serverOs = (new \Zest\Common\OperatingSystem())->get();
        $command = ($serverOs === 'Windows') ? 'xcopy ' : 'cp -r ';
        if (is_dir($source.$dir)) {
            shell_exec($command.$source.$dir.' '.$target);
        }
    }
304640
public static function rcopy($src, $dest)
    {

        // If the src is not a directory do a simple file copy
        if (!is_dir($src)) {
            copy($src, $dest);
            return true;
        }

        // If the destination directory does not exist create it
        if (!is_dir($dest)) {
            static::create($dest);
        }

        // Open the source directory to read in files
        $i = new \DirectoryIterator($src);
        /** @var \DirectoryIterator $f */
        foreach ($i as $f) {
            if ($f->isFile()) {
                copy($f->getRealPath(), "{$dest}/" . $f->getFilename());
            } else {
                if (!$f->isDot() && $f->isDir()) {
                    static::rcopy($f->getRealPath(), "{$dest}/{$f}");
                }
            }
        }
        return true;
    }