/** * Return reference to global config object * * @return object JParams object */ public function &getInstance() { static $instance = null; if (!$instance) { jimport('joomla.filesystem.file'); // First we need to load the default INI file so that new configuration, // will not cause any errors. $ini = JPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_community' . DS . 'default.ini'; $data = JFile::read($ini); $instance = new CConfig($data); JTable::addIncludePath(COMMUNITY_COM_PATH . DS . 'tables'); $config =& JTable::getInstance('configuration', 'CommunityTable'); $config->load('config'); $instance->bind($config->params); // call trigger to allow configuration override $appsLib = CAppPlugins::getInstance(); $appsLib->loadApplications(); $args = array(); $args[] = $instance; $appsLib->triggerEvent('onAfterConfigCreate', $args); } return $instance; }