I hope that this is an appropriate place to post a feature request!
I posted a message on the Zend.com "into the future" forum about having a function that would return the full path to a file relative to the current executing script, and NOT the first script called, i.e.:
Instead of doing:
include_once realpath(dirname(FILE).'/../example.php');
As you have to do now, you could do:
include_once relative_path('../example.php');
What do you think?
Regards,
Kelvin
Kelvin Jones wrote:
include_once realpath(dirname(FILE).'/../example.php');
what do you need the realpath() call for? (that's already taken care of internaly in the *_once() functions)
--
Six Offene Systeme GmbH http://www.six.de/ i.A. Hartmut Holzgraefe Email: hartmut@six.de Tel.: +49-711-99091-77
Sie finden uns auf der CeBIT in Halle 6/H44 http://www.six.de/cebit2003/
Hartmut Holzgraefe wrote:
Kelvin Jones wrote:
include_once realpath(dirname(FILE).'/../example.php');
BTW: don't we have DIR by now?
--
Six Offene Systeme GmbH http://www.six.de/ i.A. Hartmut Holzgraefe Email: hartmut@six.de Tel.: +49-711-99091-77
Sie finden uns auf der CeBIT in Halle 6/H44 http://www.six.de/cebit2003/
DIR would be cool.
Do other functions that take filename parameters also expand the paths? i.e.: fopen() ..etc.
If they do, then maybe there isn't a need for a function as long as there's a DIR constant to easily get the current directory.
Quoting Hartmut Holzgraefe hartmut@six.de:
Quoted text · 7 lines
Hartmut Holzgraefe wrote:
Kelvin Jones wrote:
include_once realpath(dirname(FILE).'/../example.php');
BTW: don't we have DIR by now?
--
Six Offene Systeme GmbH http://www.six.de/ i.A. Hartmut Holzgraefe Email: hartmut@six.de Tel.: +49-711-99091-77Sie finden uns auf der CeBIT in Halle 6/H44 http://www.six.de/cebit2003/
Quoted text · 7 lines
I hope that this is an appropriate place to post a feature request!
I posted a message on the Zend.com "into the future" forum about having a function that would return the full path to a file relative to the current executing script, and NOT the first script called, i.e.:
Instead of doing:
include_once realpath(dirname(FILE).'/../example.php');
As you have to do now, you could do:
include_once relative_path('../example.php');
What do you think?
Just set your include path correctly?
Derick
--
"my other box is your windows PC"
Derick Rethans http://derickrethans.nl/ PHP Magazine - PHP Magazine for Professionals http://php-mag.net/
That's right.
And not only that.. not all people have access to set things like the include path themselves, and would have to do it in every script they run using ini_set ().
And just because there's a workaround for a problem, doesn't mean we can't provide a better solution.
Kelvin
Quoting Daniel Lorch daniel@lorch.cc:
Quoted text · 5 lines
hi,
What do you think?
Just set your include path correctly?
I don't think that was his point. If file A includes file B and file B in- cludes another file, say file C, then file C will be included with the re- lative path of file A (and not file B as expected).
-daniel