1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-07-31 18:30:20 +02:00

Uploading new plugins via the admin panel #215

This commit is contained in:
metal_gvc
2014-02-09 21:09:40 +02:00
parent 9a6329a6cd
commit bcac217db3
3 changed files with 119 additions and 0 deletions

View File

@@ -203,4 +203,26 @@ class Dir
return $total_size;
}
/**
* Copy directory.
* <code>
* Dir::copy('source_folder_path', 'destination_folder_path);
* </code>
* @param $src
* @param $dst
*/
public static function copy($src, $dst) {
$dir = opendir($src);
@mkdir($dst);
while(false !== ( $file = readdir($dir)) ) {
if (( $file != '.' ) && ( $file != '..' )) {
if ( is_dir($src .'/'. $file) ) {
self::copy($src .'/'. $file, $dst .'/'. $file);
} else {
copy($src .'/'. $file,$dst .'/'. $file);
}
}
}
closedir($dir);
}
}