PHP function __autoload($class_name) how to Load two class path directories
<p>I am using following function to autoload classes, it works fine if i am using only one directory called 'classes' however when i try to use Smarty lib also it fails and give me the error</p>

<pre><code>Fatal error: Class 'Database' not found in /home/...
</code></pre>

<p>for ex:</p>

<pre><code>require_once(DOC_ROOT."/libs/Smarty.class.php");
function __autoload($class_name) {   
    require_once( CLASS_LIB."/".$class_name . '.class.php');
}
$db = new Database();
$session=new Session();
$smarty = new Smarty();
</code></pre>

<p>but if i do this it give me the error unable to load the smarty class..</p>

<pre><code>function __autoload($class_name) {   
    require_once( CLASS_LIB."/".$class_name . '.class.php');
    require_once(DOC_ROOT."/libs/Smarty.class.php");
}

$db = new Database();
$session=new Session();
$smarty = new Smarty();

Warning: require_once(/home/.../classes/Smarty_Internal_TemplateCompilerBase.class.php) [function.require-once]: failed to open stream: No such file or directory in /home/.../includes/init.php 
</code></pre>

<p>Any idea what i am i doing wrong here ? i need to be able to load classes directory automatically but needs to make sure i dont loose smarty path too..</p>
