/** * @throws Exception */ public static function initialize() { if (!self::$enabled) { self::$format = JFactory::getApplication()->input->getWord('format', 'html'); self::$debug = JDEBUG || KunenaFactory::getConfig()->debug; self::$admin = JFactory::getApplication()->isAdmin(); register_shutdown_function(array('KunenaError', 'shutdownHandler'), self::$debug || self::$admin || KUNENA_PROFILER); if (!self::$debug) { return; } @ini_set('display_errors', 1); self::$handler = true; @error_reporting(E_ALL | E_STRICT); JFactory::getDbo()->setDebug(true); set_error_handler(array('KunenaError', 'errorHandler')); self::$enabled++; } }