Changeset 1644
- Timestamp:
- 02/27/2007 04:03:43 PM (2 years ago)
- Files:
-
- branches/2.0/scripts/ModuleManager.class.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/2.0/scripts/ModuleManager.class.php
r1643 r1644 42 42 return self::$instance; 43 43 } 44 private function __construct() { 45 // Standard construction not possible (private function) 46 } 44 47 45 48 /** … … 68 71 require_once($ifacedir . "/" . $iface_file); 69 72 $iface = substr($iface_file, 0, -14); 70 $this->interfaces[$iface]['type'] = constant(" PMS_IFACE_$iface");73 $this->interfaces[$iface]['type'] = constant("JLOG_IFACE_$iface"); 71 74 $this->interfaces[$iface]['modules'] = array(); 72 75 $this->interfaces[$iface]['instances'] = 0; … … 112 115 // for this Interface there is already a module running 113 116 // and a second module is not allowed to run 114 throw new Exception(__CLASS__ . ": Module restriction in effect"); 117 throw new Exception(__CLASS__ . ": Module restriction in effect, " . 118 "module $module can not be loaded on interface $iface."); 115 119 } 116 120 else { 117 121 require_once($this->moduledir . "/" . $module); 118 $module_name = " PMS_MOD_" . substr($module, 0, -11);119 $interface_name = " PMS_IFACE_$iface";122 $module_name = "JLOG_MOD_" . substr($module, 0, -11); 123 $interface_name = "JLOG_IFACE_$iface"; 120 124 if(!class_exists($module_name)) { 121 throw new Exception(__CLASS__ . ": Broken module");125 throw new Exception(__CLASS__ . ": Module $module seems to be broken."); 122 126 } 123 127 $instance = new $module_name($params); … … 128 132 else { 129 133 // invalid module 130 throw new Exception(__CLASS__ . ": Module invalid");134 throw new Exception(__CLASS__ . ": Module $module is not valid."); 131 135 } 132 136 } … … 134 138 else { 135 139 require_once($this->moduledir . "/" . $module); 136 $module_name = " PMS_MOD_" . substr($module, 0, -11);140 $module_name = "JLOG_MOD_" . substr($module, 0, -11); 137 141 if(!class_exists($module_name)) { 138 throw new Exception(__CLASS__ . ": Broken module");142 throw new Exception(__CLASS__ . ": Module $module seems to be broken."); 139 143 } 140 144 $instance = new $module_name($params); … … 152 156 * 153 157 * The XML config file has to look like this: 154 * <?xml version='1.0' standalone='yes'?>155 158 * <modules> 156 159 * <module name="modulename.php" /> … … 158 161 * 159 162 * You can pass paramenters to the modules as well: 160 * <?xml version='1.0' standalone='yes'?>161 163 * <modules> 162 164 * <module name="modulename.php">
