| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
This touches various production classes and maintenance scripts.
The code should do the exact same as before. The main benefit is that
the syntax avoids any repetition.
Change-Id: I5c552125469f4d7fb5b0fe494d198951b05eb35f
|
|
|
|
|
|
|
|
| |
Versions are changed in 8e940c4f214ff7d17b53f51c6a46a5cf7fc2c92e,
but that makes the version wrong
Follow-Up: I7f85d931d3b79da23e87b4e5692b2e14be8fcaa0
Change-Id: Iae43725b8e0fffc4d44bf57f6227334b41290bd9
|
|
|
|
|
|
|
| |
Two small typo fixes for dev environment and gerrit setup.
Bug: T362742
Change-Id: I92399002019a8df51731f8c927ca606f91211b51
|
|
|
|
| |
Change-Id: I7f85d931d3b79da23e87b4e5692b2e14be8fcaa0
|
|
|
|
|
| |
Bug: T353458
Change-Id: I38da09f28cd68add721ba7b05f351acb56515d95
|
|
|
|
|
| |
Bug: T353458
Change-Id: I31f7cba42c02701e462eb3ed6bcc3928d438c1ef
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is moderately messy.
Process was principally:
* xargs rg --files-with-matches '^use Title;' | grep 'php$' | \
xargs -P 1 -n 1 sed -i -z 's/use Title;/use MediaWiki\\Title\\Title;/1'
* rg --files-without-match 'MediaWiki\\Title\\Title;' . | grep 'php$' | \
xargs rg --files-with-matches 'Title\b' | \
xargs -P 1 -n 1 sed -i -z 's/\nuse /\nuse MediaWiki\\Title\\Title;\nuse /1'
* composer fix
Then manual fix-ups for a few files that don't have any use statements.
Bug: T166010
Follows-Up: Ia5d8cb759dc3bc9e9bbe217d0fb109e2f8c4101a
Change-Id: If8fc9d0d95fc1a114021e282a706fc3e7da3524b
|
|
|
|
|
|
| |
Doc-only changes
Change-Id: I5177f582ae7ee70c357e9389fed14819faf79463
|
|
|
|
|
|
|
|
|
| |
All callers available in codesearch pass in a $path (and for all callers
except getFileUrl()’s own test, that path is 'api.php'); omitting the
path hasn’t worked correctly for almost ten years (see change
I5ed7e169c9, commit 779df10df7).
Change-Id: I50819efb66fd72f2b5a1cd83d5cdd3a148742299
|
|
|
|
|
|
|
|
|
|
|
|
| |
Follows-up I5ed7e169c9753 (779df10d, T319219) which introduced a new
use of MWException, as per T86704.
While at it, also remove a few unhelpful `@throws` annotations that
do nothing other than save an outdated IDE scan of what throw
statements internally exist. These aren't meant to be caught and thus
aren't of use to consumers of these docs as per T321683.
Change-Id: I4ef964342de80eb2c1dec99cd6258727e6cd1a2c
|
|
|
|
|
|
|
|
|
|
|
|
| |
Its unfortunate that this class has encoded these unusual terms
in its stable API but we can at least use more common terminology
and document what these things actually are.
Virutally every word in the explaination "a full file path [is] a site
url and relative file path", meant something different from its usual
meaning, namely the full URL to an entry point script under /w/.
Change-Id: I15f1c9d56f61e622734bb3ddc304025ad4bfc169
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Recognise CachingSiteStore as the internal class that it is.
* Clean up the file header and move ingroup annotation, similar to
other commits under
<https://gerrit.wikimedia.org/r/q/message:ingroup+owner:Krinkle>.
The one here was particularly odd as it placed the license inside
the class doc block rather than the file doc block.
* Remove unused $cacheKey and $cacheTimeout constructor args. They
were also not covered by any unit tests.
* Avoid use of `empty()` as per
<https://www.mediawiki.org/wiki/Manual:Coding_conventions/PHP>
* Use a more conventional cache key in CachingSiteStore, keeping
the dynamic part for a later segment and keeping the first segment
explicitly tied to a single concrete key group. This also improves
ergonomics of cache statistics e.g. in Grafana and makes the cache
key easier to locate in codesearch/grep, and more recognisable,
e.g. starting with the code component ("site").
Change-Id: I541ad62551ab76127d70ef665272fd1d590ab556
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Site::getPath() has returned null since change I08ffa6a970 (commit
a00337c3f8), almost ten years ago; I think on the whole it’s safer to
fix the prose documentation and keep the @return and actual returned
value as they are, rather than the other way around.
MediaWikiSite::getPageUrl() compared the $filePath to false instead of
null, so the comparison would always be true; but on closer inspection,
I think this code was supposed to check $path, not $filePath, in the
first place. The only reason this didn’t come up so far is that all
known callers pass in a custom path (specifically, all non-test callers
pass in 'api.php'), so the $path = false default was never used.
To avoid a deprecation warning in PHP 8.1 when passing a null $filePath
into str_replace(), throw in that case instead – the function isn’t
documented to return string|null, and none of the callers seem prepared
to handle a null return as far as I can tell, so throwing seems better
than returning null. Tests that produce a null $filePath need to be
fixed to complete the Site object (compare Wikibase change If20688411e).
Bug: T319219
Change-Id: I5ed7e169c9753486c765fd816d1b21016c5c1def
Depends-On: If20688411e3f0108b0c0ba3b91e5cc264b70a208
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Change-Id: I0ccda3d1de29b1044f74ef0972949eb8fbcb707d
|
|
|
|
| |
Change-Id: I5138f6043effab813aacb7b0b408428d3e21d23d
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Isn't used anymore anywhere.
Bug: T122754
Change-Id: I95b20c005721837dcbf9ab979674ac09c460cdd0
|
|
|
|
|
|
|
|
|
| |
Into a new MediaWikiPageNameNormalizer.
The code has been copied over almost 1:1, I only
left the phpunit test special handling in MediaWiki site.
Change-Id: I008cadd29a2aa1f21098339b895c35a100959b04
|
|
|
|
|
|
|
|
|
| |
Two rules are ignored for now to allow us to upgrade:
* MediaWiki.ControlStructures.AssignmentInControlStructures.AssignmentInControlStructures
* Generic.ControlStructures.InlineControlStructure.NotAllowed
Also ignore the .git folder.
Change-Id: I1b149c72b27be54e22e369999ad0c41c2d1fc2b4
|
|
|
|
|
|
|
|
| |
Changed some old bugzilla links to new phabricator links in comments,
test data and error message. This reduces the need for redirects from
old bugzilla to new phabricator from our source code.
Change-Id: Id98278e26ce31656295a23f3cadb536859c4caa5
|
|
|
|
|
|
|
|
| |
This drops support for the custom utf8 normal PHP extension in favor
of the intl extension.
Bug: T90825
Change-Id: Ifbaeb2ef684217cf6187ccc4fb4d303f89608300
|
|
|
|
| |
Change-Id: Ie980b080da2ef21ec7d9fc32f1accc55710de140
|
|
|
|
|
|
|
|
|
|
| |
- use tab as indent instead of spaces
- Added space after closures "function"
- Added spaces around string_concat
- Added newline inside empty blocks
- Removed four spaces after comma
Change-Id: I4425b0c6a69b36f40acfea6511b8950cf09ce2b2
|
|
|
|
| |
Change-Id: Ibc3f29e21dd5bcfd5ea641a58f8d3f641948741d
|
|\ |
|
| |
| |
| |
| | |
Change-Id: Ief96d55aa95f657a38a62ae3dde1ef7a415ff675
|
|/
|
|
|
|
|
|
|
| |
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: Iced714bca004756b461b66067a49a925a7e3b877
|
|
|
|
|
|
|
|
|
|
| |
Most were this way already:
https://doc.wikimedia.org/mediawiki-core/master/php/html/todo.html
Ran a find/replace on the odd ones. Also made them all
lower case.
Change-Id: I70c6a69344ddebc603e9a1c1d87e3cc4f4f4c560
|
|
|
|
|
|
|
| |
wfScript should not be used to construct URLs for calls to other wikis
Bug: 47242
Change-Id: Id5aaa58f10d513e082b217aeb8d88b8228341a48
|
|
|
|
|
|
|
|
| |
Also pass a array to wfAppendQuery, which than does the urlencoding.
Prefer a wfScript() over the global or string
Change-Id: Icada534cb4c99c9441938a2e8dcbc11a142360c6
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
| |
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.
Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Spotted in ipbreason-dropdown by Shirayuki.
Change-Id: I576ed4bc0abe5ab980aaee3fb9f9e4b43087311f
|
|
|
|
| |
Change-Id: Ic0d890f5e27cec017c7f7910a67d53b2edf82079
|
|
|
|
| |
Change-Id: I08ffa6a97093abbe85169f664b97498c5f39bf8e
|
|
|
|
|
|
| |
These lines belongs to the whole file, not only to that class.
Change-Id: Ib61eae1e8f7d50d29a929c6034ede08a851105c9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
MediaWiki is licensed under GPL so we should really add the header to
our PHP code unless reusing code licensed differently.
Tested using:
ack-grep --php -L 'This program is free software' \
includes/ maintenance/ mw-config/ resources/ skins/
Output the following files:
includes/ExternalEdit.php (public domain)
Various other licenses:
includes/json/Services_JSON.php
includes/libs/CSSMin.php
includes/libs/IEContentAnalyzer.php
includes/libs/JavaScriptMinifier.php
includes/libs/jsminplus.php
includes/normal/Utf8Case.php
includes/objectcache/MemcachedClient.php
File autogenerated from a GPL file and Unicode data:
includes/ZhConversion.php
A few lines coming from stack overflow:
maintenance/mwdoc-filter.php
Message files do not have any license :-/
Change-Id: I214a988edfa9e2dfcc762612a0f7d47eee8bcb74
|
|
|
|
| |
Change-Id: I8151b79f97ac7fea547a974ad64d404ff881a2e2
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* @licence -> @license
* Protects inline HTML by using double quotes, our inline comments uses
elements such as <h1> or <firstnameLastname@gmail.com>
* Commands in lowercase (@TODO -> @todo, @NOTE -> @note)
* removes @abstract and @static since doxygen detects them from PHP
code.
* various undocumented function parameters
* typos in parameters declarations
Change-Id: I62ad6fc124c355bf31acc780b9614a59cf79a421
|
|
|
|
|
|
|
|
|
|
| |
Titles are usually reported as "missing" if they
are not found, but if the title contains invalid
characters the title is reported as "invalid".
This changeset will make the page name normalization
also check if the "invalid" marker is set.
Change-Id: I86d432e8ea00c97891fb7849468caac6120252c6
|
|
|
|
| |
Change-Id: Iea7bad4367782ee8baa676921625b44dc2b7c45f
|
|
existing interwiki code
This code is meant to replace the current interwiki code, but does not do so just yet. It is however used by the Wikibase extension. This allows us to try out some more things and have the code stabilize more before we migrate over existing interwiki functionality.
Change-Id: I23c47c2c3909a1500350fb560a5f2ec654e2c37e
|