If you are using PHP 5, you might have some fun with the __autoload() function. I use something like this in production:

//----------------------------------------------------------------------
function __autoload($class_name) {
       require_once ($class_name.".php");
}

function push_libs() {
       $paths = func_get_args();
       foreach ($paths as $path) {
$ipath = ini_get("include_path").":".dirname(__FILE__)."/".$path;
               ini_set("include_path", $ipath);
       }
}

// where are the class files?
push_libs("lib", "lib/application", "lib/db", "lib/ui", "lib/util", "lib/xmlrpc");

//----------------------------------------------------------------------

This code assumes that all the included library paths are relative to the file which contains this code.

Dante

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to