Ejemplo n.º 1
0
 public static function autoload($class)
 {
     if (class_exists($class)) {
         return false;
     }
     foreach (self::$paths as $path) {
         $class_path = $path . '/' . str_replace('\\', '/', $class) . '.php';
         if (file_exists($class_path)) {
             require $class_path;
             return true;
         }
         $classes_path = preg_replace('/\\/[A-Za-z0-9_]+\\.php/', '.php', $class_path);
         if (file_exists($classes_path)) {
             require $classes_path;
             return true;
         }
         $class_path = $path . '/' . str_replace('_', '/', $class) . '.php';
         if (file_exists($class_path)) {
             require $class_path;
             return true;
         }
         $class_path = $path . '/' . Inflector::lower($class) . '.php';
         if (file_exists($class_path)) {
             require $class_path;
             return true;
         }
     }
     return false;
 }
Ejemplo n.º 2
0
 public function getClassId()
 {
     return Inflector::dotted(get_class($this));
 }