Esempio n. 1
0
 /**
  * Add the events defined in filename
  *
  * @param string $filename
  */
 public function addPreloadEvents($filename, $module = false)
 {
     if ($module) {
         $filepath = ICMS_ROOT_PATH . "/modules/{$module}/preload/{$filename}.php";
     } else {
         $filepath = ICMS_PRELOAD_PATH . "/{$filename}.php";
     }
     include_once $filepath;
     $classname = $this->getClassName($filename);
     if (in_array($classname, get_declared_classes())) {
         $preloadItem = new $classname();
         $class_methods = get_class_methods($classname);
         foreach ($class_methods as $method) {
             if (strpos($method, 'event') === 0) {
                 $preload_event = strtolower(str_replace('event', '', $method));
                 $callback = array($preloadItem, $method);
                 icms_Event::attach('icms', $preload_event, $callback);
                 /*
                 					$preload_event_weight_define_name = strtoupper($classname) . '_' . strtoupper($preload_event);
                 					if (defined($preload_event_weight_define_name)) {
                 						$preload_event_weight = constant($preload_event_weight_define_name);
                 						$this->_preloadEventsArray[$preload_event][$preload_event_weight] = $preload_event_array;
                 					} else {
                 						$this->_preloadEventsArray[$preload_event][] = $preload_event_array;
                 					}*/
             }
         }
     }
 }
Esempio n. 2
0
 /**
  * Called after the kernel initializes a service
  * @return	void
  */
 public static function loadService($params, $event)
 {
     switch ($params['name']) {
         case "config":
             global $xoopsOption, $icmsConfig;
             if (!isset($xoopsOption['nodebug']) || !$xoopsOption['nodebug']) {
                 if ($icmsConfig['debug_mode'] == 1 || $icmsConfig['debug_mode'] == 2) {
                     error_reporting(E_ALL);
                     icms::$logger->enableRendering();
                     icms::$logger->usePopup = $icmsConfig['debug_mode'] == 2;
                     if (icms::$db) {
                         icms_Event::attach('icms_db_IConnection', 'prepare', array(__CLASS__, 'prepareQuery'));
                         icms_Event::attach('icms_db_IConnection', 'execute', array(__CLASS__, 'executeQuery'));
                     }
                 } else {
                     // ICMS_ERROR_LOG_SEVERITY ADDED BY FREEFORM SOLUTIONS
                     if (defined("ICMS_ERROR_LOG_SEVERITY")) {
                         ini_set('display_errors', 0);
                     } else {
                         error_reporting(0);
                     }
                     icms::$logger->activated = false;
                 }
             }
             break;
     }
 }
Esempio n. 3
0
 /**
  * Initialize the icms::$security service
  */
 public static function service()
 {
     $instance = new icms_core_Security();
     $instance->checkSuperglobals();
     if ($_SERVER['REQUEST_METHOD'] != 'POST' || !$instance->checkReferer(XOOPS_DB_CHKREF)) {
         define('XOOPS_DB_PROXY', 1);
     }
     icms_Event::attach('icms', 'loadService-config', array($instance, 'checkBadips'));
     return $instance;
 }
Esempio n. 4
0
	/**
	 * Called after the kernel initializes a service
	 * @return	void
	 */
	static public function loadService($params, $event) {
		switch ($params['name']) {
		case "config":
			global $xoopsOption, $icmsConfig;
			if (!isset($xoopsOption['nodebug']) || !$xoopsOption['nodebug']) {
				if ($icmsConfig['debug_mode'] == 1 || $icmsConfig['debug_mode'] == 2) {
					error_reporting(E_ALL);
					icms::$logger->enableRendering();
					icms::$logger->usePopup = ( $icmsConfig['debug_mode'] == 2 );
					if (icms::$db) {
						icms_Event::attach('icms_db_IConnection', 'prepare', array(__CLASS__, 'prepareQuery'));
						icms_Event::attach('icms_db_IConnection', 'execute', array(__CLASS__, 'executeQuery'));
					}
				} else {
					error_reporting(0);
					icms::$logger->activated = false;
				}
			}
			break;
		}
	}
Esempio n. 5
0
	/**
	 * Attaches the multilanguage handler to the event handler
	 * 
	 */
	static public function setup() {
		icms_Event::attach('icms', 'loadService-session', array(__CLASS__, 'initMultilang'));
	}
Esempio n. 6
0
 public static function setup()
 {
     icms_Event::attach('icms', 'loadService', array(__CLASS__, 'loadService'));
     icms_Event::attach('icms', 'finishcoreboot', array(__CLASS__, 'finishCoreBoot'));
     icms_Event::attach('icms', '*', array(__CLASS__, 'backwardCompatibility'));
 }
Esempio n. 7
0
	static public function setup() {
		icms_Event::attach('icms_core_Session', 'sessionStart', array(__CLASS__, 'onSessionStart'));
		icms_Event::attach('icms_core_Session', 'sessionClose', array(__CLASS__, 'onSessionClose'));
	}