Commit graph

27 commits

Author SHA1 Message Date
Kunal Mehta
0ec0fa4028 Don't send RC_CATEGORIZE events to the IRC feed
Bug: T127360
Change-Id: I21e4c0edf25fc0b7f16ef3029de879d3b7a2923d
2016-02-18 12:19:08 -08:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
Ryan Schmidt
afcfb1d1fb Properly escape \n and \r in IRCColourfulRCFeedFormatter
Right now it is possible to emit a raw \n or \r to the UDP feed by
encoding it as an HTML entity, e.g. 
 This could be used for
arbitrary IRC command execution in bots which do not subsequently
perform their own escaping. This commit changes it so that entities are
decoded first before \n and \r are stripped.

Change-Id: I3f7005abded3fbafb586754d763a00a4018f0954
2016-01-20 11:10:14 -06:00
Matthew Flaschen
047fc253d0 RC: Handle getLine returning null, which breaks Redis engine (at least HHVM)
Bug: T109544
Change-Id: I02dcfc7a10a74571232a898f1ef348f8dbc48b45
2015-08-18 23:08:36 -04:00
Stephane Bisson
62961558a5 Encapsulate rc_params handling in RecentChange::parseParams
* Make MachineReadableRCFeedFormatter use it

* Some unit tests

* Also fixed some line-too-long warnings in RecentChange.php

Change-Id: I443d14f5d4cdac0945cb9c03608d55745bbb865b
2015-06-10 15:11:37 -04:00
Bryan Davis
dad7abd9ce Create a generic UDP transport class
Code moved from MWLoggerLegacyLogger::emit(), which was formerly
in wfErrorLog().

Bug: T74572
Bug: T78599
Change-Id: I9e0e63d41bed6ccb468f3a9f1d52f156acc355a8
2014-12-15 15:06:43 -07:00
Aaron Schulz
e369f66d00 Replace wfRunHooks calls with direct Hooks::run calls
* This avoids the overhead of an extra function call

Change-Id: I8ee996f237fd111873ab51965bded3d91e61e4dd
2014-12-10 12:26:59 -08:00
Bryan Davis
78695ada64 Use safe attribute accessor for RecentChange
The RecentChange does not guarantee that all attributes are populated.
Handily it provides a safe getter function in
RecentChange::getAttribute() that will return null with out triggering
an undefined index warning for missing attributes. Protects against log
spam like "Notice: Undefined index: rc_id".

Change-Id: Idee844f0d40a2a084e17f201b5e1501d59a0464d
2014-09-13 05:02:33 +00:00
withoutaname
557b2cf3ef Remove various functions and globals deprecated since 1.22 from RecentChange
Change-Id: I5200892e75ffa894133e2e386d53c09536547de9
2014-08-12 22:19:36 -07:00
umherirrender
dd8921c9d9 Cleanup some docs (includes/[m-r])
- Swap "$variable type" to "type $variable"
- Added missing types
- Fixed spacing inside docs
- Makes beginning of @param/@return/@var/@throws in capital
- Changed some types to match the more common spelling

Change-Id: I8ebfbcea0e2ae2670553822acedde49c1aa7e98d
2014-07-24 19:43:25 +02:00
Kunal Mehta
e8ab2deb0f RCFeed: Add log_id property (exposes rc_logid attribute)
Bug: 20394
Change-Id: I005be8e41a5cbea934d4dac27184f03e9af7c648
2014-06-11 22:27:13 +00:00
Timo Tijhof
c0b0a12eab RCFeed: Use named types instead of exposing internal MW constant
Like we do in ApiQueryRecentChanges as well, expose the named
rc.type property, not the internal integer constants.

Change-Id: I89a948eee999032bb2e42cc23345affa879afb42
2014-06-04 04:55:02 +00:00
Siebrand Mazeland
97da10e3b2 Pass phpcs-strict on includes/rcfeed/
Change-Id: I197b4963a29fc5c13d71cd820ab780dedbc30b99
2014-05-10 10:42:13 +02:00
Ori Livneh
5c74ac9feb Expose server name in rc feed
Reviewers of Id819246a9 (Tim, Timo, Chad) have commented that it
would be preferable to identify wikis by their canonical hostname
rather than the value of $wgDBname. Exposing it here so that
the rcstream server can filter subscriptions by it.

Change-Id: I503a0134a8613daddaae9d8df29a1e27fbfd93bc
2014-05-09 09:55:00 +00:00
Ori Livneh
1f3f032f2a JSON RC format: cast 'patrolled' and 'minor' to boolean
This makes them consistent with 'bot'.

Change-Id: Id4342eedee8176b0b76458bdaf8ca69c89857d47
2014-05-03 11:30:05 -07:00
umherirrender
9c614ac02d Fixed some @params documentation
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.

Change-Id: I8c9f30128b46086064326708a4878228ba459447
2014-04-14 19:52:18 +00:00
jenkins-bot
214a19f5ed Merge "Update IRCLineURL hook to include RecentChange object" 2014-03-31 10:24:30 +00:00
Waldir Pimenta
86a9b8c06c Clean up access points
* Harmonize spacing
* Use // for comments rather than #
* Harmonize call style for 'require', 'include' etc.
* Add missing profileinfo.php5
* Use "./" for path to api.php in api.php5 (to match other php5 files).
* Move documentation related to Setup.php from index.php to WebStart.php
* Remove "Initialise common code." comment in api.php (was already remove
  in most entry points)

Change-Id: I8dc4a79fd13cee49e34f250a4039b3666bd42aca
2014-03-28 01:05:30 +00:00
Erik Bernhardson
eaf4b3eb2b Update IRCLineURL hook to include RecentChange object
The Flow extension has need to change the url output by
the IRC formatter.  As a temporary fix this allows flow
to conditionally replace the url until RC can be adjusted
to inteligently generate URL's in a cross-extension way.

Change-Id: Ie951e52833a578fecd9423c2e6d3cc10816d7fef
2014-03-24 16:03:21 -07:00
This, that and the other
6cbdf65b4f Add $wgLocalInterwikis to handle multiple local prefixes
This is akin to $wgSkipSkin/$wgSkipSkins. It is quite plausible for a wiki
to have more than one self prefix (e.g. enwiki has w: en: wikipedia: and
maybe others).

Some recent changes code seems to use $wgLocalInterwiki for quite unclear
purposes:
- I removed the line using $wgLocalInterwiki from the RecentChange
  class, as the 'lang' field of $mExtra is not used anywhere in core code.
  Extensions may use it, but it would seem more appropriate for them to
  use something like $wgDBname (or indeed to consult $wgLocalInterwikis
  directly) if they need to identify a particular wiki.
- In the IRC formatter, the first prefix in the array is used (if set).
  Appropriate documentation is added to DefaultSettings.php.

Related to bug 954 comment 3.

Bug: 954
Bug: 955
Change-Id: I9dbb566385b464402c5e78510b95dd2ffb4d9489
2014-03-12 13:32:07 +01:00
Kunal Mehta
f1d28a569d rcfeed: Use wfWikiID() instead of $wgDBname
Change-Id: Id1f408a4c498f23f656298e3453d2a9264e3ac7c
2014-01-10 17:52:25 -08:00
Kunal Mehta
c1bc3607f8 Add XMLRCFeedFormatter
Endpoints like XMPP natively support sending XML,
which can be advantageous in some cases.

Since most of the logic is the same as the existing
JSONRCFeedFormatter, it was moved into an abstract
MachineReadableRCFeedFormatter class, which simply
creates the array and lets the implementations format
it.

Change-Id: I44f22777cb55fc1ca6527b79ef40b340e2afbd58
2014-01-10 17:50:41 -08:00
Kunal Mehta
a76af53600 Cleanup of includes/rcfeed
* Added license headers to everything
* Added @since tags for all classes
* Use wfParseUrl instead of parse_url
* Check for RedisConnectionPool::getConnection returning false

Change-Id: I7db808c0465bd869de3f2daa82444b5e3d1268c2
2014-01-04 21:12:03 -08:00
umherirrender
db24b10ca8 Use lowercase key words
Change-Id: I57569b7082a0decc8128ecadd8ec5d1a5c327673
2013-11-23 15:56:42 +01:00
Ori Livneh
9590795b91 Add 'RedisPubSubFeedEngine' feed engine
This patch adds a class which implements the RCFeedEngine interface by
publishing recent change notifications to Redis. The class handles the
'redis://' URI scheme. Recent changes are PUBLISHed to the channel 'rc'; a
different channel name may be specified as a path component.

Change-Id: I846036c091c45059a8947245a1efe92c9800dcf4
2013-10-21 17:22:00 +00:00
Platonides
0015f5ff69 Use canonical class name, remove unused globals.
Change-Id: I94cf491e4c1c793f455fd597b383f8133b0aace3
2013-08-30 00:18:42 +02:00
Victor Vasiliev
2961884b43 Provide a JSON recent changes feed.
This introduces a new configuration variable, $wgRCFeeds, which allows the user
to configure multiple destinations for RC notifications. It also allows the
notification format to be customized. Two formats are included by default: the
older IRC format and a new JSON format.

Change-Id: I270bde418a82985c94372ac4579100435b6ee026
2013-08-25 21:23:16 -07:00