diff options
author | xue <> | 2005-11-22 12:56:27 +0000 |
---|---|---|
committer | xue <> | 2005-11-22 12:56:27 +0000 |
commit | 233bda8e5ee36dd2d97af72caf2369de2aa271fe (patch) | |
tree | 89735bd358b3cb605f9311509ebf17050f777b67 | |
parent | 75d146ca341c0e0b92e8dcd180fbac352155644a (diff) |
-rw-r--r-- | framework/core.php | 25 |
1 files 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);
}
/**
|