From 233bda8e5ee36dd2d97af72caf2369de2aa271fe Mon Sep 17 00:00:00 2001 From: xue <> Date: Tue, 22 Nov 2005 12:56:27 +0000 Subject: --- framework/core.php | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/framework/core.php b/framework/core.php index bd143117..9dd43e76 100644 --- a/framework/core.php +++ b/framework/core.php @@ -436,32 +436,23 @@ class PradoBase return new $type; if(($pos=strrpos($type,'.'))===false) { - // a class name is supplied - $className=$type; - if(!class_exists($className,false)) - { - include_once($className.self::CLASS_FILE_EXT); - } - if(class_exists($className,false)) - return new $className; - else - throw new TInvalidDataValueException('prado_component_unknown',$type); + include_once($type.self::CLASS_FILE_EXT); + if(class_exists($type,false)) + return new $type; } else { $className=substr($type,$pos+1); - if(($path=self::getPathOfNamespace($type))!==null) + if(class_exists($className,false)) + return new $className; + else if(($path=self::getPathOfNamespace($type))!==null) { - // the class type is given in a namespace form - if(!class_exists($className,false)) - { - require_once($path.self::CLASS_FILE_EXT); - } + include_once($path.self::CLASS_FILE_EXT); if(class_exists($className,false)) return new $className; } - throw new TInvalidDataValueException('prado_component_unknown',$type); } + throw new TInvalidDataValueException('prado_component_unknown',$type); } /** -- cgit v1.2.3