public function copy($path, $dest, $_init = true)
{
if ($_init) {
$path = $this->app->path($path);
$dest = $this->app->path($dest);
}
if (is_dir($path)) {
@mkdir($dest);
$items = scandir($path);
if (sizeof($items) > 0) {
foreach ($items as $file) {
if ($file == "." || $file == "..") {
continue;
}
if (is_dir("{$path}/{$file}")) {
$this->copy("{$path}/{$file}", "{$dest}/{$file}", false);
} else {
copy("{$path}/{$file}", "{$dest}/{$file}");
}
}
}
return true;
} elseif (is_file($path)) {
return copy($path, $dest);
}
return false;
}