Req #76128 [Com]: PHAR file detection is broken

From: Date: Thu, 12 Dec 2019 10:44:30 +0000
Subject: Req #76128 [Com]: PHAR file detection is broken
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-224227@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76128&edit=1 ID: 76128 Comment by: ojrask at gmail dot com Reported by: kelunik@php.net Summary: PHAR file detection is broken Status: Open Type: Feature/Change Request Package: PHAR related Operating System: Linux PHP Version: 7.2.3 Block user comment: N Private report: N New Comment: As it seems like a feature request, I would like to +1 the request. It would be nice to have a way to include/require PHARs without the extension in place, and let the developer handle situations where the file being loaded is not an actual PHAR. Previous Comments: ------------------------------------------------------------------------ [2018-08-20 13:48:20] cmb@php.net Related To: Bug #76061 ------------------------------------------------------------------------ [2018-08-14 16:46:28] cmb@php.net The documentation states[1]: | The file name's extension must contain .phar. So this is not a bug, but rather a feature request, in my opinion. [1] <http://php.net/manual/en/phar.construct.php> ------------------------------------------------------------------------ [2018-06-16 08:16:15] maikuolan at gmail dot com #76061 and #76128 might be related (not sure). https://bugs.php.net/bug.php?id=76061 https://bugs.php.net/bug.php?id=76128 ------------------------------------------------------------------------ [2018-03-21 13:44:19] kelunik@php.net Description: ------------ Detecting the PHAR in a file path like 'phar:///home/kelunik/acme-client.phar/vendor/autoload.php' works, but it fails if there's no '.phar' extension. 'phar:///home/kelunik/acme-client/vendor/autoload.php' therefore doesn't work if the PHAR is renamed to 'acme-client'. Finding the PHAR in such a path isn't possible with quite some I/O. Because of that, I propose to use a non-valid character such as a NUL-byte to separate the PHAR path from the path inside the PHAR. I think Java uses ! or # or so as a separator. Expected result: ---------------- File functions work regardless of the file name of the PHAR. Actual result: -------------- File functions are broken if the PHAR doesn't end with '.phar'. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=76128&edit=1

« previous php.bugs (#224227) next »