Show
Ignore:
Timestamp:
01/05/08 07:53:24 (12 months ago)
Author:
jwage
Message:

A few more fixes for autoloading and locating paths to Doctrine components.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/Doctrine.php

    r3455 r3456  
    10761076        } 
    10771077 
    1078         $findPattern = self::$_path . DIRECTORY_SEPARATOR . '*' . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, str_replace('Doctrine_', '', $className)) . '.php'; 
    1079  
    1080         $matches = glob($findPattern); 
    1081  
    1082         if ( ! isset($matches[0])) { 
    1083             return false; 
    1084         } 
    1085  
    1086         $class = $matches[0]; 
     1078        $class = self::locate($className . '.php'); 
    10871079         
    1088         if (file_exists($class)) { 
     1080        if ($class && file_exists($class)) { 
    10891081            require $class; 
    10901082 
     
    11011093 
    11021094        return false; 
     1095    } 
     1096     
     1097    public static function locate($name) 
     1098    { 
     1099        $findPattern = self::$_path . DIRECTORY_SEPARATOR . '*' . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, str_replace('Doctrine_', '', $name)); 
     1100 
     1101        $matches = glob($findPattern); 
     1102 
     1103        if ( isset($matches[0])) { 
     1104            return $matches[0]; 
     1105        } else { 
     1106            return false; 
     1107        } 
    11031108    } 
    11041109