This branch fails to compile against PHP 7.4.3, our lowest supported
version, and will not be updated to support that or any newer version:
https://tideways.com/profiler/blog/releasing-new-tideways-xhprof-extension
In doing so, remove the Xhprof class. At this point, it doesn't do
anything other than calling either of two functions from whichever
extension is installed, which can just be done in ProfilerXhprof.
Change-Id: Iba1c16f47c68b36982f5d2dcda3bdf4dcb83501d
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
The RDBMs classes treat table names as application-supplied rather
than user-supplied, since it does not make sense for the user to be
able to blindly pick the schema (likely causing query errors). Table
names are generally non-problematic [a-zA-Z0-9_]+ strings. However,
they still should be escaped as identifiers, since they might have
problematic characters. Fix the SQLite backend to apply escaping
here, similar to MySQL and Postgres.
Fix incorrect use of tableName() in DatabaseSqlite::fieldInfo().
It should work the same as in tableExists().
Bug: T72510
Change-Id: I3713f81e6e1eca84cc51c12c9307d4c5dc737043
Remove Argon2PasswordTest::testPartialConfig(). It's irreparably slow
and doesn't seem to test anything useful, just that the defaults are
the defaults. It was added in PS5 of Ifdf648f5d8a734a663e6 as part of a
change which removed explicit cost defaults from DefaultSettings.php.
Reduce time costs of some other tests.
The time to execute tests in this directory is reduced from ~1.3s to
~0.5s.
Bug: T225730
Change-Id: I30b846b5364ad2030e2547da6c58db13eaf401f2
In PHP 7.4, it's possible to compile password without Argon, but if
Argon is compiled in, both algorithms should be available.
So:
* Remove Phan stubs
* Simplify class code
* Add test per todo
Change-Id: I749d456ad59698e5b1538b127586ea796efba1d1
When the cache key doesn't contain a prefix indentifying the collection,
don't use the entire cache key as the metrics name. Doing so may explode
the number of metrics.
Bug: T323357
Change-Id: Ia7ff3f060a36f848c7a74e39070bd62a932120e7
Otherwise the mocked getLangCode() method returns null, which is not
allowed any more in PHP 8.1.
Bug: T289926
Required-For: I7e026cca216aba24ee5d5662b6fca322b3cec9ae
Change-Id: I178def7f03a44f6b49cdb461d9ab340e1c89517f
This adds applyCacheControl() to the Handler base class.
REST handlers can override this method to apply cache control to the
response.
Change-Id: Ib31b91a0048dbc57fbcadfec6533e672c1567509
MediaWikiTitleCodec: I removed the comment about dbkey being
"conveniently nullified" since that is no longer correct. The first
preg_replace() can return null, and that is guarded. The second
preg_replace() hopefully can't return null, because if it does, trim()
will generate a deprecation notice on PHP 8.1.
Some other self-explanatory changes.
Change-Id: Iad0ace821eba782c3033ec8abfeac461ac4e8ace
Some malformed pages contain "character references" that were so long
that they caused PHP's `hexdec` to return a `float` instead of an
`int`. This caused Parsoid to crash on a type hint on the argument to
Sanitizer::validateCodepoint(). MediaWiki core has the same issue,
but doesn't have the type hint (yet), so soft-fails instead of
crashes. Add sanity checks around each call to `hexdec` to protect
against arbitrarily-long entity strings (while allowing arbitrary
zero-padding), and add a note to `intval` to explain why it is not
similarly affected. New test cases added to SanitizerUnitTest as
well.
Corresponding patch on the Parsoid side:
Ic33196961bb2b86290148fbc3ce33bcd8b28ab56
(And see T247804 re: eventually removing this duplicate code.)
Bug: T322892
Change-Id: I5085c4edbb86e282b92536d05b01ed5f9d5c615e
This proves a way to list all active hooks.
ApiQuerySiteInfo was relying on $ghHooks, which does not contain hooks
that were registered by extensions using the new hook handler system.
Change-Id: Ifae205f22ab4cc7ae0dfd15e994a1921af51b05c
Make it able to silence only specific expectations. This means that
rules like "masterConns = 0" and "writes = 0" can be silenced, while
rules like "readQueryTime" and "writeQueryTime" remain in place.
Also, do not increment counters for silenced rules. Otherwise, it
might trigger again on something harmless after the scope ends.
Cleanup event/expectation terminology/naming.
Use time mocking in TransactionProfilerTest.
Bug: T258125
Change-Id: I6e5da5051668fadc5a6ad1955c2cb01ef3d477b6
This patch will implement a one-way transliterator (Latin->Cyrillic), per community consensus.
Bug: T268033
Change-Id: I6f3e7efe3630e9960584dca3a5ee55cb92ea722c
Co-Authored-By: Deni <deni@deni.dk>
Co-Authored-By: Winston Sung <winston21.sung@gmail.com>
This avoids the latency of waiting for a response.
Change yieldStampedeLock() to use delete() instead of changeTTL() since
the PECL memcached client does not support WRITE_BACKGROUND with TOUCH.
Also, simply relayVolatilePurges() into relayVolatilePurge() and tweak
some related documentation for WANObjectCache
Bug: T302623
Change-Id: I16f011b730f34332aa54a48c579de3c6606dafda
* Eliminates use of associative array
* Renames $labels to $labelValues
* Renames Sample()->getLabels() to getLabelValues()
Bug: T240685
Change-Id: Ic97afd06a98a874bd006946eb8f82e8e2b457e63
Having pig-latin enabled per default in dev environments is convenient
for manual testing. More importantly, it will allow us to write
end-to-end tests for variant conversion.
Depends-On: I9dc2f743ac487b0f7cfb667150c0f6950d5e7fce
Depends-On: I85b66c85be3959d48a048733af17197bc4cf70af
Change-Id: Ia80ad33cbf5e311fa8b84bd765a8df8d156f4c38
When visual editor switches from source mode to visual mode, we need to
stash the wikitext. Otherwise, we later lack the proper context to
convert the modified HTML back to wikitext.
Bug: T321862
Change-Id: Id611e6e022bf8d9d774ca1a3a214220ada713285
This allows for large string value storage similar to that
of direct BagOStuff callers.
Bug: T309126
Change-Id: I22d2d8bb520ef2ea6ccd28016d34db36fe27c3df
Since the introduction of the new hooks stystem, it is not possible to
clear all hooks by setting $wgHooks. This would only clear old-style
hooks. This is becoming increasingly problematic as the new hooks system
is adopted by more and more extensions.
Introduce a method that allows tests to reset many or all hooks.
This isn't needed much in core, but extension tests need it.
Change-Id: Ica3eb88fe23fe822d2aadb96ff5d15f80dce0d7b
Avoid expensive SHOW query for sites that were explicitly configured
to use pt-heartbeat but configured without a row SELECT condition.
Reduce excessive code complexity for configuration edge cases.
Remove getLagDetectionMethod() and just use the field instead.
Change-Id: I0d8592fde65d8a143506c55dccd1972a148bd489
Make set() and getWithSetCallback() wrap setMainValue(), avoiding some
duplicate option array resolution logic.
Track set() calls via statsd, now that it can be distinguished from
getWithSetCallback() invocations.
Change-Id: Ia1e7b244b1db3b76314d718b3aea9e6e708235c0