I am trying to zip files and I want to set the permission to chmod 777. But i don't know how/where I should write the chmod 777. Could anyone please help me? This is my code for zipping files.
$files = array(
'download.xml',
'script_.xml',
);
$zip = new ZipArchive();
$zip_name = "testabc.package";
if($zip->open($zip_name, ZIPARCHIVE::CREATE)!==TRUE){
$error .= "* Sorry ZIP creation failed at this time";
}
foreach($files as $file){
$zip->addFile($file);
}
$zip->close();
echo shell_exec("zip -P pass test.zip script.xml");