HomePhabricator

Refactor EventLogging Event Platform PHP integration

Description

Refactor EventLogging Event Platform PHP integration

Fixes:

  • 'event' data via EventLogging::logEvent is now properly set in the 'event' field, not top level.
  • Removed useless PHP schema validation; a schema with clientValidated set would not validate anywhere anyway.
  • Deprecated EventLogging::logEvent $options parameter. According to codesearch.wmcloud.org, this is not used, and removing it is simpler than supporting it in EventServiceClient too.
  • EventLogging::encapsulate now handles encapsulating legacy events for use either by old eventlogging backend or by new Event Platform schemas.
  • EventServiceClient::prepareEvent sets fields that should be set on all new Event Platform based events, including those 'legacy' EventLogging ones that have been migrated off of metawiki.

This makes the functions in EventLogging class closer to
those in the JS code. It also reduces the number of
places the $event can be modified. EventLogging now only
modifies (and encapsulates) the event in EventLogging::encapsulate,
which is used to prepare a legacy event for EITHER POSTing to
EventGate (if migrated) or sendBeacon-ing to the deprecated
eventlogging backend.

The event is also modified by EventServiceClient::prepareEvent.

Bug: T253121
Change-Id: I0cfd07295d4b51ca4805c79a28a9a4bd64ff7cc9

Details