diff options
author | xue <> | 2007-07-20 12:33:27 +0000 |
---|---|---|
committer | xue <> | 2007-07-20 12:33:27 +0000 |
commit | 786dde43ea21c1990071683a8cf5efd3bd1b791d (patch) | |
tree | 34d7e664f974976e800ac8cc790a8046854e8238 /framework/PradoBase.php | |
parent | 46f58667d00624c115ad99a590aebef99ab133a5 (diff) |
Replaced GeSHi with Text_Highlighter
Diffstat (limited to 'framework/PradoBase.php')
-rw-r--r-- | framework/PradoBase.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/framework/PradoBase.php b/framework/PradoBase.php index 9f6d91a0..f2632f9b 100644 --- a/framework/PradoBase.php +++ b/framework/PradoBase.php @@ -246,9 +246,10 @@ class PradoBase * If the namespace corresponds to a directory, the directory will be appended
* to the include path. If the namespace corresponds to a file, it will be included (include_once).
* @param string namespace to be used
+ * @param boolean whether to check the existence of the class after the class file is included
* @throws TInvalidDataValueException if the namespace is invalid
*/
- public static function using($namespace)
+ public static function using($namespace,$checkClassExistence=true)
{
if(isset(self::$_usings[$namespace]) || class_exists($namespace,false))
return;
@@ -260,8 +261,8 @@ class PradoBase }
catch(Exception $e)
{
- if(!class_exists($namespace,false))
- throw new TInvalidOperationException('prado_component_unknown',$namespace);
+ if($checkClassExistence && !class_exists($namespace,false))
+ throw new TInvalidOperationException('prado_component_unknown',$namespace,$e->getMessage());
else
throw $e;
}
@@ -277,7 +278,7 @@ class PradoBase else // a file
{
self::$_usings[$namespace]=$path;
- if(!class_exists($className,false))
+ if(!$checkClassExistence || !class_exists($className,false))
{
try
{
@@ -285,8 +286,8 @@ class PradoBase }
catch(Exception $e)
{
- if(!class_exists($className,false))
- throw new TInvalidOperationException('prado_component_unknown',$className);
+ if($checkClassExistence && !class_exists($className,false))
+ throw new TInvalidOperationException('prado_component_unknown',$className,$e->getMessage());
else
throw $e;
}
|