Google应用引擎php zip扩展 [英] Google app engine php zip extension

查看:127
本文介绍了Google应用引擎php zip扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Google应用引擎,并且想使用当前版本支持的zip扩展名创建zip存档。问题是,我每次调用ZipArchive :: close它都返回false,ZipArchive :: getStatusString返回无法创建临时文件:只读文件系统。我在这样的云存储中创建了zip文件:

  $ zip = new ZipArchive(); 
$ zip-> open(gs://whatever/somethig.zip,ZipArchive :: OVERWRITE); //返回true
$ zip-> addFromString('file.txt',some random data); //返回true
$ zip-> numFiles; // = 1
$ zip-> close(); //返回false
$ zip-> getStatusString(); //返回创建临时文件失败:只读文件系统

它应该是可写的,它实际上是与file_set_content或其他。我尝试了一些相同的代码:


  1. 已存在的zip文件;
  2. 不现有的zip文件;
  3. ZipArchive :: CREATE作为ZipArchive :: open调用的第二个参数

  4. 使用ZipArchive :: addFile添加文件来自云端存储

也许它会尝试在其他地方创建临时文件,而不是在云存储上,这样做是非常常见的情况,我怀疑这是一个应用引擎错误,毕竟他们声称他们支持zip扩展 here



有人知道可能是什么问题吗?

谢谢。

解决方案

看起来像一个错误 - 你能否在问题跟踪器


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:

  1. already existing zip file;
  2. not existing zip file;
  3. ZipArchive::CREATE as a second parameter of the ZipArchive::open call
  4. 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.

解决方案

Looks like a bug - can you open an issue in the issue tracker?

这篇关于Google应用引擎php zip扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆