From 786dde43ea21c1990071683a8cf5efd3bd1b791d Mon Sep 17 00:00:00 2001 From: xue <> Date: Fri, 20 Jul 2007 12:33:27 +0000 Subject: Replaced GeSHi with Text_Highlighter --- framework/PradoBase.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'framework/PradoBase.php') 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; } -- cgit v1.2.3