i have zip archive and after extract him i need to check if moduleConfig.xml exist inside zip archive. How i can do that.
I try this
$zip = new ZipArchive();
if($zip->open('test.zip') === TRUE )
{
if(file_exists($zip->getFromName('moduleConfig.xml')))
{
echo "Config exists";
// Do somthing
}
}
else {
echo 'Failed code:'. $res;
}
It should be like this:
$zip = new ZipArchive();
if($zip->open('test.zip') === TRUE )
{
if ($zip->locateName('moduleConfig.xml') !== false)
{
echo "Config exists";
}
}
else {
echo 'Failed code:'. $res;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With