Jelix\Installer\AbstractInstaller::_copyDirectoryContent PHP Метод

_copyDirectoryContent() приватный Метод

private function which copy the content of a directory to an other
private _copyDirectoryContent ( string $sourcePath, string $targetPath, $overwrite )
$sourcePath string
$targetPath string
    private function _copyDirectoryContent($sourcePath, $targetPath, $overwrite)
    {
        \jFile::createDir($targetPath);
        $dir = new \DirectoryIterator($sourcePath);
        foreach ($dir as $dirContent) {
            if ($dirContent->isFile()) {
                $p = $targetPath . substr($dirContent->getPathName(), strlen($dirContent->getPath()));
                if ($overwrite || !file_exists($p)) {
                    copy($dirContent->getPathName(), $p);
                }
            } else {
                if (!$dirContent->isDot() && $dirContent->isDir()) {
                    $newTarget = $targetPath . substr($dirContent->getPathName(), strlen($dirContent->getPath()));
                    $this->_copyDirectoryContent($dirContent->getPathName(), $newTarget, $overwrite);
                }
            }
        }
    }