| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
| |
Automatically refactors wg prefixed globals to use MediaWikiServices config using Rector. Doesn't include files that set globals or files that fail CI.
Rector Gist: https://gist.github.com/tchin25/7cc54f6d23aedef010b22e4dfbead228
* This patch uses a modified source code rector library for our specific use case and the rector will have different effects without it.
A writeup for future reference is here: https://meta.wikimedia.org/wiki/User:TChin_(WMF)/Using_Rector_On_MediaWiki
Change-Id: I1a691f01cd82e60bf41207d32501edb4b9835e37
|
|
|
|
|
|
|
| |
This allows the backend to do whatever it can to ensure atomicity, and
is also easier to read, since the intent is obvious.
Change-Id: Ibbfecd92a2c6d9a5997ca37ea101e068bd1e8202
|
|
|
|
|
|
|
| |
Some minor updates I collected in my local dev environment the
past months.
Change-Id: I30d5339bc262d54ba76e2860a3a3e9e5f002fdc3
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
If you want to normalize a page title without following the redirect,
you basically have to re-invent the wheel. Let's DRY it this way.
Bug: T278962
Change-Id: I61080ff0f35199784f4629f61272fb27bac787aa
|
|/
|
|
|
|
|
|
|
|
|
|
|
| |
… including PHPDoc tags like `@return <type> $variableName`.
A return value doesn't have a variable name. I can see that
some people do this intentionally, repeating the variable
name that was used in the final `return $var;` at the end
of a method. This can indeed be helpful. I leave a lot of
these untouched and removed them only when it's obviously
wrong, or does not provide any additional information in
addition to what the code already says.
Change-Id: Ia18cd9f25ef658b08ad25b97a744897e2a8deffc
|
|
|
|
|
|
| |
Auto-generated with rector.
Change-Id: I4f27e10cf029bb067b7bc57d82f7a64e21ea8d42
|
|
|
|
|
|
| |
Just an auto-replace from codesniffer for now.
Change-Id: I5240dc9ac5929d291b0ef1c743ea2bfd3f428266
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is micro-optimization of closure code to avoid binding the closure
to $this where it is not needed.
Created by I25a17fb22b6b669e817317a0f45051ae9c608208
Change-Id: I0ffc6200f6c6693d78a3151cb8cea7dce7c21653
|
|/
|
|
|
|
|
|
|
|
|
| |
This patch touches all uncontroversial (I hope) places where a chain
of isset(), array_key_exist() and the ternary ?: operator can be
replaced with the much shorter ?? feature from PHP 7.
?? does the same. It checks if the element before the ?? is set and
not null. When this check fails, the element after the ?? is used.
Change-Id: Id612e2782ae928164b26b6f0de676c6c7d8302f3
|
|
|
|
|
|
|
|
|
| |
This reverts commit a4c69bde130c6109086d555492adc1378b1ca29b.
Reason for revert: Needs a bit more thinking about
Bug: T268847
Change-Id: I82a7bb2a4ef15adc65717d5ba173c8f3cfb0644c
|
|
|
|
|
| |
Bug: T268847
Change-Id: I56684ce7b39aaebe1ae76811b833bc9183bc359b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As per https://www.php.net/manual/en/function.libxml-disable-entity-loader.php
this is technically unnecessary.
>However, as of libxml 2.9.0 entity substitution is disabled by default,
>so there is no need to disable the loading of external entities.
See also https://github.com/php/php-src/pull/5867
>Since the release of libxml 2.9.0 in 2012 external entity loading is
>disabled in libxml by default. This means that using
>libxml_disable_entity_loader() is no longer needed.
Hopefully helps prevent false positive reports from security scanning tools.
Change-Id: I8a09d62a9920fd0bf4a388baa5544a02323bb541
|
|
|
|
| |
Change-Id: I0ccda3d1de29b1044f74ef0972949eb8fbcb707d
|
|
|
|
| |
Change-Id: I5138f6043effab813aacb7b0b408428d3e21d23d
|
|
|
|
|
|
|
| |
Update references from .txt to .md when files have moved, a few other
tweaks, no changes to code.
Change-Id: I0bfd38c47b9fb0fc11ae98a0a674af66fb4c5a84
|
|
|
|
| |
Change-Id: Iad3375b141b1d87c890baec6ecd16ed92f93e699
|
|
|
|
|
| |
Bug: T241356
Change-Id: I252904b6b4c31a0ac42cbfbe7875a23c727150c1
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
This was pointed out in Ia8443e575c22f47a6d8c63038f4e7ac36815fc27. The
method checks if $url is false, but that's never the case because
getLinkPath returns string|null.
Change-Id: I7850bff928f861d796879301ba0b4e575919407e
|
|/
|
|
|
|
| |
Bug: T231636
Depends-On: I5de4f8f32a47c3f41c990ffe2ebd091fc23d1a58
Change-Id: I34d65fe3ff1916f2af675f0b1f19641b0cdfadc0
|
|
|
|
|
|
|
|
|
| |
These were discovered by setting `null_casts_as_any_type` to true in
phan, and filtering by `PhanTypeMismatchReturnNullable`. Of course there
are others, some of which are false positives, but we cannot suppress
them now (or the UnusedSuppressionPlugin will complain).
Change-Id: Ia8443e575c22f47a6d8c63038f4e7ac36815fc27
|
|
|
|
|
|
| |
Bug: T231636
Depends-On: I78354bf5f0c831108c8f606e50c87cf6bc00d8bd
Change-Id: I58e67c2b38389df874438deada4239510d21654f
|
|
|
|
|
|
|
| |
This is the preferred method as it enforces read-only mode for DB_REPLICA
and handles LoadBalancer::reuseConnection() calls automatically.
Change-Id: Iab9439ba8e0810fa14c302661ed7a3534f6bfc0d
|
|
|
|
| |
Change-Id: I08531ccc6db046114f3535cfe6c108936dfff0d0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This seems to have been intended as optimization for SiteStore,
but was never used as far as I can tell. Instead, SiteStore is
already cached via LocalServerCache (APC).
Keep the FileBasedSiteLookup class for one release cycle in case
third parties not indexed by MediaWiki Codesearch are using it.
== History
* 2013: Report of high memcached usage by Wikibase via SiteStore.
* 2014: Lazy-load the data in Wikibase (d3f2e99cb6).
* 2014: Implement the file-based cache (via T47532 and 90f6efc360fd5).
* 2015: Use local-server cache (APC), per T58602.
The file-based code was never used. The related task marked
invalid (T47532).
Change-Id: I8e2d9edcf3880149f824cc3de37793ca57435b49
|
|
|
|
|
|
|
|
|
|
|
| |
$site->setLanguageCode( null ) is already used in
DBSiteStore::loadSites and this worked because
Language::isValidCode( null ) === true.
This change explicit check for null and allow to set null without
depending on Language::isValidCode( null ) === true.
Change-Id: I0c9fe03cbf1434b0340e61e96360c0aaeb0fe89d
|
|
|
|
| |
Change-Id: I6743417c3aafbba59ac02350e0190fbf688a5a40
|
|
|
|
|
|
| |
Deprecated in 1.27, no callers.
Change-Id: Ia262790cc6804b29fee656d0f53be1374bf04c2f
|
|
|
|
| |
Change-Id: If9d4be5d88c8927f63cbb84dfc8181baf62ea3eb
|
|
|
|
|
|
|
|
| |
to 21.0.0
https://github.com/composer/spdx-licenses/compare/1.3.0...1.4.0
Change-Id: I39f7a1310455159866bfed5224536e800befec0d
|
|\ |
|
| |
| |
| |
| |
| |
| | |
Also remove not necessary surrounding parentheses.
Change-Id: I0eb5c9c1bdfb09a800258379cdcefb5fd4d3d21c
|
|/
|
|
|
|
| |
Auto fix MediaWiki.Commenting.FunctionComment.DefaultNullTypeParam sniff
Change-Id: I865323fd0295aabd06f3e3c75e0e5043fb31069e
|
|
|
|
| |
Change-Id: I936c3f5fca1a0061f215e80469f5d882cb32ee29
|
|
|
|
|
|
|
|
|
| |
Even though it wasn’t documented in the interface,
MediaWikiPageNameNormalizer::normalizePageName returns false for pages
that do not exist on the remote site. Too many users already depend on
this feature to remove it, so at least document it properly.
Change-Id: Ic2ba86b81bba86b868a6697aa57fdd46432c0d7d
|
|
|
|
|
|
|
|
|
| |
I checked all callers of these methods and almost all of them expect the
method to return false. It looks like this return type was known at some
point, but got lost. Let's add it back.
Bug: T191634
Change-Id: I43484835b8f26e07ada6a2b1452a99ccc6d9b438
|
|
|
|
|
|
|
| |
This helps to find renamed or misspelled classes earlier.
Phan will check the class names
Change-Id: I07a925c2a9404b0865e8a8703864ded9d14aa769
|
|
|
|
|
|
| |
Add missing @return and @param to function docs and fixed some @param
Change-Id: I810727961057cfdcc274428b239af5975c57468d
|
|
|
|
|
|
| |
The method was deprecated and made unnecessary in Ib308190c.
Change-Id: I1729ac0b3a88270a4c2f064187a2472112aaeb1e
|
|\ |
|
| |
| |
| |
| | |
Change-Id: I6b2c9c7af9a281fe457099cc3a336a60a25e74aa
|
|/
|
|
|
|
|
|
| |
- mostly auto fixes
- some too long lines fixed
- ignore amp space in one case passing by reference
Change-Id: I6472f83bc3cbf4bd629d83050cc3319b19ec465c
|
|
|
|
|
|
|
|
| |
Having such comments is worse than not having them. They add zero
information. But you must read the text to understand there is
nothing you don't already know from the class and the method name.
Change-Id: I994d11e05f202b880390723e148d79c72cca29f0
|
|
|
|
|
|
| |
Organize phpcs.xml a bit
Change-Id: Ifb767729b481b4b686e6d6444cf48b1f580cc478
|
|
|
|
| |
Change-Id: I123b29dd41c6e0f020e0fcc661813addbec92b27
|
|
|
|
|
|
|
| |
Also: Add language code validation to Site::setLanguageCode().
Bug: T132937
Change-Id: I763ec65cb06d5250a3886a66eefdde8701b2299c
|
|
|
|
|
|
| |
The old names are left as aliases.
Change-Id: I52a327f2463a2ba7437324047b5b00d28cd1d758
|
|
|
|
| |
Change-Id: Ie52313861972fd1b269375dfc8f94afdf67bcb9f
|