<NME> loader.php
<BEF> <?php
define('APP_TIME_START', microtime(true));
define('IPHP_PATH', dirname(__FILE__));
include_once(dirname(__FILE__) . '/functions.php');

mb_internal_encoding("UTF-8");

$AUTOLOAD_PATH =  array(
	APP_PATH . '/classes',
);

function __autoload($class_name){
	global $AUTOLOAD_PATH;
	foreach($AUTOLOAD_PATH as $dir){
		$file = $dir . '/' . $class_name . '.php';
		if(file_exists($file)){
			require_once($file);
		}
	}
}

function include_paths(){
});

// init application
App::init();

		$ps = explode('/', $base);
		$controller = ucfirst($ps[count($ps) - 1]);
		$cls = "{$controller}Controller";
		$ins = new $cls();
		
		$found = false;

<MSG> report class not found instead of fatal error

<DFF> @@ -9,14 +9,18 @@ $AUTOLOAD_PATH =  array(
 	APP_PATH . '/classes',
 );
 
-function __autoload($class_name){
+function __autoload($cls){
 	global $AUTOLOAD_PATH;
 	foreach($AUTOLOAD_PATH as $dir){
-		$file = $dir . '/' . $class_name . '.php';
+		$file = $dir . '/' . $cls . '.php';
 		if(file_exists($file)){
 			require_once($file);
+			break;
 		}
 	}
+	if(!class_exists($cls)){
+		throw new Exception("Class $cls not found!");
+	}
 }
 
 function include_paths(){
@@ -63,6 +67,9 @@ function load_controller($base, $action){
 		$ps = explode('/', $base);
 		$controller = ucfirst($ps[count($ps) - 1]);
 		$cls = "{$controller}Controller";
+		if(!class_exists($cls)){
+			throw new Exception("Controller $cls not found!");
+		}
 		$ins = new $cls();
 		
 		$found = false;

report class not found instead of fatal error