aboutsummaryrefslogtreecommitdiffstats
path: root/includes/filerepo/file/MediaFileTrait.php
Commit message (Collapse)AuthorAgeFilesLines
* Add support for conditional user defaultsMartin Urbanec2024-01-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | Why: Sometimes, it is necessary to have different behavior for newly registered and existing users. For example, this happens in the Echo or GrowthExperiments extensions. As of now, this behavior is implemented by inserting user_properties rows in onLocalUserCreated. Over time, this results in a singificant amount of rows inserted, which contributes to the user_properties table bloat, which is already overly large (cf. T54777). This patch makes it possible to remove such rows by supporting conditional defaults for user properties. What: Add support for conditional defaults of user properties. This can be configured via `ConditionalUserOptions` config option. Bug: T321527 Change-Id: I1549c3137e66801c85e03e46427e27da333d68e2
* Replace array_keys in foreach to use $_ as value insteadUmherirrender2023-07-101-1/+1
| | | | | | | | When the value of the associated array is not used, there is no need to use array_keys and create internal a copy of the array, just omit the value with $_ to tell static analyzer that the var is unused. Change-Id: I5c6d667e98c0167c0573c683f0d617bc1d4ca619
* Replace deprecated MWExceptionDaimona Eaytoy2023-06-121-23/+19
| | | | | Bug: T328220 Change-Id: I0408575ee71e58d1c9e9ebedabab35bd3813f515
* Use short array destructuring instead of list()Tim Starling2022-10-211-1/+1
| | | | | | | | Introduced in PHP 7.1. Because it's shorter and looks nice. I used regex replacement. Change-Id: I0555e199d126cd44501f859cb4589f8bd49694da
* filerepo: Replace deprecated wfExpandUrlUmherirrender2022-10-051-3/+5
| | | | | Bug: T319340 Change-Id: I7896fc4df95f34bd5095cf10beb723738a9a3bf6
* Use MainConfigNames instead of string literals, #2Aryeh Gregor2022-04-131-1/+3
| | | | | | | This covers all occurrences of /onfig->.*get( '/ in includes/. Undoubtedly there are still plenty more to go. Change-Id: I33196c4153437778496f40436bcde399638ac361
* filerepo: Clean up file and class doc commentsTimo Tijhof2022-04-071-1/+2
| | | | | | | | | | | | | | | | * Remove copy-paste descriptions that are unrelated to the file. * Move any useful information from file block to class block. * Ensure any relevant `ingroup` is set on the class block. * Remove left-over ingroup and class description from file block, which pollutes the doc index for no gain. * Mark some obscure classes that have no references outside core in Codesearch Everywhere as internal. Change-Id: If2360596b4a7511db7439b4b9867b0600ce2d5f8
* phan: Disable null_casts_as_any_type settingUmherirrender2022-03-211-0/+1
| | | | | | | | | | | Make phan stricter about null types by setting null_casts_as_any_type to false (the default in mediawiki-phan-config) Remaining false positive issues are suppressed. The suppression and the setting change can only be done together Bug: T242536 Bug: T301991 Change-Id: I0f295382b96fb3be8037a01c10487d9d591e7e01
* Refactor global variables to use MediaWikiServices insteadTChin2022-01-101-4/+4
| | | | | | | | | | | | 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
* file: Fix nullable documentation for property, args and return typesUmherirrender2021-10-201-1/+1
| | | | | | Change documentation to null or false where the type is allowed Change-Id: I7c9a612adabf47da8ce11265907702ad5d83699a
* Deprecate File::getUser in favor of File::getUploaderPetr Pchelko2021-06-021-3/+4
| | | | Change-Id: I8a45a8fdfa827f203e6bc123cb685d02c3612bb0
* Convert File to Authority/UserIdentityPetr Pchelko2021-05-101-3/+4
| | | | | | | | None of the changed methods actually are overridden according to codesearch, so I guess it is ok to change signatures. Change-Id: I35bafb303163dfc1584a13b29675b5e10cd055fd
* Rest: use Authority in all core handlersPetr Pchelko2021-01-211-5/+8
| | | | | Bug: T239753 Change-Id: Idf2229255f49514dd8b68bf63573c5b619b4f2f1
* Remove documentation that literally repeats the codeThiemo Kreuz2020-10-271-1/+1
| | | | | | | | | | | | | | | For example, documenting the method getUser() with "get the User object" does not add any information that's not already there. But I have to read the text first to understand that it doesn't document anything that's not already obvious from the code. Some of this is from a time when we had a PHPCS sniff that was complaining when a line like `@param User $user` doesn't end with some descriptive text. Some users started adding text like `@param User $user The User` back then. Let's please remove this. Change-Id: I0ea8d051bc732466c73940de9259f87ffb86ce7a
* Add core REST API endpoint for media linksBill Pirkle2020-01-221-0/+162
Add an endpoint to the core REST API to return the list of media files embedded in a page, including certain metadata for each media file. Bug: T236169 Change-Id: I3188848ee7de365d209dfb7da5b885313e9f705b