/** * Constructs a new formatter suitable for given entry. * @param LogEntry $entry * @return LogFormatter */ public static function newFromEntry(LogEntry $entry) { global $wgLogActionsHandlers; $fulltype = $entry->getFullType(); $wildcard = $entry->getType() . '/*'; $handler = ''; if (isset($wgLogActionsHandlers[$fulltype])) { $handler = $wgLogActionsHandlers[$fulltype]; } elseif (isset($wgLogActionsHandlers[$wildcard])) { $handler = $wgLogActionsHandlers[$wildcard]; } if ($handler !== '' && is_string($handler) && class_exists($handler)) { return new $handler($entry); } return new LegacyLogFormatter($entry); }