From 97b412b7e68ca314fa471183f43d72db41e90f19 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 6 Dec 2006 04:48:30 +0000 Subject: [PATCH] Added RequiredModules() to check and see if a set of framework modules is loaded --- Register.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Register.php b/Register.php index 2c6382b..6e3ed0c 100644 --- a/Register.php +++ b/Register.php @@ -529,6 +529,26 @@ class BSRegister self::Message('Error Reporting', $table, 1); } + + // ################################################################### + /** + * This function is used by other framework modules to check and see if + * the passed array of module names have been loaded. If not, this will + * throw an error informing the developer that the given modules are + * required in order for the framework to work. + * + * @param array Array of module names to check for loadedness + */ + public function RequiredModules($modules) + { + foreach ($modules AS $module) + { + if (self::GetType($module) == null) + { + trigger_error('The ' . $module . ' is required in order to use this framework module'); + } + } + } } /*=====================================================================*\ -- 2.22.5