Commit graph

185 commits

Author SHA1 Message Date
James D. Forrester
a0b8b4b288 Prepare for REL1_37 cut, labelling master as 1.38-alpha
Bug: T289586
Change-Id: I5d64cad0b63c1ef98cb945bb48594a22e05f50cc
2021-09-13 19:19:42 -07:00
Thiemo Kreuz
380e8ca784 MW_VERSION also exists in 1.33.3 and 1.34.1
While this was introduced in 1.35, it got backported to 1.33.3 and
1.34.1, as far as I can tell.

Bug: T212738
Change-Id: I3fb684a0a4a7d6bbb6b8aebef17082253b781a04
2021-08-19 06:54:29 +00: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
Ammarpad
4cf2534b91 Defines.php: Drop obsolete Anti-lock flags
There's no need to continue keeping these.
Direct upgrade from 1.25 is no longer supported.

Bug: T253436
Change-Id: I4686f8caaea94c7136ab859e10a6bd834b8c89d3
2021-06-03 07:14:03 +01:00
James D. Forrester
c791a1a4a9 Prepare for REL1_36 cut, labelling master as 1.37-alpha
Bug: T279456
Change-Id: Iffb6d982e402d998343ffa00f23bb29fba1723b9
2021-04-06 23:03:22 +00:00
James D. Forrester
921343b3f9 PHPVersionCheck: Complain about known-bad versions above minimum
For now, this complains about 7.4.0 – 7.4.8, and 7.3.0 - 7.3.18.

We will back-port this to the REL1_35 live release branch with
modifications as that requires 7.3.19+ already.

Bug: T246594
Bug: T270228
Change-Id: If5c7e3c1ba9dd9f6561c1de18130ded3aadc7149
2021-02-25 15:17:21 +00:00
Tim Starling
9af96ef4c7 Improve custom folding and grouping
PHPStorm can use custom folding regions defined in either the
VisualStudio style or the NetBeans style. The VisualStudio style is more
pleasing to the eye and also works as a vim foldmarker. So get rid of
the previous vim foldmarkers, and use region/endregion.

region/endregion need to be in a single-line comment which is not a doc
comment, and the rest of the comment is used as a region heading (by
both PHPStorm and vim). So to retain Doxygen @name tags, it is
necessary to repeat the section heading, once in a @name and once in a
region. Establish a standard style for this, with a divider and three
spaces before the heading, to better set off the heading name in plain
text.

Besides being the previous vim foldmarker, @{ is also a Doxygen
grouping command. However, almost all prior usages of @{ ... @} in this
sense were broken for one reason or another. It's necessary for the @{
to be in a doc comment, and DISTRIBUTE_GROUP_DOC doesn't work if any of
the individual members in the group are separately documented.

@name alone is sufficient to create a Doxygen section when the sections
are adjacent, but if there is ungrouped content after the section, it
is necessary to use @{ ... @} to avoid having the Doxygen group run on.
So I retained, fixed or added @{ ... @} in certain cases.

I wasn't able to test the changes to the trait documentation in Doxygen
since trait syntax is not recognised and the output is badly broken.

Change-Id: I7d819fdb376c861f40bfc01aed74cd3706141b20
2020-12-23 12:41:47 +11:00
DannyS712
300283e3e9 Remove an extra space from Defines.php
Change-Id: I9432e07061b8aa48641366976f4c470831e04fd2
2020-10-18 09:04:53 +00:00
daniel
a67cad6d0f Create fallback for undefined content models.
This causes RevisionStore to use FallbackContent instances to represent
content for which no content handler is defined.

This may happen when loading revisions using a model that was defined
by an extension that has since been uninstalled.

Bug: T220594
Bug: T220793
Bug: T228921
Change-Id: I5cc9e61223ab22406091479617b077512aa6ae2d
2020-07-22 19:59:09 +02:00
James D. Forrester
2d7fe2d6c8 Prepare for REL1_35 cut, labelling master as 1.36-alpha
Change-Id: I91fc77a436468fa9a549383c1dac701cc5f5b6fe
2020-07-14 06:52:04 +01:00
Petr Pchelko
cd6b72ecd7 Move autopromote groups logic into UserGroupManager
Bug: T252621
Change-Id: Ic51119cd01771ab1b68294fa5dfacb8034e33b6b
2020-06-11 22:13:48 +00:00
Ed Sanders
387f3c2a20 Fix typo: 'the the' -> 'the'
Change-Id: Ia57fb787b43c8e49da4f33a65c265cbc37ee1f77
2020-05-03 20:45:36 +01:00
Timo Tijhof
a5d5ea82ca Provide MW_VERSION and deprecate fake global $wgVersion
$wgVersion is not a configuration variable, it should never be
changed at run-time.

While we've gone in the route of class constants for most constants,
this one will not benefit from class-autoloading since it needs to
be present from the very beginning.

MW_VERSION is named similarly as PHP_VERSION, and $wgVersion is
now soft-deprecated.

Bug: T212738
Change-Id: I04628de4152dd5c72646813e08ff35e422e265a4
2020-02-25 01:55:21 +00:00
Umherirrender
2664eeb632 Clean up spacing of doc comments
Align the doc stars and normalize start and end tokens

Change-Id: Ib0d92e128e7b882bb5b838bd00c74fc16ef14303
2019-08-05 22:29:50 +00:00
James D. Forrester
f70d270877 Drop NS_IMAGE and NS_IMAGE_TALK, deprecated in 1.14
Change-Id: Id980c3d9bbadae219181b07f22aa58cbc2efbdc6
2019-07-15 20:09:58 +00:00
daniel
fdc3e9f952 Add support for xml dump schema 0.11
Bug: T174031
Change-Id: I2717019ea7efe36694bd2b2fba4dc2952a987cfc
2019-06-27 21:56:01 +00:00
James D. Forrester
0653e575fc Defines: Drop DB_SLAVE, deprecated since 1.28
Change-Id: I9b48524bfa071c21e03c50e9e8231e4661917c78
2019-06-14 06:44:38 -04:00
daniel
45f3912bf1 Make the XML dump schema version configurable.
Bug: T174031
Change-Id: I979b6c8f0a72bc1f5ecce1d499d3fdfa0f671588
2019-03-21 12:43:32 +01:00
Thiemo Kreuz
22f5babf4d Update @deprecated comment for the DB_SLAVE constant
I keep searching for the proper replacement for this deprecated
constant. It's much easier to find when the @deprecated comment
just mentions it.

Change-Id: I199b876ecfb6e146848b395bc7bfad80742f000d
2019-02-12 13:05:03 +01:00
Fomafix
1472f02b36 Phabricator: Use Tddddd instead of Bug ddddd in comments
Change-Id: Ic9fe03cab270bd6be738af346164ad5d31a0d780
2018-10-04 09:15:02 +02:00
daniel
33258e04d1 Introduce new schema flags and use them in RevisionStore.
NOTE: this changes the numeric values of the MIGRATION_XXX constants!
Order is preserved.

Bug: T197619
Change-Id: I16db7dd5799ab98c1cb12e7cd1e0b2da83b366fc
2018-07-02 17:20:14 +02:00
Kunal Mehta
88ea69f2f7 Remove deprecated utfnormal back-compat
Change-Id: Id8f497d0bbaab8282057c9d271a7c9b1e77d1a3f
2018-05-27 20:35:27 -07:00
Chad Horohoe
5c93fabafd Drop XCache support
It was never super popular anyway, APC was always the best option.
The project has no plans to move to PHP7, so it's quickly reaching
its end of life. Oh, and Fedora dropped it from their repos 2 years
ago.

Change-Id: Ia3257e86a6323d8943f04a5c05c72c0bd4c4b0a9
2018-02-07 13:45:40 -08:00
Kunal Mehta
92c3b2404e Document DB_SLAVE as deprecated
Change-Id: I50c127b7857b6dbccfd09014d72a130071870fab
2017-09-06 18:09:42 -07:00
Brad Jorsch
1acb816a47 Add constants for schema migration feature flags
A general behavior is to progress through four stages:
* Access only the old schema (until the schema change is deployed to the
  databases)
* Read and write both schemas (for easy rollback while testing)
* Write only the new, read both (while a maintenance script runs to
  migrate existing old schema to the new)
* Access only the new schema (then we can drop the old)

This adds constants for use with feature flags controlling these stages.

Bug: T166732
Bug: T167246
Change-Id: I0fb637ca8c10ec91d6eda706d9d8a5ce9be41a06
2017-06-07 09:38:46 -04:00
Aaron Schulz
488a647831 Move IDatabase/IMaintainableDatabase to Rdbms namespace
Change-Id: If7e8a8ff574661fd827de8bcec11d2c39a687300
2017-03-28 15:32:38 -07:00
Kunal Mehta
a57b64436c Use wikimedia/timestamp
Bug: T100924
Depends-On: I0a067367cda6885fa45631ed7c18799d653dc9bf
Change-Id: I69ba64e364df8af089c1c918cdf32f99454e693a
2017-02-28 21:15:38 -08:00
Timo Tijhof
34060273e7 Move libs/time/defines.php inclusion from GlobalFunctions to Defines.php
* Verified none of these constants depend on each other.
* Move them to the top of Defines.php for consistency.

Change-Id: I19c77e706d69bff513e4abafd0300207de0dbb1d
2017-01-13 01:17:32 +00:00
Aaron Schulz
0d87d67d61 Move MimeMagic code to libs/mime/MimeAnalyzer.php
* The later resides in /libs with related files.
* Explose MimeAnalyzer as a service.
* Keep MimeMagic::singleton() as a b/c alias.
* MimeMagic::applyDefaultConfig() will bootstrap the service
  with all of the old config, extension hook handler, and
  detector command shell-out behavior.

Change-Id: Ie2695a52e7a3bcfda9f7fa83659a9ff31b372bc3
2016-10-15 00:05:16 +00:00
Kunal Mehta
bb0b1f60be Add @deprecated annotations to NS_IMAGE and NS_IMAGE_TALK
Hopefully this will discourage people from using them in new code.

Change-Id: I165a19406dfc0bcc471252e416480fa3af92d969
2016-09-27 20:40:17 -07:00
Aaron Schulz
ff38b54d61 Move LIST_ constaints to IDatabase class constants
Leave aliases in Defines.php for backwards compatibility.

Change-Id: I88b45e0943cbfe97d863c2e0a4911fc0f81e5bb5
2016-09-19 07:59:21 +00:00
Aaron Schulz
2547821e7f Move database constants to their own file
Change-Id: I47e067687bbce7b89e02a0e732ee27368beddb61
2016-09-16 00:31:50 +00:00
Aaron Schulz
1a535a1405 Remove ancient DB_READ/DB_WRITE constants
Change-Id: I23f4c52312317e41710bc12eefe6e821f9b9e9f3
2016-09-07 09:50:25 -07:00
Aaron Schulz
950cf6016c Rename DB_SLAVE constant to DB_REPLICA
This is more consistent with LoadBalancer, modern, and inclusive
of master/master mysql, NDB cluster, and MariaDB galera cluster.

The old constant is an alias now.

Change-Id: I0b37299ecb439cc446ffbe8c341365d1eef45849
2016-09-05 22:55:53 -07:00
Aaron Schulz
16266edff3 Change "slave" => "replica DB" in /includes
Change-Id: Icb716219c9335ff8fa447b1733d04b71d9712bf9
2016-09-05 21:01:01 +00:00
Aaron Schulz
ab64cd7bd4 Flag internal page retrieve/save cycles with EDIT_INTERNAL
This is used to avoid edit stash checks and stats noise.

Bug: T136678
Change-Id: I6158b8b218240ef3875f2d1d2e8ca3bc2f69f980
2016-06-07 18:29:57 -07:00
umherirrender
72632115d6 Fix various phpcs error from last security patches
Found by tests:
https://integration.wikimedia.org/ci/job/mediawiki-core-phpcs-trusty/1069/console

Breaking merges

Change-Id: If01b94705cd7b939ac380053730b1b602c838a8e
2016-05-20 20:20:36 +02:00
Darian Anthony Patrick
43f70b84b3 Enforce upper limit on invocations of wfShellExec()
Enforce an upper limit of 100,000 bytes on commands executed via
wfShellExec() to avoid HHVM crash resulting from process spawned with
argument exceeding MAX_ARG_STRLEN, as defined in binfmts.h

Bug: T129506

Signed-off-by: Chad Horohoe <chadh@wikimedia.org>
2016-05-20 09:49:02 -07:00
umherirrender
64f304b795 Add comment to unused EDIT_DEFER_UPDATES in Defines.php
Follows I2bc47b82635e0a24b1df5d502ba66f6de737697e

Change-Id: If08e0d355abd4e6ea2f9efe333867b9e88bd08cf
2015-10-31 10:06:29 +00:00
addshore
2fb2a3f14b Introduce CategoryMembershipChange
This is split from:
I03516bb34144d95e5f25c46ae98ab70ce699b31b

Change-Id: I27539d25ef3e81cf991657dffc0a62b9719d21d8
2015-09-29 23:59:34 +01:00
Vivek Ghaisas
c54766586a Fix issues identified by SpaceBeforeSingleLineComment sniff
Change-Id: I048ccb1fa260e4b7152ca5f09b053defdd72d8f9
2015-09-26 23:06:52 +00:00
CSteipp
e412ff5ecc Revert "Enable users to watch category membership changes"
This reverts commit f6879ea16e.

Bug: T109638
Change-Id: I770d8d33a4cff3829bdea9a4df24de209cbe691b
2015-08-20 10:35:56 -07:00
Kai_WMDE
f6879ea16e Enable users to watch category membership changes
Bug: T9148
Change-Id: I5a89d8f19804b1120f4c755d834e2da6ca12ceae
2015-08-13 17:58:06 +02:00
Ori Livneh
8338476b8e Create a subdirectory for compatibility stubs
Instead of littering includes/ with stub back-compat aliases, house such
classes in includes/compat/.

Change-Id: I4c1b83e35c8d6c18777a4a3e17d81023915cfb7f
2015-06-29 19:27:13 +00:00
Chad Horohoe
c5b6003d71 Remove MW_SPECIALPAGE_VERSION. Unused anywhere.
If we needed such a constant nowadays we'd probably
stick it on SpecialPage itself rather than a global
define.

Change-Id: I8a62c4af3f6185ddd651cbf0ff86ecf39ca44123
2015-04-15 09:26:01 -07:00
jenkins-bot
a2dd7b0391 Merge "Remove EditFilterMerged detection define" 2015-03-19 17:11:46 +00:00
Chad Horohoe
717473d834 Remove EditFilterMerged detection define
We've supported this hook since 1.12 days and it's actually
deprecated by EditFilterMergedContent. No extensions in Git
or SVN check for this define anymore.

Change-Id: If638094a2fb2f047a3b40a24e11e2c0e2fa9c1b9
2015-03-18 16:38:01 -07:00
Chad Horohoe
37974f2be3 Remove unused global define RLH_FOR_UPDATE
Change-Id: I8f6df920e70ae1d94e6d9fe32cbaf468d31ffdc0
2015-03-18 16:32:10 -07:00
Kunal Mehta
c8900f30af Move includes/normal to includes/libs/normal
Change-Id: Ib530ad9dbe1d3a33dc53ef8b9620f61d4e1a2d62
2015-01-29 00:00:35 +00:00
Tim Starling
09a5febb7b API edit: allow ConfirmEdit to use the merged parse
ConfirmEdit was tripling the amount of time it took to save a typical
page via the API, since it was assuming that the APIEditBeforeSave hook
was giving unmerged wikitext, requiring a full parse of the content
before and after the edit in order to check the addurl trigger.
Apparently nobody bothered to update it after Ia59fb6bb.

APIEditBeforeSave is unusable anyway, because it is given the serialized
content, without any information about the content model. It really
needs the Content object in order to do it properly. So instead, adapt
EditFilterMergedContent for the purpose. Incidentally, that avoids the
inelegant defined('MW_API') check in ConfirmEdit's
EditFilterMergedContent handler, since both API and normal edits are
handled by EditFilterMergedContent in the same way.

Unfortunately the interpretation of the 'value' member in the Status
object passed to EditFilterMergedContent is not extensible, being an
integer instead of an associative array. So we add a custom member in
order to get the result array back down the stack.

Another obstacle to this design was the lack of an EditPage object
passed to EditFilterMergedContent. ConfirmEdit was previously directly
calling EditPage::showEditForm() with a $formCallback which outputs the
necessary HTML. Instead, I hacked up runPostMergeFilters() a bit, to
allow the hook to request that the edit page be shown again even if
hookError is not set. Then a new EditPage::showEditForm:fields hook does
the necessary HTML output, instead of $formCallback.

Marked $formCallback as deprecated, since I think it is now unused.

Change-Id: I4b4270dd868a643512d4717927858b6ef0556d8a
2014-12-05 17:10:20 +11:00