File tree Expand file tree Collapse file tree 1 file changed +24
-3
lines changed
Expand file tree Collapse file tree 1 file changed +24
-3
lines changed Original file line number Diff line number Diff line change 22 error_reporting (E_ALL ^ E_NOTICE ^ E_WARNING );
33 class Copy {
44
5+ function rrmdir ($ dir )
6+ {
7+ if (is_dir ($ dir ))
8+ {
9+ $ objects = scandir ($ dir );
10+
11+ foreach ($ objects as $ object )
12+ {
13+ if ($ object != '. ' && $ object != '.. ' )
14+ {
15+ if (filetype ($ dir .'/ ' .$ object ) == 'dir ' ) {$ this ->rrmdir ($ dir .'/ ' .$ object );}
16+ else {unlink ($ dir .'/ ' .$ object );}
17+ }
18+ }
19+
20+ reset ($ objects );
21+ rmdir ($ dir );
22+ }
23+ }
24+
525 function recursive_copy ($ src , $ dst ) {
626 if (is_dir ($ src )) {
727 $ dir = opendir ($ src );
8-
928 mkdir ($ dst , 0777 , true );
1029
1130 while (( $ file = readdir ($ dir )) ) {
@@ -51,8 +70,10 @@ function recursive_copy($src, $dst) {
5170
5271 $ fix_dst = isset ($ json ['default_copy_path ' ]) ? $ current_path . $ json ['default_copy_path ' ] . '/ ' : $ current_path ;
5372
54- include_once $ current_path . $ json ['default_path ' ] . '/admin/config.php ' ;
55- include_once $ current_path . $ json ['default_path ' ] . '/config.php ' ;
73+ @$ copy ->rrmdir ($ fix_dst . $ folder );
74+
75+ @require_once $ current_path . $ json ['default_path ' ] . '/admin/config.php ' ;
76+ @require_once $ current_path . $ json ['default_path ' ] . '/config.php ' ;
5677
5778 foreach ($ json ['all_files ' ] as $ key => $ folder ) {
5879 $ copy ->recursive_copy ($ current_path . $ json ['default_path ' ] . '/ ' . $ folder , $ fix_dst . $ folder );
You can’t perform that action at this time.
0 commit comments