Improved autoload.
This commit is contained in:
parent
599446ad07
commit
05ccf7098d
1 changed files with 3 additions and 3 deletions
|
@ -1010,7 +1010,7 @@ final class Doctrine
|
||||||
*/
|
*/
|
||||||
public static function autoload($className)
|
public static function autoload($className)
|
||||||
{
|
{
|
||||||
if (class_exists($className, false)) {
|
if (class_exists($className, false) || interface_exists($className, false)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1021,7 +1021,7 @@ final class Doctrine
|
||||||
$class = self::$_path . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
|
$class = self::$_path . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
|
||||||
|
|
||||||
if (file_exists($class)) {
|
if (file_exists($class)) {
|
||||||
require_once($class);
|
require $class;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1029,7 +1029,7 @@ final class Doctrine
|
||||||
$loadedModels = self::$_loadedModelFiles;
|
$loadedModels = self::$_loadedModelFiles;
|
||||||
|
|
||||||
if (isset($loadedModels[$className]) && file_exists($loadedModels[$className])) {
|
if (isset($loadedModels[$className]) && file_exists($loadedModels[$className])) {
|
||||||
require_once($loadedModels[$className]);
|
require_once $loadedModels[$className];
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue