I'm having major problems with relative paths in PHP, when including and requiring files.
I have a
/dev/system/kernel/kernel.php
/dev/system/kernel/includes/config.php
/dev/demo.php
demo.php includes kernel.php, and kernel.php includes config.php.
With the paths being relative, demo.php happily includes kernel.php, but kernel.php won't include config.php because it tries to use the relative path from demo.php and not itself.
I want each file, e.g. demo.php or index.php to only include kernel.php and let the kernel include anything it needs.
Any ideas how to get round this?
Thanks!
I have a
/dev/system/kernel/kernel.php
/dev/system/kernel/includes/config.php
/dev/demo.php
demo.php includes kernel.php, and kernel.php includes config.php.
With the paths being relative, demo.php happily includes kernel.php, but kernel.php won't include config.php because it tries to use the relative path from demo.php and not itself.
I want each file, e.g. demo.php or index.php to only include kernel.php and let the kernel include anything it needs.
Any ideas how to get round this?
Thanks!