add in support for building PHPT_Core from git repo and add build-specific files...
[phpt.git] / src / PHPT / Framework.php
blobe32b5e76f1161c75053c55cae85b52fbc227e2c5
1 <?php
3 class PHPT_Framework
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'));