Commit graph

166 commits

Author SHA1 Message Date
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
jenkins-bot
0b8f48c535 Merge "Use Parser::SFH_NO_HASH/SFH_OBJECT_ARGS class const" 2014-11-27 05:55:07 +00:00
umherirrender
af9e88cf23 Add hint to OT_* defines
The Parser consts should be used instead of the global defines

Change-Id: I7adb19bbc651fca3535737ab63e73636217d0746
2014-11-18 21:29:32 +01:00
umherirrender
91f26d50ee Use Parser::SFH_NO_HASH/SFH_OBJECT_ARGS class const
Instead of the global const
Add hint to Defines, that they should not be used.

Change-Id: I3e1dcf46fe18a97a05e3406c209815adb7e0e083
2014-11-18 21:19:22 +01:00
umherirrender
d3da4ab7c2 Add comment to AFL_* constants in Defines.php
$wgAntiLockFlags was removed in
Ia709ccdc9addc55c99cbff21a5ff3009b5fbb53c

Change-Id: Ia8685a84b72abb1a86b70f73c3f1e9f0c3e52a8f
2014-10-04 02:40:08 +00:00
Kunal Mehta
d2a82fcb60 Add JSONContent and handler from EventLogging
As was discussed at the architecture summit, a basic JSON content
class which handles validation and basic display. Not intended to
be used directly, but for extensions to subclass.

Co-Authored-By: addshore <addshorewiki@gmail.com>
Change-Id: Ifcde9bcd0efcf15a3ab692dd2a0a3038559e0254
2014-08-08 23:31:26 +00:00
Aaron Schulz
26f386ae55 Removed old DB_LAST cruft
Change-Id: I5517c43389182e61e4a969ed9ca71dae2388a5d0
2014-06-25 16:12:36 -07:00
JuneHyeon Bae
17ebbe492c Remove obsolete RC_MOVE and RC_MOVE_OVER_REDIRECT rc types
RC_MOVE and RC_MOVE_OVER_REDIRECT are obsolete, since at least 2006.
So it is considered safe to remove.

Bug: 63755
Change-Id: I0f17c4d164585a48fb9f0d40b90a7d3b975c7ab8
2014-06-11 02:44:48 +00:00
Chad Horohoe
99e13e66a3 Remove commented defines
Change-Id: I0447646127e05d80c87db5b88942105d41d802bd
2014-01-27 21:30:52 +00:00
Chad Horohoe
736820f8f2 Remove DBABagOStuff
Isn't useful outside of testing as the comments state, but it's
barely even useful for that. People who are testing the cache
code can use CACHE_DB if CACHE_MEMCACHED is too hard.

Change-Id: Ief0aa148376957fdd844c8bb585a133b854a012c
2014-01-16 11:43:59 -08:00
umherirrender
286d872599 Break long lines and remove some spaces in Defines.php
Change-Id: I3963cb55b8bac6abe02ef5ebc8327fe1c1793d0d
2013-12-07 21:48:46 +01:00
Reedy
612afc2533 Remove Parser_LinkHooks and CoreLinkFunctions classes
Bug: 45371
Change-Id: I06f890153df0cb8f4fb84a73a06a6f5f4817cf3b
2013-05-02 16:43:39 +01:00
umherirrender
15abcf71ca Added/Removed spaces around string concatenation
And added/removed spaces around some other tokens,
like +, -, *, /, <, >, =, !

Fixed windows newline style

Change-Id: I0b9c8c408f3f6bfc0d685a074d7ec468fb848fc8
2013-04-13 13:36:24 +02:00
umherirrender
6c278b6d7e fix some spacing
* Removed spaces around array index
* Removed double spaces or added spaces to begin or end of function
  calls, method signature, conditions or foreachs
* Added braces to one-line ifs
* Changed multi line conditions to one line conditions
* Realigned some arrays

Change-Id: Ia04d2a99d663b07101013c2d53b3b2e872fd9cc3
2013-03-25 22:22:46 +00:00
Yuri Astrakhan
9506e3d812 Spellchecked /includes directory
* 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
2013-03-13 03:42:41 -04:00
umherirrender
d63121016d fix some spacing
Added/removed spaces around logical/arithmetic operator
Reduced multiple empty lines to one empty line
Removed wrong tabs before comments at end of line
Removed too many spaces in assigments

Change-Id: I2bba4e72f9b5f88c53324d7b70e6042f1aad8f6b
2013-03-07 17:53:21 +01:00
Chad Horohoe
6f4448dd71 Remove DB2 support
Change-Id: I9b294a213a4000f503c0010d88757db6dda927c0
2013-02-25 13:47:03 -08:00
jenkins-bot
62a6a48bd4 Merge "Added deprecation comment to constant that when used throws deprecation exception" 2013-02-09 21:47:23 +00:00
Antoine Musso
7006e1df93 style: fix up commas in function arguments
Fix up spaces in our function calls, we do not want spaces before a
comma and try to avoid multiple commas whenever possible.

Errors:

* No space found after comma in function call
* Space found before comma in function call

Change-Id: I51aec02016f742422fa60b92ad35ba3f0ef59ba3
2013-02-06 19:30:39 +01:00
jeroendedauw
501112da1b Added deprecation comment to constant that when used throws deprecation exception
Change-Id: I4513ccad399d4367c76d823f01f33c52ab9a8bbc
2013-01-28 16:19:24 +01:00