static function copy($srcDir, $destDir, $overwrite = true) {
        Directory::create($destDir);

        $dir = new \DirectoryIterator($srcDir);
        foreach ($dir as $dirContent) {
            if ($dirContent->isFile() || $dirContent->isLink()) {
                $target = $destDir.'/'.$dirContent->getFilename();
                if ($overwrite || !file_exists($target)) {
                    copy($dirContent->getPathName(), $target);
                }
            } else if (!$dirContent->isDot() && $dirContent->isDir()) {
                self::copy($dirContent->getPathName(), $destDir.'/'.$dirContent->getFilename(), $overwrite);
            }
        }
    }
static function copy($srcDir, $destDir, $overwrite = true) {
        Directory::create($destDir);

        $dir = new \DirectoryIterator($srcDir);
        foreach ($dir as $dirContent) {
            if ($dirContent->isFile() || $dirContent->isLink()) {
                $target = $destDir.'/'.$dirContent->getFilename();
                if ($overwrite || !file_exists($target)) {
                    copy($dirContent->getPathName(), $target);
                }
            } else if (!$dirContent->isDot() && $dirContent->isDir()) {
                self::copy($dirContent->getPathName(), $destDir.'/'.$dirContent->getFilename(), $overwrite);
            }
        }
    }
static function copy ( $ srcDir , $ destDir , $ overwrite = true ) { Directory :: create ( $ destDir ) ; $ dir = new \ DirectoryIterator ( $ srcDir ) ; foreach ( $ dir as $ dirContent ) { if ( $ dirContent -> isFile ( ) || $ dirContent -> isLink ( ) ) { $ target = $ destDir . '/' . $ dirContent -> getFilename ( ) ; if ( $ overwrite || ! file_exists ( $ target ) ) { copy ( $ dirContent -> getPathName ( ) , $ target ) ; } } else if ( ! $ dirContent -> isDot ( ) && $ dirContent -> isDir ( ) ) { self :: copy ( $ dirContent -> getPathName ( ) , $ destDir . '/' . $ dirContent -> getFilename ( ) , $ overwrite ) ; } } }
Copy a content directory into an other
@param string $srcDir  the directory from which content will be copied
@param string $destDir the directory in which content will be copied
@param boolean $overwrite set to false to not overwrite existing files in
the target directory
Copy a content directory into an other