| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|\ |
|
| |
| |
| |
| | |
Change-Id: I3389fc4464bfb6fd7d06130f16b9eefa5d1d0594
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It was deprecated in 1.31, It was a failed experiment, intended to
improve performance, but it never worked and makes the code
much more complex. I also removed two LinkHolderArray helpers which were
accidentally not marked deprecated -- codesearch confirms that they are
not called by anything.
Change-Id: I74754265dde388b590f0b4c995cb4a35a1318299
|
|/
|
|
|
|
|
|
|
|
|
|
| |
These are almost only doc changes, with two exceptions:
1-In LinkHolderArray, int-alike array keys are now cast to int, to be uniform with what we do in other code paths
2-In ExtensionRegistration, changed a line to throw an Exception
immediately, instead of an ExtensionDependencyError. This is because the
latter takes an array with msg and type, but we were passing it a plain
string (and in fact the code was bugged).
Bug: T231636
Change-Id: I8b0ef50d279c2a87490dde6a467a4e22c0710afd
|
|
|
|
|
|
|
|
|
|
|
|
| |
All of these suppression prevent the detection of many common mistakes,
and could easily prevent things like T231488. Especially if there are
few issues of a given type, it's way better to suppress them inline,
instead of disabling them for the whole core.
This patch only touches the one with a lower count (although those
counts may be out of date).
Bug: T231636
Change-Id: Ica50297ec7c71a81ba2204f9763499da925067bd
|
|
|
|
|
|
|
|
|
|
| |
This code is functionally identical, but less error prone (not so easy
to forget or mix these numerical indexes).
This patch happens to touch the Parser, which might be a bit scary. We
can remove this file from this patch if you prefer.
Change-Id: I8cbe3a9a6725d1c42b86e67678c1af15fbc5961a
|
|
|
|
|
| |
Bug: T216348
Change-Id: I0adafdc680dae0e930f38f08fe926645c57be06c
|
|
|
|
|
| |
Bug: T200246
Change-Id: Ic954f7752fda8e2a1f34a64b85cce27774014666
|
|
|
|
|
|
|
|
|
|
|
|
| |
I think it's reasonable for link "colours" to depend on the page on
which they are shown. It seems similar to how self-links are handled.
The $colours variable is not cached, so title-specific link colours
will not "leak" to other titles.
Used in ProofreadPage in Ic910c2c33a6f1f8a70d9a122fbd2128428f29bd5.
Bug: T199288
Change-Id: I7378102a3e06544e9e695b255982c9bb0cfbf3a2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Replacer classes were added in 1.9, when MediaWiki supported PHP 5.0
and 5.1. They were designed to be used with preg_replace_callback() and
StringUtils::delimiterReplaceCallback(). Now that Closures exist in PHP
5.3 and newer, there is no need to define a class for this purpose.
All existing Replacer subclasses are simple enough that their few uses
can easily be replaced with Closures, without making the code harder to
understand. In fact, the code probably becomes easier to understand, as
what each match is replaced with becomes more obvious -- no need to
refer to a separate class.
MediaWiki code search finds no uses in extensions. Thus, these classes
are hard deprecated immediately.
Change-Id: I441c21689909fb06a1ea07a305259eeb82cb2345
|
|
|
|
| |
Change-Id: Ie0e5c4ef0fe6ec896378bb2433af0898655dd907
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Find: /isset\(\s*([^()]+?)\s*\)\s*\?\s*\1\s*:\s*/
Replace with: '\1 ?? '
(Everywhere except includes/PHPVersionCheck.php)
(Then, manually fix some line length and indentation issues)
Then manually reviewed the replacements for cases where confusing
operator precedence would result in incorrect results
(fixing those in I478db046a1cc162c6767003ce45c9b56270f3372).
Change-Id: I33b421c8cb11cdd4ce896488c9ff5313f03a38cf
|
|
|
|
|
| |
Bug: T180159
Change-Id: Ic9dbb8ef3948fe751d16c3963769b616b5db2fc7
|
|
|
|
| |
Change-Id: I81e68310abcbc59964b22e0e74842d509f6b1fb9
|
|
|
|
|
|
|
|
|
| |
Use of &$this doesn't work in PHP 7.1. For callbacks to methods like
array_map() it's completely unnecessary, while for hooks we still need
to pass a reference and so we need to copy $this into a local variable.
Bug: T153505
Change-Id: I8bbb26e248cd6f213fd0e7460d6d6935a3f9e468
|
|
|
|
|
|
|
|
| |
It looks like there is something missing after the last statement
Also remove some other empty lines at begin of functions, ifs or loops
while at these files
Change-Id: Ib00b5cfd31ca4dcd0c32ce33754d3c80bae70641
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
* Rename to getLinkClasses() since it's not really returning colours,
but CSS classes.
* Dependency inject LinkCache into LinkRenderer
* Update all callers of Linker::getLinkColour(), and mark it as
deprecated (no other uses in Gerrit)
* Update a bunch of tests for new dependency
Change-Id: Id178e2dcc60b833ce2dbad4920896b93cabba1bf
|
|
|
|
|
|
|
| |
Replaces usage of Linker::link() in Parser and LinkHolderArray with the
new LinkRenderer.
Change-Id: Icb796ef08d70926728732ab5468940c09ba5eaf8
|
|
|
|
| |
Change-Id: Ic65b20cc2aa41f9b481e280918fe95c57da53221
|
|
|
|
| |
Change-Id: I587a34459d4bcc1bae33631561fa6d4a91dfa4a5
|
|
|
|
|
|
|
| |
The entire query could be replaced with LinkBatch, but that will require
further refactoring.
Change-Id: I87cf2a391486e36e73a13baac65d243fc9196b5c
|
|
|
|
|
|
|
|
|
|
| |
Per wikitech-l consensus:
https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html
Notes:
* Disabled CallTimePassByReference due to false positives (T127163)
Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the Title object isn't the title of the current viewed WikiPage, the page_lang
field of the database isn't requested. This results in the problem, that
Title::getPageLanguage() always returns the default content language, even if
the page language is different (changed with Special:PageLanguage, if
wgPageLanguageUseDB is true). That is problematic for the Translate extension,
which relies on the correct page language.
This change makes sure, that getPageLanguage() always return the correct page
language. If the page language isn't loaded already, Title::getPageLanguage()
now does a database lookup (if $wgPageLanguageUseDB is true) to get the correct
page language. It will use LinkCache for the page_lang field.
Bug: T121666
Change-Id: I0ae5ea39f7a124ed427ca5dfb26c1a116b27a94e
|
|
|
|
|
|
|
|
|
|
| |
Linker::linkAttribs() needs the stub threshold to determine the classes
in some cases. For the code path from Parser → LinkHolderArray → Linker,
we can pass down the correct threshold from ParserOptions instead of
pulling a potentially-different threshold from $wgUser.
Bug: T124367
Change-Id: I16b9d6c3044ae60d5a7fd340569c019ffc4b2a55
|
|
|
|
|
|
|
|
|
| |
Fix some "Assignment expression not allowed"
Found by tests:
https://integration.wikimedia.org/ci/job/mediawiki-core-phpcs/2736/consoleFull
Change-Id: Ibfc62b0aaa5c7fa63081edea3ef2b4d0dc984f85
|
|
|
|
| |
Change-Id: I048ccb1fa260e4b7152ca5f09b053defdd72d8f9
|
|
|
|
|
|
| |
An if body must not begin with an empty line
Change-Id: I62b058be337fcc85a120fcd3dadce564db59a271
|
|
|
|
|
|
| |
Mostly Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines
Change-Id: I678b2f0902f11cd1dfa1611b9da24e7237df9122
|
|
|
|
| |
Change-Id: I31c81c78715048004fc8fca0f27d09c1fa71c118
|
|
|
|
|
|
|
|
|
|
|
| |
Xhprof generates this data now. Custom profiling of various
sub-function units are kept.
Calls to profiler represented about 3% of page execution
time on Special:BlankPage (1.5% in/out); after this change
it's down to about 0.98% of page execution time.
Change-Id: Id9a1dc9d8f80bbd52e42226b724a1e1213d07af7
|
|
|
|
|
|
| |
* This avoids the overhead of an extra function call
Change-Id: I8ee996f237fd111873ab51965bded3d91e61e4dd
|
|
|
|
|
|
|
|
| |
Return value not used in any code in our repo
Removes FIXME too
Change-Id: Ia2ec35099f0b54ea39c2f6b9371e94c3034bddb0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also don't cast $model to int in LinkCache::addGoodLinkObj(); content
model IDs are non-numeric strings, not integers, so that field was
always populated with the value 0. Because 0 is a falsy value, this
caused subsequent calls to Title::getContentModel() to return the
default model rather than the correct one.
Also (hopefully) fixed every single query that could cause a
LinkCache entry to be added without the content model.
Bug: 69789
Change-Id: I94f06baf406afa538cd2b10139598442f9fc6759
|
|
|
|
|
|
|
|
| |
This fixes all issues except for:
- class names
- line length
Change-Id: Ie91b010d5b3eec49d3b80b6e93b125a901ef43c6
|
|
|
|
|
|
|
|
|
|
| |
- Swap "$variable type" to "type $variable"
- Added missing types
- Fixed spacing inside docs
- Makes beginning of @param/@return/@var/@throws in capital
- Changed some types to match the more common spelling
Change-Id: I8ebfbcea0e2ae2670553822acedde49c1aa7e98d
|
|\ |
|
| |
| |
| |
| | |
Change-Id: If534308040201f0c4f9d315fae508c7dd3f53ee9
|
|/
|
|
| |
Change-Id: I5e429baab774a790b3558732f9c87637adfbe4ce
|
|
|
|
|
|
|
|
|
| |
See https://bugzilla.wikimedia.org/65375#c4
This reverts commit f359cdf61462782743a87943938ef4cce78b2647.
Bug: 65375
Change-Id: I12a60b5cc52a07a6deabcbf47c7c99cd2faac3c3
|
|
|
|
| |
Change-Id: I16dd3a792cc83f8c80b3652d42c055730f6d177a
|
|
|
|
|
|
|
| |
Remaining are the classes containing underscores and possibly a few other
issues that will be addressed soonish.
Change-Id: Icf56374c71afc134420ebbcfecf12dcb29dc9564
|
|
|
|
| |
Change-Id: If03a9bd5eb83be4d15f54e73f49f42540fb7d5fc
|
|
|
|
|
|
|
|
|
| |
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.
Change-Id: I49f8f48b521878de7abd9cc40efdeff6cf9a37e0
|
|
|
|
|
|
| |
Makes checks against the fragment easier to read and all the same.
At the moment some using strval, some use type safe comparsion.
Change-Id: I27d9c3e40e6de6800f4488de167cf06e83c88ce6
|
|
|
|
|
|
|
|
| |
Contains var_dump(), self-merged non-trivial code.
This reverts commit 96b2c66e242954d8591e7b8ca7b9d6a2a4e1074a.
Change-Id: Ie630466ef50e6bcdabf01daff28c283c764aae35
|
|
|
|
|
|
|
| |
Also fix styling for the list of extensions.
Bug: 43817
Change-Id: I5335225683ec8f1c163bb67f478787ebc52ee3a9
|
|
|
|
|
|
|
|
|
|
|
| |
The Line continuation Coding conventions prefers the closing parenthesis
on the same line than the beginning curly braces. This is done for ifs
and functions.
Also move some boolean operator from the end of a line to the beginning
and changed some indentation to make the condition hopefully better
readable.
Change-Id: Id0437b06bde86eb5a75bc59eefa19e7edb624426
|
|
|
|
| |
Change-Id: I82994ba8f92322b420b4a3fed40d5d579b06a6d2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The parser unnecessarily made individual checks for existence of
pages that were neither in LinkCache nor linked only with a fragment.
A Title::isKnown() call in Parser::replaceInternalLinks2() (added in
bca8b8ad7d2f) caused this.
Title::isKnown() was used to avoid treating a link to a distinct page
as a self-link even when the title happened to match one of the variants
returned by Language::autoConvertToAllVariants(). This change fixes
the bug by moving the problematic portion of the self-link check into
LinkHolderArray::doVariants().
Change-Id: I586e11e8b47308980ea04087ebc4246c397a8f53
|