facebook / facebook/hhvm

HHVM doesn't handle file:// scheme in local file IO functions

未关闭
#6,360 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
php5 incompatibility
主要语言
C++
星标
18.7k
派生
3.1k
平均合并
1 小时 47 分钟
30 天内合并 PR
2

描述

Given the following test code:

``` php
$tmp = sys_get_temp_dir();

$file = rtrim("file://$tmp", '/').'/tmp-file';

var_dump(file_exists($file));

touch($file);

var_dump(file_exists($file));

unlink($file);
```

When running through PHP, I get the following results:

``` bash
bool(false)
bool(true)
```

But running through HHVM I get the following:

``` bash
bool(false)

Warning: touch(): Unable to create file /Library/WebServer/Documents/test/file:/var/folders/jb/7wkf3k716b1d9tc4xxxhr4t40000gn/T/tmp-file because No such file or directory in /Library/WebServer/Documents/test/test.php on line 9
bool(false)

Warning: unlink(file:///var/folders/jb/7wkf3k716b1d9tc4xxxhr4t40000gn/T/tmp-file): No such file or directory in /Library/WebServer/Documents/test/test.php on line 13
```

This works correctly if I remove the `file://` scheme from that path

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。