Commit graph

1687 commits

Author SHA1 Message Date
James D. Forrester
c1599c91b3 Namespace Config-related classes under \MediaWiki\Config
Bug: T166010
Change-Id: I4066885a7ea071d22497abcdb3f95e73e154d08c
2023-09-21 05:41:58 +00:00
James D. Forrester
468e69bccc Namespace Sanitizer under \MediaWiki\Parser
Bug: T166010
Change-Id: Id13dcbf7a0372017495958dbc4f601f40c122508
2023-09-21 05:39:23 +00:00
James D. Forrester
3851805f64 Namespace remaining User-related classes under \MediaWiki\User
Bug: T166010
Change-Id: Ibda1e8be0f23c6262a32b607f8260cad36f188fc
2023-09-20 09:12:08 +01:00
daniel
7b8187f257 Introduce ActionFactory::getActionInfo
The new method encapsulates the fact that we currently have to
instantiate action objects to determine which permission the action
requires. This encapsulation reduces coupling in PermissionManager
and allows us to easily change to a better way to create ActionInfo
later.

Eventually, ActionInfo should be constructed based on the action's
object spec. This requires us to include the relevant information in all
specs, in core and extensions.

Change-Id: I707a165c41403ebd4a3edfc66c1595e1bd3a4087
2023-09-20 10:06:02 +10:00
James D. Forrester
1d0b7ae1e2 Namespace User under \MediaWiki\User
Bug: T166010
Change-Id: I7257302b485588af31384d4f7fc8e30551f161f1
2023-09-19 19:18:16 +00:00
James D. Forrester
5bc2a04b08 Namespace remaining Title-related classes under \MediaWiki\Title
Bug: T166010
Change-Id: Ia2e5a7367cc8cdbd8a7b845ae2fd5d776ff22891
2023-09-19 05:21:23 +00:00
James D. Forrester
41fb118c5c Namespace TitleParser under \MediaWiki\Title
One of the big ones, so doing this alone.

Bug: T166010
Change-Id: I4848e903b0c0a2f7c58ac19e0baeef0085a36bdc
2023-09-19 05:19:00 +00:00
James D. Forrester
b16be7a36c Namespace TitleFormatter under \MediaWiki\Title
One of the big ones, so doing this alone.

Bug: T166010
Change-Id: Ic2d59eb6764b1a273ed7162ecabf641f638b8f66
2023-09-19 05:17:18 +00:00
James D. Forrester
a8a6cfd966 Namespace NamespaceInfo under \MediaWiki\Title
One of the big ones, so doing this alone.

Bug: T166010
Change-Id: Ibe103cd362535d3cb94cb8931e95fc74099d1497
2023-09-19 05:17:04 +00:00
James D. Forrester
94ece673b2 Namespace TitleValue under \MediaWiki\Title
One of the big ones, so doing this alone.

Bug: T166010
Change-Id: I4c901d5c32696d8334ec30cede7d9b6f3d8d645e
2023-09-18 18:24:39 +01:00
James D. Forrester
459cbb0494 Namespace remaining 'specialpage' files under \MediaWiki\SpecialPage
SpecialPageFactory is already here, but none of the others were yet.

Bug: T166010
Change-Id: I9689bf0a1ab329625e23669b99f019b96295fffd
2023-09-18 18:23:13 +01:00
James D. Forrester
5088626212 Namespace 'special' Pagers under \MediaWiki\Pager
They're under 'specials' because that's where they're mostly used,
but they're just another kind of Pager (shown by their use outwith
the MediaWiki\Specials hierarchy, which is a bad code smell for us
to review later).

Bug: T166010
Change-Id: Iad3f91582b723c1e6679525aa852ffdfd8c6d5ba
2023-09-18 18:23:13 +01:00
James D. Forrester
b6f263b043 Namespace HistoryPager under \MediaWiki\Pager
Although it's in a different path, it's alone and only Action-related
because that's where it's used.

Bug: T166010
Change-Id: I6d4cebfd6ad68e1500c3a3a5450c97bfd3327c2b
2023-09-18 18:23:13 +01:00
James D. Forrester
3aeb9d681c Namespace core Pagers under \MediaWiki\Pager
Bug: T166010
Change-Id: Ibe12d1754709d48f71edd4cde1f13a542344a21e
2023-09-18 12:27:56 +01:00
jenkins-bot
e114026bab Merge "Add UserRegistrationLookup" 2023-09-15 16:59:54 +00:00
Martin Urbanec
85e78d22bd Add UserRegistrationLookup
Why:
Temporary accounts introduced as part of IP Masking are supposed
to expire 1 year after their registration. Accounts can have
multiple registration timestamps when in a wiki-farm setup,
depending on which wiki we consult.

To implement the account expiration logic, we need to know the global
(first) registration timestamp.

Similar to CentralIdLookup, a concept of a registration date
provider is introduced. Unlike IDs, users can have multiple
kinds of registration dates (Wikimedia recognizes local and global,
but third parties can have different needs). For that reason,
any number of registration providers can be registered at any
given time; caller determines which one is requested. The default
is `local`, which is the only provider that is guaranteed to exist.

What:
* Add UserRegistrationLookup
* Add UserRegistrationProviders config variable

Bug: T344694
Change-Id: If9fa12a392064dd504590a861a175e3604a34fab
2023-09-15 11:38:23 +02:00
James D. Forrester
0c0d8777a8 Namespace SpecialW* under \MediaWiki\Specials
This completes the namespacing of core special pages.

Change-Id: I195e7fc34a9413bfea0a33c941f2362cd4a7ff10
2023-09-15 09:01:31 +01:00
James D. Forrester
870f7c3f1a Namespace SpecialVersion under \MediaWiki\Specials
Change-Id: Ibeb181c653dac3796c44b36c8ff9f2ed572d5f42
2023-09-14 19:25:51 +00:00
James D. Forrester
87f2b083af Namespace SpecialU* under \MediaWiki\Specials
Change-Id: I75b04a7a65f8d37da12d2ed3892e065e97c92437
2023-09-14 19:24:08 +00:00
James D. Forrester
cc4570464c Namespace SpecialT* under \MediaWiki\Specials
Change-Id: Iaab14a0ded4950c5a6dafc2f301792b6546fb15f
2023-09-14 19:23:23 +00:00
James D. Forrester
a6f3c28865 Namespace SpecialS* under \MediaWiki\Specials
Change-Id: Icccdaa93f8089d88b6d3ba153ecfaa22c901ce66
2023-09-14 19:23:14 +00:00
James D. Forrester
ea2979b8ca Namespace SpecialR* under \MediaWiki\Specials
Change-Id: I735222c437313db139cd9fc780c332767189323f
2023-09-14 14:35:03 +01:00
jenkins-bot
99b0d1493d Merge "rdbms: Rename DatabaseMysqlBase to DatabaseMySQL" 2023-09-13 19:29:12 +00:00
James D. Forrester
f17ccb46ae Namespace SpecialP* under \MediaWiki\Specials
Change-Id: I10211c4406b1eedd6e5de63f1e57868f924640db
2023-09-13 14:41:15 +00:00
James D. Forrester
158e6ab5f2 Namespace SpecialN* under \MediaWiki\Specials
Change-Id: I403664ce3585f022e89da75e75baefa4b4db29f9
2023-09-13 12:30:32 +01:00
Amir Sarabadani
5dc9441b1d rdbms: Rename DatabaseMysqlBase to DatabaseMySQL
Now that we merged DatabaseMysqli with DatabaseMysqlBase, there is no
base anymore.

I could have gone with DatabaseMysql, and the naming is not that
consistent in rdbms:
amir@amir-ThinkPad-P1-Gen-3:~/core/includes/libs/rdbms$ find . | grep -i mysql
./platform/MySQLPlatform.php
./field/MySQLField.php
./dbal/MWMySQLPlatform.php
./database/DatabaseMysqlBase.php
./database/DatabaseMysqli.php
./database/position/MySQLPrimaryPos.php
./database/resultwrapper/MysqliResultWrapper.php
./database/replication/MysqlReplicationReporter.php

The majority is MySQL and since it's the correct form, I went with that
instead.

Change-Id: I3ee792f357dda974c855ba24b9b35e72fc73db06
2023-09-13 08:15:08 +01:00
jenkins-bot
7f9538e32a Merge "http: MultiHttpClient supports TelemetryHeadersInterface" 2023-09-12 20:42:27 +00:00
Piotr Miazga
8009e9d027 http: MultiHttpClient supports TelemetryHeadersInterface
Introduce a new interface Wikimedia/Http/TelemetryHeadersInterface
that provides telemetry information that could be attached to
HTTP Requests. MultiHttpClient is expecting `telemetry` option
of TelemetryHeadersInterface type.

The MediaWiki/Http/Telemetry implements the interface, therefore
ObjectCache can inject it to RESTBagOStuff, that further injects
it to MultiHttpClient.

Bug: T344926
Change-Id: I59a3f1048c403fe2e4ef0c74353dfe74ff9ca893
2023-09-12 18:05:17 +02:00
Amir Sarabadani
5bd33d46ef Reorg: Move WebRequest to includes\Request
This has been approved as part of RFC T166010

Bug: T321882
Change-Id: I6bbdbbe6ea48cc1f50bc568bb8780fc7c5361a6f
2023-09-11 21:44:34 +01:00
Amir Sarabadani
82478bd60d Reorg: Move SiteConfiguration to includes/config/
And namespace it to MediaWiki\Config

This should be eventually deprecated and removed but this has been
blocking the reorg for long enough.

Bug: T321882
Change-Id: I7a1a073495469623f6f77e6f74b23b7b4c18033a
2023-09-11 18:43:47 +01:00
jenkins-bot
342b9d4fc9 Merge "rdbms: Introduce ReplaceQueryBuilder" 2023-09-10 23:49:54 +00:00
Timo Tijhof
e56552557f deferred: Decouple DeferredUpdates from MediaWikiServices
* Create task-specific methods with simple defaults that require no
  mocking or stubbing of any kind, as used by the pure unit tests
  where service container (and by extent, storage services) are
  disabled.

* Remove all use of global variables, LBFactory, JobQueue,
  StatsdFactory, and RequestContext.

Bug: T265749
Change-Id: If85c448d2d1b806e70f641f06263680d49c6eeec
2023-09-09 20:42:02 +01:00
Amir Sarabadani
79172aed51 rdbms: Introduce ReplaceQueryBuilder
To replace IDatabase::replace()

Bug: T335377
Change-Id: I446f7a09cfc0ee37c2e016052d452751f7333e27
2023-09-08 11:37:26 +02:00
Amir Sarabadani
2faca8519b Introduce ArchiveSelectQueryBuilder
Similar to RevisionSQB (Ifd690dc8f030)

Bug: T344971
Change-Id: Ic520bcf09f4cc95ebd6a3990cff46dec5b7cd350
2023-09-07 17:03:22 +02:00
Amir Sarabadani
049b34b41c Introduce RevisionSelectQueryBuilder
Deprecating RevisionStore::getQueryInfo() and cleaning up a lot of code

Also removing a brittle test that wasn't really testing anything.

Bug: T344971
Change-Id: Ifd690dc8f030f86e3567a717eaeb830cb6dc703b
2023-09-06 12:30:38 +02:00
Amir Sarabadani
d8e542abf9 Reorg: Move three output related classes to includes/Output/
And namesapce them:
 - StreamFile
 - OutputHandler
 - OutputPage

Bug: T321882
Change-Id: Iedf8d88c595e580f2d8f0734c92aa5c45618ba33
2023-09-05 19:36:42 +01:00
Amir Sarabadani
e5eda1c358 Schema: Drop old externallinks columns and indexes
Already dropped from production

Also dropping FixExtLinksProtocolRelative as it's not useful anymore and
it has been run in previous releases so it's not worth fixing.

Bug: T312666
Change-Id: I1dd6e704b34e685ada6e316da11243d10827d769
2023-09-05 15:32:23 +02:00
jenkins-bot
ebf31d3149 Merge "Merge CommentStoreBase into CommentStore" 2023-09-04 15:05:24 +00:00
Gergő Tisza
7a21b9a032 Add UserGroupManager::getUserPrivilegedGroups()
This moves the core part of wfGetPrivilegedGroups() out of Wikimedia
config and makes it possible to move functionality built on it into
core.

Bug: T208477
Change-Id: I6536ef2909caeed047447e8b6a25831d6f00d827
2023-09-02 11:59:25 +00:00
Alexander Vorwerk
4a4d9e2621 Merge CommentStoreBase into CommentStore
Bug: T343558
Change-Id: I74cd68b7689f750d9300141575506910878f1802
2023-09-01 12:17:14 +02:00
Derick Alangi
68ccccfe0c
searchwidgets: Remove SimpleSearchResult(Set)Widget.php
This class was hard deprecated in 1.31 and is no longer used anywhere
per else after last usage.

See: https://codesearch.wmcloud.org/search/?q=%28SimpleSearchResultSetWidget%7CSimpleSearchResultWidget%29&files=&excludeFiles=&repos=

Change-Id: I6b4ecef871248e9978ee7afc1bd27de364525552
2023-08-31 16:12:43 +01:00
jenkins-bot
f071c22a9a Merge "rdbms: Drop old class aliases" 2023-08-29 10:47:27 +00:00
Amir Sarabadani
f4e68e055f Reorg: Move Status to MediaWiki\Status\
This class is used heavily basically everywhere, moving it to Utils
wouldn't make much sense. Also with this change, we can move
StatusValue to MediaWiki\Status as well.

Bug: T321882
Depends-On: I5f89ecf27ce1471a74f31c6018806461781213c3
Change-Id: I04c1dcf5129df437589149f0f3e284974d7c98fa
2023-08-25 15:44:17 +02:00
James D. Forrester
447400b423 rdbms: Drop old class aliases
Bug: T344536
Depends-On: I565541d781caaf564ae0c1877f5cb086e3650f22
Depends-On: Ia5fdf3242f9510e4f21670f3746d9364ae2935c6
Depends-On: I6f4b158bdc3ef20a1660e66accca0ffc17104f49
Change-Id: Ia87f1be7e0e68eb7cf792cb1f5ae64ecdfa2c015
2023-08-24 15:18:13 -04:00
jenkins-bot
484a95eaa8 Merge "Reorg: Move GitInfo to utils/" 2023-08-23 16:18:29 +00:00
Derick Alangi
ae8c71feae deferred: Drop support for DeferredUpdatesManager
Revert of I7f07eddf2fc399b15db4fe9be4c792ef8eb0747b.

Bug: T265749
Change-Id: I5ab08bda82a79a518dd508383c60863d73cfdac4
2023-08-21 22:57:41 +00:00
Amir Sarabadani
cb7351809e Reorg: Move GitInfo to utils/
Bug: T321882
Change-Id: Ibd8aff5f57555d5b2a3b9cd121c8919a5a96d313
2023-08-21 18:35:32 +02:00
Amir Sarabadani
c822159cb4 Reorg: Move ExtensionInfo to utils/
Bug: T321882
Change-Id: I5d0539821ded4ed9f2698ecbc76c2678612f1c97
2023-08-19 11:15:34 +02:00
Amir Sarabadani
15a278189f Reorg: Move MWTimestamp to MediaWiki\Utils
Bug: T321882
Change-Id: I48c10343295c4eb3d9ef8037343b0070e928f040
2023-08-19 05:53:40 +02:00
Amir Sarabadani
64a3552a40 ResourceLoader: Completely remove FileCache
When I was testing for caching in RL, I realized file cache is
completely broken and mostly useless, specially for not taking into
account new query parameters and thinking basically all RL modules are
uncachable.

Let's just remove this.

Bug: T330576
Change-Id: I5b17bfc4c5543bd0e96e1099c87341ddf8fd6572
2023-08-11 13:50:41 +02:00