/** * Copy of directory. * @param string $src * @param string $dst * @param boolean $mkdirRecursive * @param int $mkdirMode */ function rcopy($src, $dst, $mkdirRecursive = false, $mkdirMode = 0771) { $dir = opendir($src); mkdir_fix($dst, $mkdirRecursive, $mkdirMode); while (false !== ($file = readdir($dir))) { if ($file != '.' && $file != '..') { if (is_dir($src . '/' . $file)) { rcopy($src . '/' . $file, $dst . '/' . $file, $mkdirMode, $mkdirRecursive); } else { copy($src . '/' . $file, $dst . '/' . $file); } } } closedir($dir); }
public function mk() { mkdir_fix($this->getFullPath()); return $this; }