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! * * @return void */ public function check() { // Overload this method } /** * Attempts to load a .ini param file of this rule. * * @return Joomla\Registry\Registry */ 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 = new Registry('jedchecker.rule.' . $file_name); //$params = $registry->getInstance('jedchecker.rule.' . $file_name); //$params = Joomla\Registry\Registry::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 $data = file_get_contents($params_file); if ($data) { $obj = (object) parse_ini_string($data); if (is_object($obj)) { $params->loadObject($obj); } } } return $params; } }