Bug #52769 [Opn->Nab]: realpath not working inside phar

From: Date: Mon, 30 Mar 2015 18:53:36 +0000
Subject: Bug #52769 [Opn->Nab]: realpath not working inside phar
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191735@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=52769&edit=1 ID: 52769 Updated by: mike@php.net Reported by: miha dot vrhovnik at domenca dot com Summary: realpath not working inside phar -Status: Open +Status: Not a bug Type: Bug Package: PHAR related Operating System: any PHP Version: 5.3.3 Block user comment: N Private report: N New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Previous Comments: ------------------------------------------------------------------------ [2011-11-20 08:42:09] maks dot slesarenko at gmail dot com 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 ------------------------------------------------------------------------ [2011-11-20 00:43:30] maks dot slesarenko at gmail dot com 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?! ------------------------------------------------------------------------ [2011-11-15 16:01:05] felipe@php.net Probably related to bug #51806 ------------------------------------------------------------------------ [2010-09-03 12:45:51] 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 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=52769&edit=1

« previous php.bugs (#191735) next »