report)) { // Create a new report require_once (JPATH_COMPONENT_ADMINISTRATOR.'/models/report.php'); $this->report = new JEDcheckerReport($properties); } // Try to load the params if(empty($this->params)) { $this->params = $this->loadParams(); } } /** * Performs the rule check. This method should be overloaded! * */ public function check() { } /** * Attempts to load a .ini param file of this rule. * * @return JRegistry */ protected function loadParams() { // Try to determine the name and location of the params file $file_name = str_replace('jedcheckerrules', '', strtolower(get_class($this))); $params_file = JPATH_COMPONENT_ADMINISTRATOR.'/libraries/rules/'.$file_name.'.ini'; $params = JRegistry::getInstance('jedchecker.rule.'.$file_name); // Load the params from the ini file if (file_exists($params_file)) { // Due to a bug in Joomla 2.5.6, this method cannot be used //$params->loadFile($params_file, 'INI'); // Get the contents of the file jimport('joomla.filesystem.file'); $data = JFile::read($params_file); if($data) { $obj = (object) parse_ini_string($data); if(is_object($obj)) { $params->loadObject($obj); } } } return $params; } }