library directory path question[Solved]

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

library directory path question[Solved]

Post 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.
Last edited by yacahuma on Tue Dec 18, 2007 7:34 pm, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

set_include_path() and the use of PATH_SEPARATOR, and get_include_path().
Post Reply