forked from ZwiiCMS-Team/ZwiiCMS
Effacer createZip
This commit is contained in:
parent
0e4d1ed570
commit
74f0f60a8a
@ -240,37 +240,6 @@ class addon extends common {
|
||||
closedir($dir);
|
||||
}
|
||||
|
||||
/*
|
||||
* Création récursive d'un zip
|
||||
* https://makitweb.com/how-to-create-and-download-a-zip-file-with-php/
|
||||
*/
|
||||
private function createZip($zip,$dir){
|
||||
if (is_dir($dir)){
|
||||
if ($dh = opendir($dir)){
|
||||
while (($file = readdir($dh)) !== false){
|
||||
// If file
|
||||
if (is_file($dir.$file)) {
|
||||
if($file != '' && $file != '.' && $file != '..'){
|
||||
$zip->addFile($dir.$file);
|
||||
}
|
||||
}
|
||||
else{
|
||||
// If directory
|
||||
if(is_dir($dir.$file) ){
|
||||
if($file != '' && $file != '.' && $file != '..'){
|
||||
// Add empty directory
|
||||
$zip->addEmptyDir($dir.$file);
|
||||
$folder = $dir.$file.'/';
|
||||
// Read data of the folder
|
||||
$this->createZip($zip,$folder);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Export des données d'un module externes ou interne à module.json
|
||||
|
Loading…
x
Reference in New Issue
Block a user