Esempio n. 1
0
 /**
  * Loads the library's dependencies and configuration.
  *
  * @return void
  */
 public static function initialize()
 {
     // get all installed extensions
     if (empty(self::$extensions)) {
         self::$CI =& get_instance();
         self::$extensions = self::$CI->extension->getInstalledExtensions();
     }
     // Merge events from indivdual modules.
     foreach (Modules::list_modules() as $module) {
         // Skip if module is not installed
         if (!isset(self::$extensions[$module])) {
             continue;
         }
         $path = ROOTPATH . EXTPATH . "{$module}/config/";
         if (is_file($path . 'events.php')) {
             $module_events = Modules::load_file('events', $path, 'config');
             if (is_array($module_events)) {
                 self::$events = array_merge_recursive(self::$events, $module_events);
             }
         }
     }
     if (self::$events === FALSE) {
         self::$events = array();
     }
 }
Esempio n. 2
0
 public static function init()
 {
     if (!function_exists('read_config')) {
         $ci =& get_instance();
         $ci->load->helper('config_file');
     }
     self::$events = read_config('events');
     if (self::$events == false) {
         self::$events = array();
     }
 }
Esempio n. 3
0
 public static function loadAll()
 {
     if (!isset(self::$events)) {
         self::$events = array();
         foreach (glob(EVENTS_DIR . '/*.class.php') as $file) {
             $class_name = preg_replace('/\\.class\\.php$/', '', basename($file));
             self::$events[] = new $class_name();
         }
     }
     return self::$events;
 }
Esempio n. 4
0
 /**
  * Loads the config/events.php file into memory so we can access it
  * later without the disk load.
  *
  * @access public
  *
  * @return void
  */
 public static function init()
 {
     if (!function_exists('read_config')) {
         $ci =& get_instance();
         $ci->load->helper('config_file');
     }
     self::$events = read_config('events');
     // merge other modules events
     foreach (module_list(TRUE) as $module) {
         if ($module_events = read_config('events', TRUE, $module)) {
             self::$events = array_merge_recursive(self::$events, $module_events);
         }
     }
     if (self::$events == false) {
         self::$events = array();
     }
 }
Esempio n. 5
0
 /**
  * Loads the library's dependencies and configuration.
  *
  * @return void
  */
 public static function init()
 {
     if (!function_exists('read_config')) {
         self::$ci =& get_instance();
         self::$ci->load->helper('config_file');
     }
     self::$events = read_config('events', true, null, false);
     // Merge events from indivdual modules.
     foreach (Modules::list_modules(true) as $module) {
         $module_events = read_config('events', true, $module, true);
         if (is_array($module_events)) {
             self::$events = array_merge_recursive(self::$events, $module_events);
         }
     }
     if (self::$events == false) {
         self::$events = array();
     }
 }
Esempio n. 6
0
 private static function setEvents()
 {
     Events::$events = WynfordChace::getSiteData("events");
     return self::$events;
 }