I am trying now for some days to fix my php function. For some reason it can´t read a .zip file anymore. It happend after I changed my linux server. Before I had php 5.6 now I have php PHP Version 7.0.22-0ubuntu0.16.04.1. Is there some special php libary required?
Here is my code, but I don´t think there is something wrong cause it worked before:
/*
Get donwloaded version
*/
$downloadVersion = "Unknown";
$fileData = function() {
$file = fopen('zip://interface.zip#php/functions/functions.php', 'r');
if (!$file)
{
die('Can not read zip file! Please be sure, that we have in this folder the interface.zip file!');
};
while (($line = fgets($file)) !== false)
{
yield $line;
};
};
foreach ($fileData() as $line) {
if(strpos($line, "define(\"INTERFACE_VERSION\"") !== false)
{
$lineparts = explode("\"", $line);
$downloadVersion = $lineparts[3];
};
};
BTW the interface.zip file exists I´ve also checked it with the php file_exists function. Also the path and file functions.php exits. Has anybody an idea? If I try to open the page it says:
Can not read zip file! Please be sure, that we have in this folder the interface.zip file!