|
|
|
@ -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
|
|
|
|
|