jenkins-bot has submitted this change and it was merged.

Change subject: Do not override existing value when initializing 
$wgEventLoggingSchemas
......................................................................


Do not override existing value when initializing $wgEventLoggingSchemas

This makes it possible for extensions to set $wgEventLoggingSchemas
before it is being initialized by the EventLogging extension.

This might or might not be a good idea. In PHP,

  $wgEventLoggingSchemas['foo'] = 123;

is entirely valid even if $wgEventLoggingSchemas has not been defined
yet, so this patch would make it possible to set that variable
in a convenient way, just like other globals are set, without
resorting to hooks or callbacks. On the other hand,

  $wgEventLoggingSchemas += array(
      'foo' => 123,
      'bar' => 456,
  );

would still break, so this might give developers a false sense of
security.

Bug: 65680
Change-Id: I3b4680f162ad3b1796672dae5a50a230beae0fdc
---
M EventLogging.php
1 file changed, 1 insertion(+), 3 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/EventLogging.php b/EventLogging.php
index d76cd12..90cb5c2 100644
--- a/EventLogging.php
+++ b/EventLogging.php
@@ -90,11 +90,9 @@
 
 /**
  * @var array: A map of event schema names to revision IDs.
- *
  * @example array: array( 'MultimediaViewerNetworkPerformance' => 7917896 );
  */
-$wgEventLoggingSchemas = array();
-
+$wgEventLoggingSchemas = isset( $wgEventLoggingSchemas ) ? 
$wgEventLoggingSchemas : array();
 
 // Helpers
 

-- 
To view, visit https://gerrit.wikimedia.org/r/135087
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3b4680f162ad3b1796672dae5a50a230beae0fdc
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/EventLogging
Gerrit-Branch: master
Gerrit-Owner: GergÅ‘ Tisza <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to