コード例 #1
0
ファイル: Doctrine.php プロジェクト: snouhaud/camptocamp.org
 /**
  * simple autoload function
  * returns true if the class was loaded, otherwise false
  *
  * @param string $classname
  * @return boolean
  */
 public static function autoload($classname)
 {
     if (class_exists($classname, false)) {
         return false;
     }
     if (!self::$path) {
         self::$path = dirname(__FILE__);
     }
     $class = self::$path . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $classname) . '.php';
     if (!file_exists($class)) {
         return false;
     }
     require_once $class;
     return true;
 }