Commit graph

1285 commits

Author SHA1 Message Date
Petr Pchelko
928f707731 Remove old HTTP request implementations
Since 1.34 setting non-default HTTP engine
has been deprecated. It's time to remove
the old implementations. Only Guzzle is
now available.

Change-Id: I978b75827e69db02cbc027fe0b89a028adfc6820
2021-11-08 07:04:06 -08:00
James D. Forrester
20fd877da4 Drop experimental FileJournal system without deprecation
The feature was introduced in 2012 with d19f54602f (just before
the gerrit migration).

Change-Id: Ia3f59ad0ddeb1f610947b14e22b0694ff4c6ed84
2021-11-01 14:08:09 +11:00
C. Scott Ananian
06ab90f163 Add new ParserOutput::{get,set}OutputFlag() interface
This is a uniform mechanism to access a number of bespoke boolean
flags in ParserOutput.  It allows extensibility in core (by adding new
field names to ParserOutputFlags) without exposing new getter/setter
methods to Parsoid.  It replaces the ParserOutput::{get,set}Flag()
interface which (a) doesn't allow access to certain flags, and (b) is
typically called with a string rather than a constant, and (c) has a
very generic name.  (Note that Parser::setOutputFlag() already called
these "output flags".)

In the future we might unify the representation so that we store
everything in $mFlags and don't have explicit properties in
ParserOutput, but those representation details should be invisible to
the clients of this API.  (We might also use a proper enumeration
for ParserOutputFlags, when PHP supports this.)

There is some overlap with ParserOutput::{get,set}ExtensionData(), but
I've left those methods as-is because (a) they allow for non-boolean
data, unlike the *Flag() methods, and (b) it seems worthwhile to
distingush properties set by extensions from properties used by core.

Code search:
https://codesearch.wmcloud.org/search/?q=%5BOo%5Dut%28put%29%3F%28%5C%28%5C%29%29%3F-%3E%28g%7Cs%29etFlag%5C%28&i=nope&files=&excludeFiles=&repos=

Bug: T292868
Change-Id: I39bc58d207836df6f328c54be9e3330719cebbeb
2021-10-15 14:25:54 -04:00
jenkins-bot
5535b42559 Merge "Add SpecialExportGetExtraPagesHook" 2021-10-11 22:00:33 +00:00
Cindy Cicalese
37a9e60ca5 Add SpecialExportGetExtraPagesHook
This hook allows extensions to add additional pages to the list of
pages being exported. For example, if an extension creates supplemental
pages that must be exported along with a content page, this hook will
allow the extension to export the supplemental pages automatically when
the content page is exported.

Bug: T292378
Change-Id: I3b6b466b6ed32b1939674872df9e431bd6941645
2021-10-04 10:33:04 -04:00
Daimona Eaytoy
e021602204 Remove UndeleteForm::undelete hook
Bug: T290021
Change-Id: If684bd5967825591cc3e21243e23a73e06da2179
2021-09-30 22:20:23 +00:00
jenkins-bot
7833853b49 Merge "Remove the deprecated IP class" 2021-09-27 22:37:13 +00:00
Samuel Guebo
a8db81dc71 Add script to delete a user email's address
Can be used for a variety of operations
including preservation of users privacy.

Bug: T290099
Change-Id: Iad75810310c95e96b5f8998b201ed04ace5af656
2021-09-27 18:02:11 +00:00
Alexander Vorwerk
4cf2895914 Remove the deprecated IP class
Bug: T291008
Change-Id: I83a0ad6543384be71fa8d057932f8331cc0fdc4f
2021-09-26 13:58:28 +02:00
jenkins-bot
62d9c60273 Merge "Detect and monitor against multiple Parser invocation during edit requests" 2021-09-23 22:01:43 +00:00
Cindy Cicalese
eed48e402b Detect and monitor against multiple Parser invocation during edit requests
Bug: T288707
Change-Id: I0cca8f9bcf1d6e964b8b06c0c4490e83f4fb1de5
2021-09-23 16:12:40 -05:00
DannyS712
20aa78f213 Drop deprecated BeforeResetNotificationTimestamp hook
Deprecated in 1.37 and unused

Allows a bunch of cleanup for WatchedItemStore.

Bug: T271715
Change-Id: I328cf49c3e85da2069b620f8c63670d93608a784
2021-09-21 23:09:18 +00:00
jenkins-bot
76ba780e41 Merge "WikiExporter: inject services" 2021-09-16 17:04:04 +00:00
jenkins-bot
5af89e32c7 Merge "Emit deprecation warnings reading from $wgUser" 2021-09-16 15:27:44 +00:00
DannyS712
a2b20b63d7 Emit deprecation warnings reading from $wgUser
With this patch deprecation warnings will be emitted
if $wgUser is accessed or written into. The only pattern
of usage still allowed is

$oldUser = $wgUser;
$wgUser = $newUser;
// Do something
$wgUser = $oldUser;

Once there is no deprecation warnings, we know that nothing
legitimately depends on $wgUser being set, so we can safely
remove the code that's still allowed as well.

Bug: T267861
Change-Id: Ia1c42b3a32acd0e2bb9b0e93f1dc3c82640dcb22
2021-09-15 20:17:04 -07:00
jenkins-bot
79e081810d Merge "Revert "Introduce AbstractLocalizedException"" 2021-09-14 20:10:48 +00:00
TChin
e67f822bc9 Revert "Introduce AbstractLocalizedException"
This reverts commit 0d453d915a.

Reason for revert: Trying to find a better approach than an abstract class

Change-Id: I69c0ec25cb920f41cb0eb6b3ad921d7b02290581
2021-09-14 19:01:21 +00:00
Petr Pchelko
8d7201894c Drop action api token methods deprecated in 1.24
Removes deprecated API endpoints and modules for dealing with
CSRF tokens.

Note: i18n messages are removed in a followup for ease of revert.

Bug: T280806
Depends-On: Ic83f44587db119ff2e3e6d5ff33a10894e0695e7
Change-Id: I58aedec6942ac5d3c21574cb0072f00ef365098c
2021-09-13 15:22:16 +00:00
jenkins-bot
eaa6763dee Merge "Introduce AbstractLocalizedException" 2021-09-10 17:56:08 +00:00
TChin
0d453d915a Introduce AbstractLocalizedException
AbstractLocalizedException acts like a shim to ILocalizedException in preperation for refactoring

Bug: T287405
Change-Id: I01e40e82457d49487829d9a435b7a1198369ecf6
2021-09-10 10:32:57 -04:00
BrandonXLF
ff9b220f89 Follow-up 5cbb64f56: Remove unused preprocessor classes
Merge the PPD* classes that were used by the DOM preprocessor with the
hash preprocessor classes that extend them. This resolves many issues
with types/phpcs and it removes unused code left over from the DOM
preprocessor.

Bug: T278069
Bug: T204945
Change-Id: I4b160b4610e5c7ba47e9e31db252cc00d2e345df
2021-09-07 08:17:50 -07:00
Alexander Vorwerk
2fbf13812a WikiExporter: inject services
This patch injects services into WikiExporter. It also adds a
WikiExporterFactory service for creating WikiExporter instances.

Change-Id: Ib1547defea54c309865c116bc83d617c21568843
2021-09-06 10:03:37 +00:00
jenkins-bot
d28c8785e9 Merge "Rename PHP class RandomPage to SpecialRandomPage" 2021-09-04 02:01:18 +00:00
Umherirrender
5b3d3ef802 collation: Create CollationFactory service
Use ObjectFactory specs for collation classes
Avoid the language construction in the factory class,
make it a detail of the implementation of each class

Follow-Up of Ifc96f851e6091ce834dbaf0e91695c648a42169c

Bug: T286079
Change-Id: Ib581f64aec8619986fb8dd49ceee0524d59a1b84
2021-09-04 02:46:06 +02:00
Fomafix
12f9cba673 Rename PHP class RandomPage to SpecialRandomPage
This change is for consistency to the file name and to other classes.

The old class name RandomPage is kept as alias for compatibility and is
now deprecated.

Also change the letter case in the class names and file names:
* SpecialRandompage     -> SpecialRandomPage
* SpecialRandomredirect -> SpecialRandomRedirect
* SpecialRandomrootpage -> SpecialRandomRootPage

The change of the letter case of file names may cause problems on
Windows operating systems.

Change-Id: If4dd23126e0d032f42a86aff7d09414edcb1ade2
2021-09-03 09:26:06 -07:00
jenkins-bot
9ca18a249d Merge "benchmarks: Remove old bench, document perf -e instructions" 2021-08-26 09:18:49 +00:00
Tim Starling
4c5de97a9b benchmarks: Remove old bench, document perf -e instructions
<https://gerrit.wikimedia.org/r/c/mediawiki/core/+/713031>

Change-Id: I60ec9a263a66747a1a5177584d3d04692f011e49
2021-08-26 05:53:49 +00:00
jenkins-bot
c818f29a4c Merge "Add benchmark for Linker::formatComment() in preparation for refactor" 2021-08-26 03:24:38 +00:00
jenkins-bot
62a1c353bc Merge "Fix class name of InvalidateUserSessions" 2021-08-24 11:27:34 +00:00
Tim Starling
06ddb96459 Add benchmark for Linker::formatComment() in preparation for refactor
* Move data files to /data
* Add benchmarkCommentFormatter, named for the new class hierarchy.

Bug: T285917
Change-Id: Idf2529894fe63d34087d6d5ce4dd1676c89b1373
2021-08-24 13:57:53 +10:00
Tim Starling
de59286c57 benchmarks: Add benchmarkEval.php, for one-off benchmarks
* eval() outside the loop so that we're not benchmarking the compiler.
* Inner loop for better testing of short-running code.
* Three ways to specify the code to run.

Change-Id: I5906bcaa8ed2cca9d66a6195d25b0007e476ba75
2021-08-23 19:54:20 +00:00
Reedy
12e31c7d02 Fix class name of InvalidateUserSessions
Change-Id: I0c0f5c94a7ee0aa3f0aeb8b7f84857022810f17a
2021-08-23 19:03:39 +01:00
Timo Tijhof
d814a74b6f benchmarks: Remove some old and trivial benchmarks
These are mainly testing PHP rather MW code, so there isn't so much
to iterate or learn from these periodically.

As a general data point for what to pick one would presumably write a
micro bench from scratch for any of the thousands of possible things
one could think of varations for in the space of built-ins and such.

As a general benchmark for changing server or PHP configuration,
these would not be represenative either way, we'd likely use full
HTTP requests or something like the higher-level Parse and Tidy
benchmarks.

Change-Id: I4e98ae394a49c1f4a247b8d1e79a2ae5f7022d05
2021-08-23 04:15:40 +00:00
Timo Tijhof
e07a279a39 language: Add MediaWiki\Languages\Data namespace to PSR-4 autoloader
Bug: T225756
Change-Id: I7e30a5f5c9f3c36e8a9e3f1fb6ebebb3bbe727ab
2021-08-10 22:00:25 +00:00
Timo Tijhof
f3ef7f7f23 language: Autoload normalize data and remove transformUsingPairFile compat
* Turn normalize data into an autoloadable class and use the class name
  as key instead of a partial file name with a base directory.

* This protected function is not aimed at re-use in extensions,
  has no other usage known to Codesearch. Mark it internal,
  and remove the compat introduced by 31283f34bf.

* Update the now ten-year-old documentation comments that described
  this as "Temporary". The functionality and comment were introduced
  in 2010 by Tim with r60599 (ad19c032b0).
  Ref <https://bash.toolforge.org/search?p=0&q=temporary>.

* Replace the broken wikitech-l archive link with a working one,
  and describe the thread for easier future reference.

Bug: T225756
Change-Id: I004da1f25c19e1095d0917349f2ba8461f9f0715
2021-08-10 21:03:13 +00:00
jenkins-bot
b036ab73aa Merge "Move Language subclasses to includes/" 2021-08-07 21:03:03 +00:00
jdlrobson
dc15f6caa1 SkinTemplateToolboxEndHook is removed
Deprecated in 1.35, removed in 1.37
Existing skins using the hook will not necessarily
break as many of the skins run their own version of the hook.

Extensions using the hook will no longer output links
to the toolbox in the sidebar.

Bug: T256511
Change-Id: I1ba018ced266ac27f3e038ba9102ab54a669df81
2021-08-05 15:45:29 +00:00
Timo Tijhof
7c39f76452 Move Language subclasses to includes/
Depending on which namespace we want these classes to have after
T166010 they could either stay in includes/languages/ (plural) in
their own MediaWiki\Languages\-namespace dedicated to Language
subclasses, or they could go in into a subdirectory like
`includes/language/languages/` if we want to keep them in the same
top-level namespace as other Language classes and services, but in
a more nested namespace.

For now, I've made the smaller change and kept the Language subclasses
in their own directory directly under includes/, not nested further.

Bug: T225756
Change-Id: I01015424707b442853879fd50c97f00215e5c2fa
2021-08-04 23:44:46 +01:00
James D. Forrester
d11c59538a Rename DB primary position interfaces to DBPrimaryPos and MySQLPrimaryPos
And replace all uses.

Bug: T282894
Change-Id: I5222a8568255ac9fa5e2350e2264b8d2ee5eb968
2021-08-02 17:59:39 +00:00
Ammarpad
2e10b1b46c Remove SkinTemplateOutputPageBeforeExec Hook
Bug: T287773
Change-Id: Ieac3ca6a37c7991284851d6124febde0db8bb198
2021-07-30 22:31:27 +01:00
Clare Ming
91cc5389a3 Remove BaseTemplateToolbox hook
Bug: T256509
Change-Id: I9bc4e35e4062a6e77da66de46d0199be583c9d9a
2021-07-28 15:40:49 -06:00
Tim Starling
bc76602493 DBMS-specific ResultWrapper subclasses
Cleanup after the switch of Database::query() to return ResultWrapper
instead of resource.

* Soft-deprecate the IResultWrapper accessors in IDatabase.
* Move relevant DBMS-specific functionality to ResultWrapper subclasses.
  The deprecated methods in IResultWrapper become short and simple.
  ResultWrapper is now abstract (b/c break).
* Move the implementation of fieldName(), numFields() and one of the
  fieldInfo() implementations to the ResultWrapper subclass in order to
  avoid ResultWrapper::unwrap() calls.
* Make Database::doQuery() return a ResultWrapper subclass instead of
  underlying result data, so that the Database parent class does not
  need to be aware of wrapper construction.
* Hard-deprecate ResultWrapper::unwrap(),
  DatabaseMysqlBase::fieldType(), DatabasePostgres::fieldType().
* Fix the inefficient seeking method in SQLite.
* Make FakeResultWrapper extend ResultWrapper with an implementation
  similar to the SQLite one. This is possible because ResultWrapper does
  not depend on IDatabase anymore.
* Resolve fixme in DatabasePostgres: from studying the source,
  neither pg_fetch_object() nor pg_num_rows() can set an error
  retrievable with pg_last_error(). Removed unnecessary warning
  suppression.
* ResultWrapperTest didn't make sense as a unit test anymore, so I
  adapted it as an integration test against the current DBMS.

This change also means that ResultWrapper::key() always gives the
correct offset, even if Iterator methods are not being used.

Bug: T286694
Change-Id: I935835316c0bd7d3d061bd8fde9c9ce99ce756ec
2021-07-21 06:54:26 -07:00
Tim Starling
d3d8dc9965 Schema migration for revison_actor_temp table removal
Introduce a new schema migration stage in which rev_actor is used
directly and the revision_actor_temp table is no longer needed. This
becomes the new "new" stage whereas the previous situation is now
termed SCHEMA_COMPAT_TEMP.

Introduce migrateRevisionActorTemp which copies data from
revision_actor_temp to rev_actor. The code is similar to
migrateImageCommentTemp.php except that it doesn't delete from the old
table.

Partial revert of c29909e59f. That change removed direct
references to $wgActorTableSchemaMigrationStage and made queries
involving revision_actor_temp be unconditional. Such changes need to be
reverted to make the use of revision_actor_temp be conditional again.

In ActorMigrationTest, I compacted provideGetJoin() and
provideGetWhere(), removing most of the duplication between expected
values. I gave all the stages a short name, and mostly used the name in
providers.

Bug: T275246
Change-Id: I7498107dd6433ab7de5bf2e7b3fe2aa5e10e345d
2021-07-14 08:29:04 +10:00
Reedy
cd45c0fc30 Add maintenance script to invalidate a users bot passwords
Bug: T269543
Change-Id: I5848466edf45d4a2d04b52d1643c35fb68b0da08
2021-07-13 15:39:11 +01:00
jenkins-bot
313afcbd2d Merge "Make CentralIdLookup a service" 2021-06-25 13:04:05 +00:00
jenkins-bot
63518e4faa Merge "Remove the AugmentPageProps class, unused" 2021-06-25 07:06:55 +00:00
Sam Smith
3bcf989f72 hooks: Remove deprecated SkinTemplateBuildNavUrlsNav_urlsAfterPermalink hook
The SkinTemplatePreventOtherActiveTabs hook was marked as deprecated in
MediaWiki 1.35.

Bug: T284950
Change-Id: I9a4806047f8d31d59a00e02145906672b85c004c
2021-06-24 17:25:46 +01:00
Sam Smith
a11aceb214 hooks: Remove deprecated SkinTemplateTabAction hook
The SkinTemplateTabAction hook was marked as deprecated in MediaWiki
1.35.

Further, there are no SkinTemplatePreventOtherActiveTabs hook handers in
codebases that we index [0].

[0] https://codesearch.wmcloud.org/search/?q=SkinTemplateTabAction

Bug: T284950
Change-Id: I998bf8ffe6be43ad3eb38b1a9388a35aa94d7685
2021-06-24 17:25:15 +01:00
Sam Smith
99786a9492 hooks: Remove deprecated SkinTemplatePreventOtherActiveTabs hook
The SkinTemplatePreventOtherActiveTabs hook was marked as deprecated in
MediaWiki 1.35.

Further, there are no SkinTemplatePreventOtherActiveTabs hook handers in
codebases that we index [0].

[0] https://codesearch.wmcloud.org/search/?q=SkinTemplatePreventOtherActiveTabs

Bug: T284950
Change-Id: I37c5bdcc8875a23798f641161e53be3e4d073d7d
2021-06-24 17:24:39 +01:00
Petr Pchelko
ae3d709b22 Make CentralIdLookup a service
This commit is a combination of work done by Tgr in
https://gerrit.wikimedia.org/r/c/mediawiki/core/+/571411
and MaxSem in https://gerrit.wikimedia.org/r/c/mediawiki/core/+/594533
It was just easier to create a brand new patch then
rebase old ones.

Bug: T265767
Change-Id: I3930dab70846e95154d9089905c446e721ef4ee7
2021-06-24 08:37:55 -07:00