Hello Jost,

Sunday, January 4, 2004, 3:09:41 PM, you wrote:

JB> For example I have a module foo/a.php which is required by b.php via
JB> require ("foo/a.php").  Unfortunately within the module a.php the cwd()
JB> is not foo but the context of b.php. The easiest way to fix this would

Makes sense.

JB> be to define a new function my_require() which does a
JB> chdir(basename(path)) before the module is included (or one could pass
JB> an environment variable if chdir() is deprecated).  

Why not just define a global at the start of each file that holds its
location?

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

Because they're not really modules in the C sense, you're just
including a file - the fact it's a PHP one isn't determined by PHP
itself, nor by the file extension. You could be "requiring" an HTML
document for all PHP cares :)

-- 
Best regards,
 Richard                            mailto:[EMAIL PROTECTED]

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

Reply via email to