Opened 16 years ago

Closed 16 years ago

#158 closed refactoring (fixed)

include and require with dirname when using relative paths

Reported by: christoph Owned by: mapbender_dev@…
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.

Change History (1)

comment:1 by christoph, 16 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.