示例#1
0
/**
 * 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);
}
示例#2
0
 public function mk()
 {
     mkdir_fix($this->getFullPath());
     return $this;
 }