From 5675c11ba1367ed3a9794a7290aa1d91c1aeb9b7 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 16 Aug 2006 03:24:52 +0000 Subject: [PATCH] Use trigger_error() instead of exceptions because the test toolkit doesn't support them yet --- Loader.php | 11 ++++++----- Register.php | 6 +++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Loader.php b/Loader.php index 5cddfd6..2bdf9f2 100644 --- a/Loader.php +++ b/Loader.php @@ -114,7 +114,7 @@ class BSLoader { if (get_class($register) != 'BSRegister') { - throw new Exception('BSLoader::SetRegister() was not passed a BSRegister object'); + trigger_error('BSLoader::SetRegister() was not passed a BSRegister object'); } self::SharedInstance()->main = $register; @@ -135,7 +135,7 @@ class BSLoader { if (!isset(self::SharedInstance()->main)) { - throw new Exception('Cannot fetch the main register because it has not been set with BSLoader::SetRegister()'); + trigger_error('Cannot fetch the main register because it has not been set with BSLoader::SetRegister()'); } return self::SharedInstance()->main; } @@ -143,7 +143,7 @@ class BSLoader { if (!isset(self::SharedInstance()->registers["$index"])) { - throw new Exception('Invalid register index passed to BSLoader::GetRegister()'); + trigger_error('Invalid register index passed to BSLoader::GetRegister()'); } return self::SharedInstance()->registers["$index"]; } @@ -161,7 +161,8 @@ class BSLoader { if (!file_exists("ISSO/$name.php")) { - throw new Exception('Specified module does not exist'); + trigger_error('Specified module does not exist'); + return; } require_once("ISSO/$name.php"); @@ -170,7 +171,7 @@ class BSLoader if (!class_exists($class)) { - throw new Exception('Specifed module does not conform to the ISSO specification, or the class is missing'); + trigger_error('Specifed module does not conform to the ISSO specification, or the class is missing'); } return new $class; diff --git a/Register.php b/Register.php index 653eb98..961e286 100644 --- a/Register.php +++ b/Register.php @@ -202,7 +202,7 @@ class BSRegister { if (isset($this->registry["$key"])) { - throw new Exception('Cannot overwrite a key in the registry'); + trigger_error('Cannot overwrite a key in the registry'); } $this->registry["$key"] = $value; @@ -219,7 +219,7 @@ class BSRegister { if (!isset($this->registry["$key"])) { - throw new Exception('You cannot unregister a key that does not exist'); + trigger_error('You cannot unregister a key that does not exist'); } unset($this->registry["$key"]); @@ -237,7 +237,7 @@ class BSRegister { if (!isset($this->registry["$key"])) { - throw new Exception('Cannot access the registry with a non-existent key'); + trigger_error('Cannot access the registry with a non-existent key'); } return $this->registry["$key"]; -- 2.22.5