Bug #76061 [Com]: Phar wrapper and extensionless files
| From: | maikuolan at gmail dot com | Date: | Sat, 16 Jun 2018 08:15:43 +0000 |
| Subject: | Bug #76061 [Com]: Phar wrapper and extensionless files | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-215750@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76061&edit=1
ID: 76061
Comment by: maikuolan at gmail dot com
Reported by: maikuolan at gmail dot com
Summary: Phar wrapper and extensionless files
Status: Open
Type: Bug
Package: PHAR related
Operating System: Linux/*nix/Win
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
#76061 and #76128 might be related (not sure).
https://bugs.php.net/bug.php?id=76061
https://bugs.php.net/bug.php?id=76128
Previous Comments:
------------------------------------------------------------------------
[2018-03-06 13:19:54] maikuolan at gmail dot com
Description:
------------
Attempting to access extensionless ZIP archives using the
phar:// wrapper results in
errors.
Examples (assumes the file being read is an arbitrary ZIP archive containing one or more files):
This:
```
%PATH%>php.exe -r "$foo=scandir('phar://x:/xxx.xxx');var_dump($foo);
```
..generates an array whereby elements represent the files contained by the archive (expected).
Whereas this:
```
%PATH%>php.exe -r "$foo=scandir('phar://x:/xxx');var_dump($foo);
```
..generates this (not expected):
```
PHP Warning: scandir(phar://x:/xxx): failed to open dir: phar error: no directory in
"phar://x:/xxx", must have at least phar://x:/xxx/ for root directory (always use full
path to a new phar)
phar url "phar://x:/xxx" is unknown in Command line code on line 1
PHP Warning: scandir(): (errno 9): Bad file descriptor in Command line code on line 1
bool(false)
```
Bug discovered via: https://github.com/phpMussel/phpMussel/issues/155
Reproduced against latest releases on all currently supported branches (5.6, 7.0, 7.1, 7.2). Not
tested against any older versions or unsupported branches.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76061&edit=1