Hi,

if I understand this correctly, a module looses its context if it is
required or included.

For example I have a module foo/a.php which is required by b.php via
require ("foo/a.php").  Unfortunately within the module a.php the cwd()
is not foo but the context of b.php. The easiest way to fix this would
be to define a new function my_require() which does a
chdir(basename(path)) before the module is included (or one could pass
an environment variable if chdir() is deprecated).  

What is the recommended way for an included or required module to look
for a resource?


BTW: Why is the syntax so that I have to give the full filename of the
module, not only the module name?  For example a require("foo/a") should
also work, but currently doesn't.  I guess PHP currently does not
support pre-compiled modules, does it? :)


Jost

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to