Page 1 of 1

library directory path question[Solved]

Posted: Tue Dec 18, 2007 5:06 pm
by yacahuma
I being meaning to ask this question for a long time

Let say I have the following project

phpprj1
----file1.php
----file2.php
----mylib
-------lib1.php
-------lib2.php
----admin_folder
-------admin1.php
-------admin2.php


I dont want to set mylib folder in php.ini

in file1.php I use require_once 'mylib/lib1.php';

but in admin1.php I have to use require_once '../mylib/lib1.php';

Is there a better way to do this?


Thank you.

Posted: Tue Dec 18, 2007 6:35 pm
by feyd
set_include_path() and the use of PATH_SEPARATOR, and get_include_path().