我在 appengine 上部署了一个 php 应用程序,它依赖于燃料/邮件,它本身依赖于 guzzle/guzzle。当我尝试使用电子邮件附加和发送文件时,它会失败,因为 is_readable 在实际存在且可读的文件上返回 false。以下是复制事物的方法:
//done in my app following recomendation on appengine documentation page
$dir = sys_get_temp_dir();
$tmp = tempnam($dir, 'foo.txt');
echo $tmp; // => "vfs://root/temp/foo.txt581fd3e4e1ca86.63583518"
file_put_contents($tmp, 'hello');
//just to check
echo 'file content : '.file_get_contents($tmp); // => "file content : hello"
//done in guzzle/guzzle
echo('file is readable : '.(is_readable($tmp)?'true':'false')); // => "file is readable : false"
由于 is_readable 返回 false,所以整个事情都失败了。请注意,它正在处理 apache/php 部署。
那么,我做错了吗?应用引擎环境是否表现得不正常?guzzle 没有正确使用 is_readable 吗?如果问题不是来自我,在等待修复时有什么解决方法吗?