On Tue, 2003-06-17 at 12:08, Mike Morton wrote: > I have an application that I set the include directory using the ini_set > (the application assumes that the client does not have access to the php.ini > files). > > I can set the first include path of course: > ini_set("include_path","/Library/WebServer/Documents/includes"); > > But how do I set additional paths like in the ini file? If I try to do > another ini set, then it replaces the initial one, and I cannot seem to find > any way to set more than one path in the initial ini_set above.... > > Does anyone know how this can be done? Thanks :)
Separate the paths with semicolons or colons depending on your OS. You can also check existing values using ini_get() and modify based on that. I like to use something like the following: <?php error_reporting(E_ALL); ini_set('display_errors', true); function add_to_include_path($path) { $path = (string) $path; $existing_path = ini_get('include_path'); if (false !== strpos($existing_path, $path)) { // Already in the path; exit. return true; } ini_set('include_path', $existing_path . ':' . $path); return true; } echo ini_get('include_path') . "\n"; add_to_include_path('/home/torben/bin'); echo ini_get('include_path') . "\n"; ?> Hope this helps, Torben -- Torben Wilson <[EMAIL PROTECTED]> +1.604.709.0506 http://www.thebuttlesschaps.com http://www.inflatableeye.com http://www.hybrid17.com http://www.themainonmain.com -----==== Boycott Starbucks! http://www.haidabuckscafe.com ====----- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php