Opened 17 years ago
Closed 17 years ago
#158 closed refactoring (fixed)
include and require with dirname when using relative paths
Reported by: | christoph | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 2.5 release |
Component: | core | Version: | 2.4.4 |
Keywords: | Cc: |
Description
If you imagine a file requiring files that themselves require other files, you get a tree of requires. The path is always relative to the root of that tree!
This is the reason why we need absolute paths, enable by
require_once(dirname(FILE) . "/relative_path_to_file");
for example
require_once(dirname(FILE)."/../http/php/database-pgsql.php");
In a standard Mapbender installation, not using "dirname" will do no harm, but in complex projects with weird folder structure, it will.
Note:
See TracTickets
for help on using tickets.