aboutsummaryrefslogtreecommitdiffstats
path: root/includes/rcfeed/RCFeed.php
Commit message (Collapse)AuthorAgeFilesLines
* recentchanges: Move rcfeed/ to includes/recentchanges/RCFeed/Timo Tijhof2024-08-291-85/+0
| | | | | | | | | | | | | | | | It is part of the component at https://phabricator.wikimedia.org/tag/mediawiki-recent-changes/ and https://www.mediawiki.org/wiki/Developers/Maintainers and since Ifac20da51f7e809f under the same "Recent changes" doc group. The Maintainers list oddly enough lists only rcfeed and completely forgets the majority of it under /includes/changes (or now, /includes/recentchanges). Bug: T364652 Change-Id: I94e6705672c1e2821bdc726aa7a383d9e7c1f7b5
* recentchanges: Improve docs, fix file headers, fix doc groupsTimo Tijhof2024-08-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Define "RecentChanges" doc group and add all classes in changes/ and rcfeed/ to the group, as well as a few obvious classes that we (currently) maintain in vertical buckets: maintenance, api, specials. * Doc group "Change tagging" was invalid because a group identifier must be a single word, and this was thus passing an unexpected second argument to the `ingroup` Doxygen command. As such, it was missing on https://doc.wikimedia.org/mediawiki-core/master/php/ Define "ChangeTags" properly and fix/add classes in this component. * Add missing `ingroup` to class blocks (and remove from any file blocks) as otherwise the file is indexed twice (e.g. in Doxygen) which makes navigation on doc.wikimedia.org rather messy. Remove duplicate descriptions from file blocks in favour of class doc blocks. This reduces needless duplication and was often incorrect or outdated, and helps make file headers more consistently (visually) ignorable. Ref https://gerrit.wikimedia.org/r/q/message:ingroup+is:merged * Minor improvements to class descriptions here and there. Test plan: * `php maintenance/mwdocgen.php --file includes/changes,includes/changetags,includes/rcfeed` (This will emits harmless warnings about undefined "Hooks" group, because it's referenced but not included in this fast subset.) * open docs/html/index.html Bug: T364652 Change-Id: Ifac20da51f7e809f1a9ccbfac3bf50e739a083ea
* Add namespace and deprecation alias to UDPRCFeedEngineEbrahim Byagowi2024-05-201-1/+0
| | | | | | | | | This patch introduces a namespace declaration for the MediaWiki\RCFeed to UDPRCFeedEngine and establishes a class alias marked as deprecated since version 1.43. Bug: T353458 Change-Id: I27437c2417984f21e29237b011add20cad9f4389
* Merge "Add namespace and deprecation alias to RedisPubSubFeedEngine"jenkins-bot2024-05-191-1/+0
|\
| * Add namespace and deprecation alias to RedisPubSubFeedEngineEbrahim Byagowi2024-05-191-1/+0
| | | | | | | | | | | | | | | | | | This patch introduces a namespace declaration for the Wikimedia\RCFeed to RedisPubSubFeedEngine and establishes a class alias marked as deprecated since version 1.43. Bug: T353458 Change-Id: If5b8a0b1f957e46f29907711079389fe543941d0
* | Import InvalidArgumentException at top of the sourceEbrahim Byagowi2024-05-191-4/+5
|/ | | | | | | | | | | | | | It was asked in a patch review to apply fully import InvalidArgumentException where possible. I was guessing some of my other already merged patches have but turned out such thing exists other places style so for the sake of consistency I've turned rest of inline import of the specific exception at top of the file. There are instances of source files that aren't in any namespace but have fully qualified import which this patch doesn't touch. Change-Id: I4071fc698b65746d9594cf4d5f45bae82843d436
* Add namespace and deprecation alias to RCFeedEbrahim Byagowi2024-05-171-4/+12
| | | | | | | | | This patch introduces a namespace declaration for the MediaWiki\RCFeed to RCFeed and establishes a class alias marked as deprecated since version 1.43. Bug: T353458 Change-Id: I2e63e05901a75d8cf8a1e9d874dc916c0a5749a4
* rcfeed: Deprecate $wgRCEngines and RCFeedEngineTimo Tijhof2022-03-081-5/+20
| | | | | | | | | | | | | | | | | | | | | | Follows-up 39a6e3dc4d (I8be497c623c5d92). * Improve documentation all around and advertise 'class' everywhere instead of 'uri'. * Add test coverage for RCFeed::factory(). * Deprecate the $wgRCEngines "uri to class" mapping in favour of specifying "class" directly in $wgRCFeeds. * Deprecate RCFeedEngine in favour of FormattedRCFeed. Convert to class_alias so that UDPRCFeedEngine no longer has to extend the deprecated class name explicitly (for instanceof compat). * Hard-deprecate RecentChange::getEngine. Bug: T250628 Depends-On: Ie939e1d06b9ee2d841ec7256c8d24cc4e7e386dd Change-Id: Ib6758d724c7200404c89c7ab157aa55f1cad9763
* rcfeed: Allow easy mocking of RCFeed::factory objectsTimo Tijhof2022-03-031-0/+3
| | | | | | | | | | This matches what the RecentChange::getEngine method provides, which is deprecated and replaced by this. However, in order to update tests (such as those in EventBus) to the new method, that method first has to support mocking of this kind. Bug: T250628 Change-Id: I126f7c8b117b5d2e66a41ebb314523083e764547
* rcfeed: Ensure formatter (and other params) is passed to RCFeedEngineTimo Tijhof2017-02-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | Follows-up 39a6e3dc4d. Class-based feeds are always given their parameters by RCFeed::factory. However because the old getEngine() method insists on creating its own object, the constructor parameters were not given. Add it as optional parameter and pass it through there. This is backwards-compatible still because before the 39a6e3dc4d refactor, an RCFeedEngine also was not given information about any formatter and it was the callers responsibility to format the line before calling send(). CentralAuth still uses it this way and that works fine. The core-caller that expected the construction parameters since 39a6e3dc4d is hereby fixed. The test couldn't catch this because it constructed the class instance there, since PHPUnit does not support a mock class that is instantiated by foreign code, and the parameter is passed there. Bug: T156996 Bug: T157106 Change-Id: I83433cf57b6e040cdb69f3ad8807a999c4f931a5
* Refactor RCFeed configuration (backwards compatible)Timo Tijhof2017-02-011-0/+59
Previously: * Engines had to be registered in $wgRCEngines. * The RCFeedEngine classes took no constructor arguments and were expected to send whatever text is previously formatted without any information about it. This generic design was flexible in allowing one to use any formatter with any engine with minimal configuration and no need for additional classes. * Each feed configured their destination by setting a 'uri' option that encodes the name of the engine in PHP as the uri scheme. Other uri components had to be used for any other parameters to the engine (host, port, path). While fairly limited, it was sufficient for the default engines in core. Changes: * Allow feed classes to be directly associated with a feed in $wgRCFeeds via a new 'class' option - without the indirection of 'uri' and $wgRCEngines. All options are passed to the given class constructor. This matches the design used elsewhere in MediaWiki. (ObjectCache, FileRepo, FileBackend, JobQueue, LBFactory, etc.) This means we no longer enforce a 1:1 mapping of internet protocols to a specific feed engine, and it allows settings to be passed without being encoded as a URI neccecarily. Main use case for this refactor is EventBus (see I7edc4d57fa), Interestingly, this matches the (then incorrect) documentation written for $wgRCFeeds in 2961884b43 (which mentions an 'engine' property that would do the same thing). * Move the default 'omit' filters and unrestricted 'formatter' handling to a new FormattedRCFeed class, which remains the default. * Deprecate RecentChange::getEngine() in favour of RCFeed::factory(). * Document wgRCEngines as "@since 1.22". Follows 2961884b43, ffc71cb6af. Change-Id: I8be497c623c5d928762e3d3406a388f4d91add9a