|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-09-03 12:45 UTC] miha dot vrhovnik at domenca dot com
Description: ------------ When you run a realpath returns false when run on phar paths. Test script: --------------- put a test script inside \foo\bar\test.php and create a phar where \bar\test.php is inisde it run created phar.. <?php echo (realpath(dirname(__FILE__) . '/../')); Expected result: ---------------- see the full path Actual result: -------------- nothing PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 13:00:01 2025 UTC |
Hi, I'm not PHP Core developer, just developer using php :) I think this is not a bug, functions like chmod, chown and realpath, glob are working only with "file://" stream. And this is correct! realpath() always should provide "real" path on filesytem (file://), not in phar, zip, http or myOwnStream. I can not even imagine what how it will be in other case for ex. realpath('myRegisteredStream://somepath') or chmod('http://google.com', 777) - funny isn't it?!In my scripts I do something like this: define('APPLICATION_PATH', __DIR__); -- path inside phar for loading files define('REAL_PATH', realpath('.')) -- folder where php was called