Hi all
I have an issue that I can't wrap my head around.
I have a file in the folder: PIP/folder/file.php and I need to require a file in PIP/anotherfolder/foldermore/fileToRequire.php.
The folder PIP is the root folder of the project.
How do I do that? This need to be a generic method, ie no absolute paths.
document paths
Moderator: General Moderators
hi again
I mean a method (or a hint in the right direction
) that will work from every file, that being the root folder 'PIP' and all subfolders 'PIP/whateverFolderIWant To Use/.
The idea is that I am creating new folder that users can put files in, and in these folders I have a standard file that needs to get acces to the framework which is in another subfolder of 'PIP'. (I am using the Smarty framework but I guess this is an PHP path issue).
I mean a method (or a hint in the right direction
The idea is that I am creating new folder that users can put files in, and in these folders I have a standard file that needs to get acces to the framework which is in another subfolder of 'PIP'. (I am using the Smarty framework but I guess this is an PHP path issue).
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
set_include_path() may be of interest. You can also adjust the include paths using .htaccess files in Apache. Another directive that may be of interest is auto_prepend_file and it's sibling auto_append_file.
http://php.net/ini.core for details.
http://php.net/ini.core for details.
Maybe this?
Code: Select all
$pro_root = $_SERVER['DOCUMENT_ROOT'] . '/PIP/';I'll try that tooOren wrote:Maybe this?
Code: Select all
$pro_root = $_SERVER['DOCUMENT_ROOT'] . '/PIP/';