aboutsummaryrefslogtreecommitdiffstats
path: root/includes/FeedUtils.php
Commit message (Collapse)AuthorAgeFilesLines
* Feed: Move feed-related classes to Feed/ and namespace themAmir Sarabadani2022-10-201-310/+0
| | | | | Bug: T166010 Change-Id: Icdbe003e74d2f31b68b575acfa94c09c24d7aed5
* Use name constants to access config settings.daniel2022-04-071-3/+4
| | | | | | | | | | | Use name constants instead of string literals in calls to Config::get and ServiceOptions::get, when referring to core configuration variables. This protects against typos and makes the decumentation and schema declaration of the config settings discoverable. This is the first batch, only touching files directly under /includes/ Change-Id: I7252e636c7c86d950d9257b33491af492c6dd5eb
* Fix various documentation related to scalar typesUmherirrender2022-03-091-2/+2
| | | | | | Found by phan strict checks Change-Id: If41d16b473baddd92cc4261cdc2bfbe65fedcb19
* Refactor global variables to use MediaWikiServices insteadTChin2022-01-101-9/+9
| | | | | | | | | | | | Automatically refactors wg prefixed globals to use MediaWikiServices config using Rector. Doesn't include files that set globals or files that fail CI. Rector Gist: https://gist.github.com/tchin25/7cc54f6d23aedef010b22e4dfbead228 * This patch uses a modified source code rector library for our specific use case and the rector will have different effects without it. A writeup for future reference is here: https://meta.wikimedia.org/wiki/User:TChin_(WMF)/Using_Rector_On_MediaWiki Change-Id: I1a691f01cd82e60bf41207d32501edb4b9835e37
* Introduce CommentFormatterTim Starling2021-09-281-6/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CommentParser: * Move comment formatting backend from Linker to a CommentParser service. Allow link existence and file existence to be batched. * Rename $local to $samePage since I think that is clearer. * Rename $title to $selfLinkTarget since it was unclear what the title was used for. * Rename the "autocomment" concept to "section link" in public interfaces, although the old term remains in CSS classes. * Keep unsafe HTML pass-through in separate "unsafe" methods, for easier static analysis and code review. CommentFormatter: * Add CommentFormatter and RowCommentFormatter services as a usable frontend for comment batches, and to replace the Linker static methods. * Provide fluent and parametric interfaces. Linker: * Remove Linker::makeCommentLink() without deprecation -- nothing calls it and it is obviously an internal helper. * Soft-deprecate Linker methods formatComment(), formatLinksInComment(), commentBlock() and revComment(). Caller migration: * CommentFormatter single: Linker, RollbackAction, ApiComparePages, ApiParse * CommentFormatter parametric batch: ImageHistoryPseudoPager * CommentFormatter fluent batch: ApiQueryFilearchive * RowCommentFormatter sequential: History feed, BlocklistPager, ProtectedPagesPager, ApiQueryProtectedTitles * RowCommentFormatter with index: ChangesFeed, ChangesList, ApiQueryDeletedrevs, ApiQueryLogEvents, ApiQueryRecentChanges * RevisionCommentBatch: HistoryPager, ContribsPager Bug: T285917 Change-Id: Ia3fd50a4a13138ba5003d884962da24746d562d0
* Merge "Make use of Html class utility methods in a few places"jenkins-bot2021-08-311-8/+16
|\
| * Make use of Html class utility methods in a few placesDannyS7122021-08-121-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | Each files' changes can be reviewed independently There may be places in the files that I didn't catch - this is not meant to be an exhaustive replacement Even where it may make sense to use Html::element, Html::rawElement is used in this patch to avoid changing any behavior. Change-Id: I26eaacc65106f10a5066c31d82f6594a59ff1281
* | FeedUtils: remove usage of $wgLangAlexander Vorwerk2021-08-131-6/+9
|/ | | | | Bug: T160814 Change-Id: Ib769ee725c20245356772f3c2b23531f5b94ad46
* Merge "FeedUtils: Update regex to match classes appropriately, and test"jenkins-bot2020-12-161-2/+3
|\
| * FeedUtils: Update regex to match classes appropriately, and testSubin Siby2020-12-151-2/+3
| | | | | | | | | | | | | | | | Not all classes are matched correctly in feed output because of regex used. Fixed it by updating regex and adding unit tests Bug: T36801 Change-Id: I6e7a883caee2a36c11966991b19ba93c229683cf
* | Improve docs about @param/@return object $row to stdClassUmherirrender2020-11-131-1/+1
|/ | | | Change-Id: I743d992db703f2b46b6e3abf80c14d026c6599f4
* FeedUtils::checkFeedOutput add $output parameterDannyS7122020-09-101-4/+13
| | | | | | | Optional for now Bug: T252979 Change-Id: Ic95fca9efb4beb5655087d3bd2b5264c86aca091
* FeedUtils: Remove use of Revision objectsDannyS7122020-04-271-9/+16
| | | | | | Bug: T250981 Bug: T249021 Change-Id: I0251865f6f1f5ab0627d5eac92d0e210284bc291
* FeedUtils: Amend Base10 colorVolker E2020-04-171-6/+6
| | | | | | | | Amending Design Style Guide Base10 to slightly darker `#202122` to fulfill WCAG requirements in connection to Accent50. Bug: T248393 Change-Id: Id50b31891ad91c05ec8cc28c8fc75152161b5b89
* Replace calls to Title::getUserPermissionsErrors (part 5)DannyS7122020-02-261-1/+6
| | | | | | | This does //not// fix all calls in core. Bug: T244929 Change-Id: I02ffcca31fa0bdc6bffddf21e82f4ff5e9ab5374
* Introduce ContentHandlerFactoryArtBaltai2020-02-071-1/+5
| | | | | | | | | | | | | | | | | Added: - ContentHandlerFactory Tests: - PHPUnit Changed - Calls of changed and deprecated - DI for some service/api Deprecated: - ContentHandler::* then similar to ContentHandlerFactory - ContentHandler::getForTitle - ContentHandler::$handlers Bug: T235165 Change-Id: I59246938c7ad7b3e70e46c9e698708ef9bc672c6
* Coding style: Auto-fix MediaWiki.Usage.IsNull.IsNullJames D. Forrester2020-01-101-1/+1
| | | | Change-Id: I90cfe8366c0245c9c67e598d17800684897a4e27
* phan: Disable enable_class_alias_supportUmherirrender2019-09-151-1/+1
| | | | | | It is enabled for b/c in extensions, but not needed in core Change-Id: I51dca12be9c77049f77563d9bf0edd07928c2300
* Avoid usage of deprecated Revision::* constantsDerick Alangi2019-07-211-1/+3
| | | | Change-Id: I2d06bbacef88573f286da25994a3ad434ed90e9c
* changes: Remove unused FeedUtils::checkPurge methodTimo Tijhof2019-05-241-20/+0
| | | | | | | This introduced for use by ChangesFeed::execute(), which in turn has also been unused for many years – and removed in 6f4d15e385807. Change-Id: I5ba7ea2b6ff86e4d210b77bf05971c183352424c
* Avoid use of deprecated ObjectCache::getMainWANInstance methodAaron Schulz2019-03-011-1/+2
| | | | Change-Id: I429e68c8642a00afa812f5ae900c1fb4f8308528
* Refactor calls to deprecated function Content::getNativeData()Bill Pirkle2019-02-151-1/+1
| | | | | | | | Function Content::getNativeData() was deprecated. Replace with calls to new function TextContent::getText() in most places. Bug: T155582 Change-Id: I2bd508c72aac4faf474ba45ab1f92e2e8d2eb9be
* Pass $key into CommentStore methods and use MediawikiServicesaddshore2018-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | This allows CommentStore to be added to MediaWikiServices without the need of an aditional Factory. This change includes a compatability layer to allow the behaviour from 1.30 to continue to be used while deprecated. CommentStore::newKey has been deprecated. Keys are now passed into the public methods of CommentStore where needed. The following CommentStore methods have had their signatures changed to introduced a $key parameter, but when used in conjunction with CommentStore::newKey behaviour will remain unchanged: * CommentStore::getFields * CommentStore::getJoin * CommentStore::getComment * CommentStore::getCommentLegacy * CommentStore::insert * CommentStore::insertWithTemplate Change-Id: I3abb62a5cfb0dcd456da9f4eb35583476ae41cfb
* Remove @param comments that literally repeat what the code saysThiemo Mättig2018-01-101-1/+1
| | | | | | | | | These comments do not add anything. I argue they are worse than having no comments, because I have to read them first to understand they actually don't explain anything. Removing them makes room for actual improvements in the future (if needed). Change-Id: Iee70aad681b3385e9af282d5581c10addbb91ac4
* Replace selectFields() methods with getQueryInfo()Brad Jorsch2017-10-301-3/+1
| | | | | | | | | | | | | | Several classes have a "selectFields()" static method to tell callers which fields to select from the database. With the recent comment table change and the upcoming actor table change, this pattern has become too simplistic as a SELECT will need to join several tables to be able to retrieve all the needed fields. Thus, we deprecate the selectFields() methods in favor of getQueryInfo() methods that return tables and join conditions in addition to the fields. Change-Id: Idcfd15568489d9f03a7ba4460e96610d33bc4089
* Align diff context colors to WikimediaUI color paletteAmir Sarabadani2017-10-071-7/+7
| | | | | | | | Aligning diff context `background-color`, `color` and `border-color` to overhauled WikimediaUI palette ones. Bug: T152025 Change-Id: I70a4eeabfb0905941c093efad38fb1b21dbe4418
* Add `comment` table and code to start using itBrad Jorsch2017-08-301-2/+5
| | | | | | | A subsequent patch will remove the old columns. Bug: T166732 Change-Id: Ic3a434c061ed6e443ea072bc62dda09acbeeed7f
* Remove empty lines at begin of function, if, foreach, switchUmherirrender2017-07-011-1/+0
| | | | | | Organize phpcs.xml a bit Change-Id: Ifb767729b481b4b686e6d6444cf48b1f580cc478
* Merge "includes: Replace implicit Bugzilla bug numbers with Phab ones"jenkins-bot2017-02-281-1/+1
|\
| * includes: Replace implicit Bugzilla bug numbers with Phab onesJames D. Forrester2017-02-211-1/+1
| | | | | | | | | | | | | | It's unreasonable to expect newbies to know that "bug 12345" means "Task T14345" except where it doesn't, so let's just standardise on the real numbers. Change-Id: I6f59febaf8fc96e80f8cfc11f4356283f461142a
* | FeedUtils: Remove weird commented-out blockBartosz Dziewoński2017-02-251-7/+0
|/ | | | | | | | This has been added in 58f7bb30a04d6c1f137cc1659b8998c5349bf13e (r36376), already commented-out, and was moved and amended several times until it became completely out of place. Change-Id: I11b6e3e2fbb2d0a325a6723bf5874133a7f53851
* Require POST for action=purge in PurgeActionAaron Schulz2016-08-101-0/+1
| | | | | | | | | | | | | | | | | For the index.php end point, POSTs do not need a token. This avoids cross-DC writes in active/active DC setups and avoids DB writes that can be caused by just accidentally following a link. There are no links to action=purge by default in MediaWiki. User scripts that create purge links will continue to work. However these links will now point to a confirmation form. To preserve the immediate-purge-redirect effect, these scripts should be updated to use the API instead. Bug: T135170 Change-Id: I5749ff470d99c5e3f22e05ff6856394cc05a0f48
* Convert all array() syntax to []Kunal Mehta2016-02-171-6/+6
| | | | | | | | | | 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
* Migrate feeds from $messageMemc to the WAN cacheAaron Schulz2015-11-101-5/+6
| | | | | | | This makes the delete() calls work properly for all DCs. Also, using the message cache was fairly bizzare. Change-Id: Idec7fa47811e982ba89bb8fbbd9565a26585e77f
* Fix issues identified by SpaceBeforeSingleLineComment sniffVivek Ghaisas2015-09-261-7/+7
| | | | Change-Id: I048ccb1fa260e4b7152ca5f09b053defdd72d8f9
* Use wikimedia/utfnormal library, add backwards-compatability layerKunal Mehta2015-03-241-1/+1
| | | | | | | | This drops support for the custom utf8 normal PHP extension in favor of the intl extension. Bug: T90825 Change-Id: Ifbaeb2ef684217cf6187ccc4fb4d303f89608300
* Removed remaining profile callsAaron Schulz2015-01-081-2/+0
| | | | Change-Id: I31c81c78715048004fc8fca0f27d09c1fa71c118
* Remove obvious function-level profilingChad Horohoe2015-01-071-3/+0
| | | | | | | | | | | Xhprof generates this data now. Custom profiling of various sub-function units are kept. Calls to profiler represented about 3% of page execution time on Special:BlankPage (1.5% in/out); after this change it's down to about 0.98% of page execution time. Change-Id: Id9a1dc9d8f80bbd52e42226b724a1e1213d07af7
* Cleanup some docs (includes/*.php)umherirrender2014-07-241-1/+1
| | | | | | | | | | - 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: I783e4dbfe5f6f98b32b9a03ccf6439e13e132bcc
* Make phpcs-strict pass on includes/ (1/~10)Siebrand Mazeland2014-05-111-4/+12
| | | | Change-Id: Ib51381a2261d064988ba2f39b71c0252f2458faf
* Fixed some @params documentation (includes/*)umherirrender2014-04-201-17/+17
| | | | | | | | | 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. Also added some missing @param. Change-Id: I7f605aa9e117b5fd80d9b1440864fe526d2b14a5
* Fixed spacing and removed unneeded parenthesisumherirrender2013-05-171-1/+1
| | | | | | | | Added spaces after/before parenthesis Removed unneeded parenthesis around some statements Broke a long line Change-Id: I7fbe129f7bbf524dd0598ece2a9708643f08453b
* Pass array to Title::getLocalURL instead of an urlencoded stringumherirrender2013-04-271-3/+4
| | | | | | | This makes code easier to read and the urlencode is done inside getLocalURL or friends Change-Id: I21b988890356d11835eedba12a90a347bf0905b2
* Fixed spacing in files direct in includes folderumherirrender2013-04-211-6/+6
| | | | | | | Added spaces before if, foreach Added some braces for one line statements Change-Id: Ibb8dd102db045522d12ff939075ba7420d95ab6b
* Added/Removed spaces around string concatenationumherirrender2013-04-131-2/+2
| | | | | | | | | And added/removed spaces around some other tokens, like +, -, *, /, <, >, =, ! Fixed windows newline style Change-Id: I0b9c8c408f3f6bfc0d685a074d7ec468fb848fc8
* Fix case of some Title methodsAlexandre Emsenhuber2013-03-271-1/+1
| | | | Change-Id: I37ce7fe392f4941c500fa0a88007664501d7e338
* Spellchecked /includes directoryYuri Astrakhan2013-03-131-2/+2
| | | | | | | | | * Ran spell-checker over code comments in /includes/ * A few spellchecking fixes for wfDebug() calls Found one very strange (NOOP?) line in Linker.php - see "TODO: BUG?" Change-Id: Ibb86b51073b980eda9ecce2cf0b8dd33f058adbf
* Fixed @param tags to conform with Doxygen format.Tyler Anthony Romeo2013-03-111-6/+6
| | | | | | | | | | | Doxygen expects parameter types to come before the parameter name in @param tags. Used a quick regex to switch everything around where possible. This only fixes cases where a primitve variable (or a primitive followed by other types) is the variable type. Other cases will need to be fixed manually. Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
* (Bug 34798) Synced the FeedUtils.php page with mediawiki.action.history.diff.cssrahul212013-03-091-6/+6
| | | | | | ->Added the background,border in diff-context,diff-addedline,diff-deleted line in $styles array in the FeedUtils.php Change-Id: Icbfb6cfc659652c146e565b760d0815640fdad64
* Merge "remove space before semicolon"IAlex2013-02-101-1/+1
|\