问题
I am using Google app engine and I want to create a zip archive using the zip extension which is supported in the current version. The problem is that every time i call ZipArchive::close it returns false and ZipArchive::getStatusString returns "Failure to create temporary file: Read-only file system". I am creating the zip file in the cloud storage like this:
$zip = new ZipArchive();
$zip->open("gs://whatever/somethig.zip", ZipArchive::OVERWRITE); //returns true
$zip->addFromString('file.txt', "some random data"); //returns true
$zip->numFiles; // = 1
$zip->close(); // returns false
$zip->getStatusString(); //returns Failure to create temporary file: Read-only file system
and it should be writable, it actually is with file_set_content or whatever. I tried the same code with a couple of variations:
- already existing zip file;
- not existing zip file;
- ZipArchive::CREATE as a second parameter of the ZipArchive::open call
- Using ZipArchive::addFile to add the file from cloud storage
Maybe it tries to create a temporary file on some other place not on the cloud storage, but this thing that i'm doing is very common scenario and i doubt that this is an app engine bug, after all they claim that they support the zip extension here.
Does someone have some idea what can be the problem?
Thank you.
回答1:
Looks like a bug - can you open an issue in the issue tracker?
来源:https://stackoverflow.com/questions/24145099/google-app-engine-php-zip-extension