PHP:
Ik wil een bestand relatief ten opzichte van het huidige bestand includen, onafhankelijk van de current working directory, het include path en de directory van het 'root' script (dat wordt aangeroepen door de browser).1
| require_once('common.php'); |
Dit lijkt echter absoluut niet mogelijk.
Ik kan geen manier vinden om achter de volledige bestandsnaam van het huidige bestand te komen.
Is er iemand die hier een fatsoenlijke oplossing voor heeft?
Files for including are first looked in include_path relative to the current working directory and then in include_path relative to the directory of current script. E.g. if your include_path is ., current working directory is /www/, you included include/a.php and there is include "b.php" in that file, b.php is first looked in /www/ and then in /www/include/. If filename begins with ./ or ../, it is looked only in include_path relative to the current working directory.
[ Voor 3% gewijzigd door Olaf van der Spek op 14-04-2006 13:39 ]