Changeset 1644

Show
Ignore:
Timestamp:
02/27/2007 04:03:43 PM (2 years ago)
Author:
driehle
Message:

updated ModuleManager?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2.0/scripts/ModuleManager.class.php

    r1643 r1644  
    4242    return self::$instance; 
    4343  } 
     44  private function __construct() { 
     45    // Standard construction not possible (private function) 
     46  } 
    4447 
    4548  /** 
     
    6871        require_once($ifacedir . "/" . $iface_file); 
    6972        $iface = substr($iface_file, 0, -14); 
    70         $this->interfaces[$iface]['type'] = constant("PMS_IFACE_$iface"); 
     73        $this->interfaces[$iface]['type'] = constant("JLOG_IFACE_$iface"); 
    7174        $this->interfaces[$iface]['modules'] = array(); 
    7275        $this->interfaces[$iface]['instances'] = 0; 
     
    112115        // for this Interface there is already a module running 
    113116        // 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."); 
    115119      } 
    116120      else { 
    117121        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"; 
    120124        if(!class_exists($module_name)) { 
    121           throw new Exception(__CLASS__ . ": Broken module"); 
     125          throw new Exception(__CLASS__ . ": Module $module seems to be broken."); 
    122126        } 
    123127        $instance = new $module_name($params); 
     
    128132        else { 
    129133          // invalid module 
    130           throw new Exception(__CLASS__ . ": Module invalid"); 
     134          throw new Exception(__CLASS__ . ": Module $module is not valid."); 
    131135        } 
    132136      } 
     
    134138    else { 
    135139      require_once($this->moduledir . "/" . $module); 
    136       $module_name = "PMS_MOD_" . substr($module, 0, -11); 
     140      $module_name = "JLOG_MOD_" . substr($module, 0, -11); 
    137141      if(!class_exists($module_name)) { 
    138         throw new Exception(__CLASS__ . ": Broken module"); 
     142        throw new Exception(__CLASS__ . ": Module $module seems to be broken."); 
    139143      } 
    140144      $instance = new $module_name($params); 
     
    152156   * 
    153157   * The XML config file has to look like this: 
    154    * <?xml version='1.0' standalone='yes'?> 
    155158   * <modules> 
    156159   *   <module name="modulename.php" /> 
     
    158161   * 
    159162   * You can pass paramenters to the modules as well: 
    160    * <?xml version='1.0' standalone='yes'?> 
    161163   * <modules> 
    162164   *   <module name="modulename.php">