| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
| |
Deconstructing non-sparse, numerically indexed arrays directly in
foreach (a.k.a. using the list() syntax in foreach) is possible since
PHP 5.5.
The possibility to use string array keys as well as non-sequential
numeric keys in array deconstruction was added in PHP 7.1.
Change-Id: I56a48552a45f61cedc291b306cad8548fc70d485
|
|
|
|
| |
Change-Id: I78108e7dc5a10d892e97b0101c1b72cb8d363e97
|
|
|
|
| |
Change-Id: I337147d61e2ec686a8672d0340dff4b6783f78cd
|
|
|
|
|
| |
Bug: T226036
Change-Id: I4db32efdb10bb51b87e5e2116888655e7341b82d
|
|
|
|
|
|
| |
Bug: T246284
Depends-On: I955d9c3478eb5278bdc807d11aab04e8e051d22f
Change-Id: I01ac581234980c6e7dbf916558c231ab648cbbae
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These are not configuration but business logic, similar to the
canonical names that are in NamespaceInfo.php, these must always
exist and cannot be altered or unset.
They were previously unconditionally assigned during all requests
in Setup.php and passed down as "site configuration".
Changes:
* Move them to MessagesEn.php where they can be cached and
processed the same way as other core-provided aliases.
Document and confirm with tests that this is a mergeable
attribute that follows the language chain.
* Remove the duplicated code in a few places that was reading
this variable + Language::getNamespaceAliases(), to instead
just call the latter and move the logic there, centralised,
and tested.
In doing so I noticed that these were applied in an
inconsistent order. Sometimes the config won, sometimes not.
There's no obvious right or wrong way here, but I've chosen
to standardise on the way that Language::getNamespaceIds() did
it, which is that config wins. This because that method seems
to be most widely used of the three (it decides how URLs and
titles are parsed), and thus the one I least want to change
the behaviour of.
* Document that $wgNamespaceAliases may only be used to
define (extra) aliases, it is and never was a way to access
the complete list of aliases.
Bug: T189966
Change-Id: Ibb14181aba8c1b509264ed40523e9ab4000fd71a
|
|
|
|
| |
Change-Id: I94a0ae83c65e8ee419bbd1ae1e86ab21ed4d8210
|
|
|
|
| |
Change-Id: I746a69f6ed01c3ff000da125457df62b02d13b34
|
|
|
|
|
|
| |
This avoid global state
Change-Id: Id67d07597159a0bd2721a381775230c3cd1d5509
|
|
|
|
|
|
| |
NamespaceDupes
Change-Id: Ie31beb183d32663b368a32e4926a3ed55456719c
|
|
|
|
|
|
|
| |
Update deprecated Revision::* constants to use RevisionRecord::*
equivalents.
Change-Id: Icae1ebb088e4efadbc7c2806127a2073d337fa05
|
|
|
|
| |
Change-Id: I6a58e9cfe645056a854c80b2db1e71fb59bd226b
|
|
|
|
| |
Change-Id: I2fef157ceec772f304c0923a1cd8c0eef2e82a0f
|
|
|
|
|
|
|
| |
Brought to you by vim macros.
Bug: T200246
Change-Id: I79e919f4553e3bd3eb714073fed7a43051b4fb2a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`$a <=> $b` returns `-1` if `$a` is lesser, `1` if `$b` is lesser,
and `0` if they are equal, which are exactly the values 'sort()'
callbacks are supposed to return.
It also enables the neat idiom `$a[x] <=> $b[x] ?: $a[y] <=> $b[y]`
to sort arrays of objects first by 'x', and by 'y' if they are equal.
* Replace a common pattern like `return $a < $b ? -1 : 1` with the
new operator (and similar patterns with the variables, the numbers
or the comparison inverted). Some of the uses were previously not
correctly handling the variables being equal; this is now
automatically fixed.
* Also replace `return $a - $b`, which is equivalent to `return
$a <=> $b` if both variables are integers but less intuitive.
* (Do not replace `return strcmp( $a, $b )`. It is also equivalent
when both variables are strings, but if any of the variables is not,
'strcmp()' converts it to a string before comparison, which could
give different results than '<=>', so changing this would require
careful review and isn't worth it.)
* Also replace `return $a > $b`, which presumably sort of works most
of the time (returns `1` if `$b` is lesser, and `0` if they are
equal or `$a` is lesser) but is erroneous.
Change-Id: I19a3d2fc8fcdb208c10330bd7a42c4e05d7f5cf3
|
|
|
|
|
|
|
| |
Each of these scripts had a class name that was not referenced outside
of the script file itself, and are safe to rename as a result.
Change-Id: Id605aca11db51ee433baeaa998a0e33184c930ca
|
|
|
|
|
|
|
| |
This helps to find renamed or misspelled classes earlier.
Phan will check the class names
Change-Id: I1d4567f47f93eb1436cb98558388e48d35258666
|
|
|
|
|
|
| |
Enable the phpcs sniffs for this and used phpcbf
Change-Id: Iaa36687154ddd2bf663b9dd519f5c99409d37925
|
|
|
|
|
|
| |
Organize phpcs.xml a bit
Change-Id: Ifb767729b481b4b686e6d6444cf48b1f580cc478
|
|
|
|
|
|
| |
Relatedly, move lockTables()/unlockTables() to IMaintainableDatabase
Change-Id: Ib53e9fa948deb2f9a70f0ce16c002613d0060bf9
|
|
|
|
| |
Change-Id: I6f3f0e85e268b24c57c537aa6ad8016e0b4cdddb
|
|
|
|
| |
Change-Id: Ibd25968660466c44189ccb01df1d8bec6e1b207c
|
|
|
|
| |
Change-Id: If37a7909056bf2c31a8228cbc84f0fbbf5f1c517
|
|
|
|
| |
Change-Id: I51df9f419d6ea1e822fd0eef8c5dc4c43f9855e1
|
|
|
|
|
|
|
|
| |
This DataUpdate (or any for that matter) is not meant to be run in
the same transaction as random other stuff.
Bug: T143631
Change-Id: Ic40865805c26acc88e613a592b922ffb121962d2
|
|
|
|
|
|
| |
And add a GPL file header while we're at it.
Change-Id: I15a6f240124c879b21fb655ade1baaebf4f34ffd
|
|
|
|
| |
Change-Id: I5d3a5eb8adea1ecbf136415bb9fd7a162633ccca
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Change-Id: I230054fab8c2e2ade9f3ef00bfd820bad2842c80
|
|
|
|
| |
Change-Id: I0e2aa83024b8abf5298cfea4b21bf45722ad3103
|
|
|
|
| |
Change-Id: I9ad6745d84506b736dae94747256caac89715899
|
|
|
|
| |
Change-Id: I700437a016a40ad82951ae56d215f6dace2bb612
|
|
|
|
|
| |
Bug: T115824
Change-Id: I67f57f680587c2c1e00f63a268019270bf8d5f86
|
|
|
|
|
|
|
| |
This allows empty lines inside the comment as found by the
MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.EmptyComment sniff
Change-Id: Iac155bbda4a84562db2b452baeae9b8973899453
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix link destinations where a link was previously made to the
pseudo-namespace. Don't do this for --source-pseudo-namespace since it
only makes sense when the PDBK is essentially unchanged.
* Update pl_from_namespace, il_from_namespace and tl_from_namespace when
moving a page.
* Run LinksDeletionUpdate::doUpdate() when deleting a page, so that
referential integrity is preserved.
Change-Id: I584ead93d6267d1a2928ecbcdf8a4cd8e5aeef94
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
General review and improvement in service of T87645.
* Add the option to add a prefix to a page on conflict, instead of a suffix.
This makes it easier to find the pages after they are renamed, since
[[Special:Prefixindex]] can be used.
* Rename options --prefix to --source-pseudo-ns, --suffix to --add-suffix,
--key to --dest-ns.
* Document --source-pseudo-ns and verify that it does what I think it was
meant to do, per T14371, thus allowing me to remove the "todo" note.
* Add the option to do a history merge instead of a rename to resolve
conflicts.
* Pass around an options array instead of an ever-growing list of formal
parameters.
* Rename resolveConflictOn() to movePage() and remove the $table and
$prefix parameters which were unused since MW 1.5. Also get rid of
the usage AS in getConflicts(), most instances of which were for MW 1.4
compatibility.
* Rename getConflicts() to getTargetList() since "conflict" is a
misnomer. A conflict occurs between two entities, really what the code
was calling an "unresolvable conflict" is actually a conflict, whereas a
"resolvable conflict" is merely a page in the wrong namespace.
* Add option --move-talk since checking the talk namespace doesn't make sense
in the case of corruption, it only makes sense when introducing a new
namespace, when a pseudo-namespace has previously been used.
* Use terse, greppable output, with a single line per page.
* Replace ksort() followed by asort() with a single uksort(), since I think
that is what was intended. PHP's sort functions are not stable, so you
can't run two different sort functions on the same array and expect to the
first sort to have a predictable effect on the result.
* If --fix is not given, give the same output, just don't take the action.
* Refactor checkNamespace(). Move target title determination to its own
function, was a mixture of SQL and a couple of lines in reportConflict().
Move alternate title determination to its own function, was mostly in
resolveConflict(). Get rid of reportConflict() and resolveConflict(), do
what's left of them in the main loop. Get rid of modification of page row.
* Improve destination namespace calculation logic of --move-talk feature,
per comments by PleaseStand.
Change-Id: I49921315315e1a29c9559ba221e9903b10b73d68
|
|\ |
|
| |
| |
| |
| | |
Change-Id: I1e52db4c3bc60ab41cff3f86aa565a99ffc564ef
|
|/
|
|
| |
Change-Id: I129c0d0ad5770d3d9bcdbc1881757f3c13f37c35
|
|
|
|
|
|
|
| |
Some @param have a typo in the variable name,
some @param's were in wrong order.
Change-Id: Ie25806831027112b398f6f4a909c59147ac3a5fa
|
|
|
|
| |
Change-Id: Idbc38d8089541e5154b2601297b429f7433fd59e
|
|
|
|
| |
Change-Id: I4390c4ea12a6a626b0e6817b6446635116ca9fe3
|
|
|
|
|
|
|
|
|
| |
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: I727deec35a712de0f0c676cc87dfa661f1ee965b
|
|
|
|
|
|
|
| |
These are only documentation fixes
http://www.mediawiki.org --> https://www.mediawiki.org
Change-Id: I62ad42be1a3aac410cc53e98ce79389ceddd8988
|
|
|
|
|
|
|
|
| |
Shouldn't be needed and aren't for any core operations. If any
extension relies on these $wgTitles being set in maintenance
environments those extensions are broken and should be fixed.
Change-Id: Ie02a5042ab96e155d783d56d5340dd0da8e3d55c
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Follows-up I1343872de7, Ia533aedf63 and I2df2f80b81.
Also updated usage in text in documentation and the
installer LocalSettingsGenerator.
Most of them were handled by this regex:
- find: (require|include|require_once|include_once)\s*\(\s*(.+?)\s*\)\s*;$
- replace: $1 $2;
Change-Id: I6b38aad9a5149c9c43ce18bd8edbab14b8ce43fa
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Squiz.WhiteSpace.LanguageConstructSpacing:
Language constructs must be followed by a single space;
expected "require_once expression" but found
"require_once(expression)"
It is a keyword (e.g. like `new`, `return` and `print`). As
such the parentheses don't make sense.
Per our code conventions, we use a space after keywords like
these. We appeared to have an unwritten exception for `require`
that doesn't make sense. About 60% of require/include usage
was missing the space and/or had superfluous parentheses.
It is as silly as print("foo") or return("foo"), it works
because keywords have no significance for whitespace between
it and the expression that follows, and since experessions can
be wrapped in parentheses for clarity (e.g. when doing string
concatenation or mathematical operations) the parenthesis
before and after basiclaly just ignored.
Change-Id: I2df2f80b8123714bea7e0771bf94b51ad5bb4b87
|
|
|
|
|
|
|
| |
Added spaces before if, foreach
Added some braces for one line statements
Change-Id: I9657f72996358f8c1c154cea1ea97970d973723c
|
|
|
|
| |
Change-Id: I8fdf3a44bef8044d064db9d4489425e20e04d004
|