[Mapbender-dev] [Mapbender] #158: include and require with dirname when using relative paths

Mapbender info at osgeo.org
Thu Jan 10 07:40:03 EST 2008


#158: include and require with dirname when using relative paths
-------------------------+--------------------------------------------------
 Reporter:  christoph    |       Owner:  mapbender_dev at lists.osgeo.org
     Type:  refactoring  |      Status:  new                          
 Priority:  major        |   Milestone:  2.5 release                  
Component:  core         |     Version:  2.4.4                        
 Keywords:               |  
-------------------------+--------------------------------------------------
 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.

-- 
Ticket URL: <http://trac.osgeo.org/mapbender/ticket/158>
Mapbender <http://www.mapbender.org/>
Mapbender


More information about the Mapbender_dev mailing list