Example #1
0
 public static function load($pathname)
 {
     if (!is_array(self::$_loaded)) {
         self::$_loaded = array();
     }
     if (!is_file($pathname)) {
         throw new EventException(__('Could not find Event <code>%s</code>. If the Event was provided by an Extension, ensure that it is installed, and enabled.', array(basename($pathname))));
     }
     if (!isset(self::$_loaded[$pathname])) {
         self::$_loaded[$pathname] = (require $pathname);
     }
     $obj = new self::$_loaded[$pathname]();
     $obj->parameters()->pathname = $pathname;
     return $obj;
 }