note 11356 added to include
| From: | php at tyra dot ch | Date: | Sat, 17 Feb 2001 22:12:59 +0000 |
| Subject: | note 11356 added to include | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-11186@lists.php.net to get a copy of this message | ||
if you have a setup like me:
global_server_php_include_path/php_modules/...
local_web_site_php_include_path/something...
local_web_site/...
and you want to include a module that might include a template file that belongs to it, eg is in the
same subfolder representing the module. There is a problem in reading this template file because you
don't know where you are (absolute file path) and you don't want to set a global parameter
on ever local website that says where your global php folder is.
A workaround for this problem could be the following: $path = dirname(__FILE__);
this will get the path where the file is laying that is getting processed at the moment (eg your
global module handler).
Hope that helps
Tim
http://www.php.net/manual/en/function.include.php