This causes Title to no longer look up fields in the database
individually, but use LinkCache instead to load an entire row from the
page table at once.
This patch also causes Title to use in-process caching for some
getters that did not use caching before, such as isNewPage()
and getTouched(). These methods do not appear to be used on critical
code paths that involve database updates.
Note that getTouched() used to take an options $db parametr. This
appears to be unused, and has been deprecated in favor of a $flags
parameter, for consistency with other getters on the class.
DEPLOY: Risky! This re-implements the internal caching logic of Title
and slightly modifies caching semantics in some cases. This may have
unforeseen consequences.
Bug: T285389
Depends-On: I103b9e1d2bf594bfc1b0ea12b980dd20bb911c3a
Change-Id: I2df81df7186025e001520f24fd498623c7184772
isset returns false for null and the null values are not compared,
that treats them as non-default, even the default is also null.
Bug: T291748
Follow-Up: I6e61c11d8aed27b4b559e74849e0056e5eef3638
Change-Id: I0a0932b403098967c261eee3dc0e7d5da3c4fffb
NamespaceInfo was added in
I4af843238ffd58925f57c0f7b98253a90cb285ec
and removed in:
I5c9ea04a9deca136bb7210f07200d18f97fd6686
Change-Id: I64612b57b0e5e5c7c126d7434e5b108fc735ac57
This feature no longer seeems to be needed at this time and is
not worth the complexity in that case.
Bug: T264604
Bug: T288702
Change-Id: I059ab57236ab2281183110bd65dcf23b1fa7405d
We want to force the use of HTTP/1.1 instead of leaving it up to the host
default which might be HTTP/2, introducing a performance regression for
large uploads.
Since we have to pass this to every run()/runMulti(), set it as a private
constant that can be passed directlry or added to existing option arrays.
Bug: T275752
Change-Id: Ifbae4d585daee28fa92b07f53c5854320a18a311
For context see T275752, but the premise is that we want to be able to
set the HTTP protocol version so that for specific use cases. That way
we will be able to use the proper protocol per use case, mitigating
potential future regressions or selectively rolling out a newer protocol
version per use case. Support setting CURLOPT_HTTP_VERSION, while making
sure to default to the current default which lets curl decide which
version to use
CurlHttpRequest already forcibly set this to 1.0 for what is worth
Bug: T275752
Change-Id: I82f4f174997ecaa54e33eb848b5f007c982506dd
Use ContentRenderer::getParserOutput instead.
Extensions defining a content model should override ContentHandler::fillParserOutput.
Update tests.
Bug: T287158
Change-Id: I1c71a8429806f1813a39f5807256b2eb9fb9901f
As of PHP 7.2, parse_url does not correctly handle ports on protocol
relative URLs. Ensure that we properly compensate for this.
Bug: T294559
Change-Id: I52c661cbff5e6f28120b50111659255d712d6887
This reverts commit 66e58d1ea7.
Reason for revert: let's revert and hope this will fix T294559
Bug: T294559
Change-Id: I2e4ae268e288f87b6c80fac08d275118f5b5cbd7
Inspired by T290004, attempting to solve that ticket will be done
in the next patch on this one.
Bug: T290004
Change-Id: I431e3eba1bcfb446a4ab60aa3d2189762ea9f65f
This way the intent is clearer, and it also properly covers the case
where the exception isn't thrown.
Change-Id: I7831382956d5bc204b695fecc47f7111519d53af
This refactors the bindToggleOnSpaceEnter function to use keydown and
keyup listeners to provide the space/enter key functionality. This
provides the following benefits:
* A click event is triggered when pressing the space or enter key on the
passed in "button" element. This simulates native button behavior which
triggers a click event when these keys are pressed.
* Checkboxhack menus will no longer toggle rapidly when holding down the
space/enter keys.
Bug: T291096
Change-Id: I1ea65112fa6b527f1bd9118212838298399996aa
We should pass the special page names as an array of strings and create
the instances of these specials pages in the factory instead. In 1.34, we
deprecated passng instances of special pages in $wgSpecialPages for example.
Bug: T245128
Change-Id: I089ffd0f9983812ae621b2aef592c2059125ee7d
Before this commit, each bind function would return an object containing
a reference to the function used in the event listener creation with the
intention that this could later be used to cleanup the event listeners.
This is problematic for the following reasons:
* In order to cleanup the event listener, it forces the client to know
which element the event listener was added to (button, checkbox,
document, window, etc.),. the event type that was used ('click',
'focusin', etc), and whether or not the "useCapture" param was also
used. The `removeEventListener` API won't remove the correct event
listener unless these three pieces of info are known by the client [1].
* Because the above point is tricky to get right, numerous potential
memory leaks were possible with the `unbind` function as the
`useCapture` param wasn't being passed in some cases.
This commit aims to simplify the cleanup API by returning an anonymous
function in each bind function that the client can call to cleanup the
relevant event listeners without knowing any of the implementation
details. This also makes the `unbind` function unnecessary.
** This is a breaking change to the checkboxHack API ** but because
there aren't any known clients of the return values [2], a formal
deprecation process was assumed to be unnecessary. Note gadgets should
not be using the internal function mw.loader.require so these were
not considered.
[1] https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener#matching_event_listeners_for_removal
[2] https://codesearch.wmcloud.org/search/?q=checkboxHack&i=nope&files=&excludeFiles=&repos=
Bug: T291096
Change-Id: Ia2d79f27dd81fdc74a44829da3ca472f4c01d4b5
This is required by Parsoid 0.15.0-a6.
I don't need to increment the Parsoid version here since it is
not using semantic versioning. The caret will allow upgrades until the
Glorious Future of 1.0.0.
Depends-On: I72346a431f556555410f6af64bdb10140ea9bd8a
Change-Id: Idefebb725444d244252623533b8469214324f931
This rule can continue to apply to all buttons. Increasing
the specificity caused regressions.
Bug: T294286
Change-Id: I8bf02e81df56cafa221daeeb0f36e0305c6d9816
Do it self to avoid the global state of the Timing class within the
resourceloader.
Replaced the deferred update with a scoped callback to send stats on all
possible return path for the called function, but directly when needed
and not deferred, which can make wrong times.
The old code was using a fix mark set be
MediaWiki::doPostOutputShutdown, where a defered send does not has
impact of the send stats
Change-Id: I5fec6a73db3e7c3ac6a6ac33bb293727ae3a38ca
LinkCache::addGoodLinkObj was hard deprecated.
Use addGoodLinkObjFromRow() instead. PHPUnit tests
must use LinkCacheTestTrait::addGoodLinkObject().
Bug: T284955
Change-Id: I0c22be2f00e6d6d4ba6dd1511c5385cad55e8ff7