The motivation is to make the code less confusing. I hope this is the
case.
?? is an older PHP 7.0 feature.
??= was added in PHP 7.4, which we can finally use.
Change-Id: Id807affa52bd1151a74c064623b41d950a389560
These three classes:
- TitleArray
- TitleArrayFromResult
- TitleFactory
We need to move these and the rest of files under title/ to Title/ (and
namespace them) but the patch will become way too big given that Title class is
also one of them.
Bug: T321882
Change-Id: Iac1688172ee457348a08a470c86e047571feb8e0
Allow the causeAction that triggers page rendering to be looped through
to ParserCache, so we can count what causes writes to the cache.
Change-Id: I6ad8e105a3ce457e3ab4f85cd154f47a32085e0d
* Move description and ingroup annotations from PHP file docblock to
class docblock, where IDEs and Doxygen (and humans!) tend to read it
from.
This is in part evidences by the fact that for numerous classes,
the file docblock was copy-pasted and actually about a different
class.
Follows-up Ia3b9b8c22 (page), I301f471f86 (language),
I216d85c6df (PageEditStash), and others that apply similar doc
improvements.
* Add missing `@defgroup` for page. Without this, the group is ignored
and not added in the sidebar at
<https://doc.wikimedia.org/mediawiki-core/master/php/>
* Clean up the file header, similar to other commits under
<https://gerrit.wikimedia.org/r/q/message:ingroup+owner:Krinkle>.
Change-Id: I94de8299c184fee8c05b7108448255fcf36f8260
Builds a condition comparing multiple values, for use with indexes
that cover multiple fields, common when e.g. paging through results
or doing batch operations. Can also be to generate a simple comparison
without writing raw SQL (see T210206).
Update a few manually constructed conditions to use this method.
There are more maintenance scripts and API classes that use the
same patterns, but this is a start.
As you can see by the code I'm replacing, there are many ways to do
this. I picked the one used by maintenance/TableCleanup.php, since
I found it the easiest to understand.
Change-Id: Ic368a87fb5ce4c13608b03206cd68518ec9732d4
All revision related classes are namespaced MediaWiki\Revision
instead of MediaWiki\Storage since 1.32. The old namespaced
class names are deprecated and only kept for backwards-compatibility.
Bug: T305784
Change-Id: I48cdc65301a8cd20d2bedd031dbdae33b8c2a34d
Each field of a database result is a string,
the revid is known integer and also used on further database query,
where a int looks better when looking at the sql
Change-Id: I5557ff7d0f01cf569b2983b09ac715447d3e65a1
Make phan stricter about null types by setting null_casts_as_any_type to
false (the default in mediawiki-phan-config)
Remaining false positive issues are suppressed.
The suppression and the setting change can only be done together
Bug: T242536
Bug: T301991
Change-Id: I0f295382b96fb3be8037a01c10487d9d591e7e01
Optimise RevisionStore::getRelativeRevision() by using the timestamp
from RevisionRecord::getTimestamp(), if it is non-null, instead of
getTimestampFromId(), which always requires a DB query.
Change-Id: Ibf0ab45ddfebbf6f188d3630610946c3c7376f9f
This is currently making a lot of (serial) DB queries during every page
parse. At least one for every transcluded page.
Using Memcached should significantly reduce DB load, and apcu should
notably reduce latency when parsing large articles.
This is currently limited to NS_TEMPLATE to avoid overwhelming caches
with a long tail of unlikely re-used metadata about non-transcluded
pages (every parsed article) and rare non-template transclusions.
Bug: T297147
Change-Id: I630603eaffcae3700b2843fb97c5bedf8d29da9e
PHP 8.1 will give us "first class callables" that look like e.g.
$result = array_map( $this->fn(...), $array );
For now we can use
$result = array_map( [ $this, 'fn' ], $array );
Change-Id: I7278c80c075d162da73aa45af1b6578310ce0624
Create ArchivedRevisionLookupTest to test ArchivedRevisionLookup.
Expand tests a bit and add two more for ::getPreviousRevisionRecord.
Change-Id: I3e176b24a13479464b7e73d062639ecb4db86f8f