Commit graph

17 commits

Author SHA1 Message Date
Derick Alangi 3971e32f1b Code improvements for includes/ **only** directory
This code improvements seeks to improve on code readability, consistency,
maintainability and efficiency.

Change-Id: I4f07886044e9a75824f9e7ddad039f3112b1c4a1
2019-03-05 18:58:52 +01:00
Kunal Mehta b574e252f8 Clean up EventLogging integration
* Move revision ids out of configuration and into MWEchoEventLogging
class. Because the EchoInteraction schema is used both server and
client, we have to duplicate the revision id.
* Use EventLoggingSchemas attribute to register client-side schema in
extension.json instead of a hook.
* Check if EventLogging is enabled in MWEchoEventLogging instead of
$wgExtensionFunctions.
* Pass only whether the EchoInteraction schema is enabled to the
client-side instead of all of $wgEchoEventLoggingSchemas.

Change-Id: I968294f96cedac19dc9d8f53df14fecfb666ceee
2018-08-09 14:19:45 +00:00
James D. Forrester 8c810dff48 build: Update mediawiki/mediawiki-codesniffer to 0.7.1
Also added "composer fix" command.

Change-Id: I25cb61b3b92798f1259d1575a336e2b056d5764f
2016-12-05 15:54:30 -08:00
Roan Kattouw 49974544ba Split up $wgEchoConfig
$wgEchoConfig is a deeply nested structure that ExtensionRegistry can't handle well.
It also combined different things, and the version number was used for two
separate purposes.

Split this out into $wgEchoCacheVersion, $wgEchoEventLoggingVersion
and $wgEchoEventLoggingSchemas.

Change-Id: I2f9d5d111f7925fb057d423a3e7064bff5040205
2016-12-05 15:44:12 -08:00
Matthew Flaschen f36d20ba4d Fix special page visit logging
'version' was missing, making the event invalid, causing it to
not reach the database.

Factor out this field to logEvent

Bug: T121939
Change-Id: I9e4bb5574d69495cb5f53830047c68104c6ad10f
2016-08-22 16:35:50 -04:00
Matthew Flaschen 2186e9a6b6 Make server-side logging always check whether schema is enabled
We have a convention to put a logger helper function in
MWEchoEventLogging, so also enforce that:
* Rename to actuallyLogTheEvent to logEvent and centralize the
  'enabled' check there.
* Make that protected, so new schemas also use a helper function
  for consistency.

Bug: T143092
Change-Id: I8085fc5898f3420172355c5a2df04aac6add9acd
2016-08-18 21:09:48 -04:00
Leszek Manicki 975be8fb45 Flip the parameter name and its type in phpdoc of MWEchoEventLogging
Also adds a type hint to MWEchoEventLogging::actuallyLogTheEvent
parameter.

Change-Id: I7538083ec33b5c4538386da22550273d8e882a72
2016-08-16 15:01:57 +02:00
Leszek Manicki ab2bf21ce5 Check if logging is enabled before logging EchoInteraction
Adds a check before logging a visit to Special:Notifications
added in Icfe63fb8daa8e8fba029e22b4de3e4f65517c448

Bug: T143092
Change-Id: I9e58ba35eef6a25a78e96a76facc04819cef37da
2016-08-16 14:39:02 +02:00
Kunal Mehta 7f6f6536ed EventLogging: Make sure eventId is an integer
Bug: T116205
Change-Id: Ifb9119cbd24b58f24a0eaa0a17a1345220374a4a
2015-10-21 11:08:50 -07:00
Siebrand Mazeland 33126b69aa Update formatting
In preparation of Code Sniffer based updates.

Change-Id: Id5d43332b44a37665d57dc24ef8c432bc65b2f6a
2015-10-03 23:28:54 -04:00
Matthias Mullie 411f0151dc efLogServerSideEvent is deprecated
Change-Id: I3fb95ff95dd9371d55285e64a37b32cec35b029a
2014-08-21 15:19:27 +02:00
Kunal Mehta a026ba880f Fatal error: Cannot use object of type EchoEvent as array at EventLogging.php
Bug: 56521
Change-Id: I180728022886b6a2ba96b0da79299ec342547b3a
2013-11-04 20:36:34 +00:00
Kunal Mehta 18b09b5daa Update to latest revision of Echo schema
This patch updates Echo to revision 6081131 of Schema:Echo, adding a 'rev_id'
field and the code to populate it. The patch also increments the logging
version identifier to 1.5.

Bug: 46045
Change-Id: I4ac1a25c306b0e0983a3490a29fe3dc4aa4bfc6f
2013-10-25 05:40:05 +00:00
bsitu 0cb48219cc Remove Echo preference change eventlogging
Echo preference change is already captured in the general
preference change eventlogging, this is just a duplicate

Change-Id: I49cd2ad5776a670e2cd28414e156f5201087ded0
2013-07-03 11:55:44 -07:00
bsitu 09c531a11f (bug 47666) All system messages should have sender = -1
Change-Id: I0f7458b0e76c600c6bb383bd320b483adfd76d98
2013-06-12 19:26:57 -07:00
bsitu 5602daa277 Add EventLogging to capture Echo preference change
Change-Id: I14cee0bf2e04cc24196b9aa30baa3253c9989463
2013-05-21 17:33:43 -07:00
bsitu ce78c973f3 Add new EventLogging schema: EchoMail along with code refactor
Change-Id: I7f9ec99d27b69abb14aa89540e424f1e0bcd8160
2013-05-07 16:59:24 -07:00