protected function CreateMonitors() { $result = array(); foreach ($this->config->GetMonitorConfig() as $cfg) { $cls = $cfg['class']; $host_parser = isset($cfg['host_parser']) ? create_function('$file,$line', $cfg['host_parser']) : null; $file_parser = isset($cfg['file_parser']) ? create_function('$file,$lines', $cfg['file_parser']) : null; $file_regexp = isset($cfg['file_regexp']) ? $cfg['file_regexp'] : null; foreach (glob($cfg['path']) as $file) { $result[] = new $cls($file, $host_parser, $file_parser, $file_regexp); } } return $result; }