/** * Recursively copy all the files from source folder to destination */ public static function recursive_copy($src, $dst) { $dir = opendir($src); @mkdir($dst); while (false !== ($file = readdir($dir))) { if ($file != '.' && $file != '..') { if (is_dir($src . '/' . $file)) { FileController::recursive_copy($src . '/' . $file, $dst . '/' . $file); } else { copy($src . '/' . $file, $dst . '/' . $file); } @chmod($dst . '/' . $file, 0775); @chgrp($dst . '/' . $file, Setting::where('name', 'REGISTRATION_GROUP')->first()->setting); } } closedir($dir); }
/** * Recursively copy all the files from source folder to destination */ private function recursive_copy($src, $dst) { FileController::recursive_copy($src, $dst); }