5 const VERSION
= "@@VERSION@@";
7 static private $namespace_length = null;
8 static private $base_path = null;
10 public function __construct()
15 // @todo add some sort of error handling
16 public static function autoload($class)
18 if (is_null(self
::$namespace_length)) {
19 self
::$namespace_length = strlen(substr(__CLASS__
, 0, -9));
20 self
::$base_path = dirname(__FILE__
);
23 $class_name_without_namespace = substr($class, self
::$namespace_length);
24 @include self
::$base_path . '/' . str_replace('_', '/', $class_name_without_namespace) . '.php';
28 spl_autoload_register(array('PHPT_Framework', 'autoload'));