Add error suppression feature to getConnection() itself so that
callers can easily be migrated to it. Deprecate openConnection(),
which is poorly named and had a poor division of responsibility
with getConnection().
Split out some new private methods for readability:
* sanitizeConnectionFlags(), which warns about and strips unusable flags
* enforceConnectionFlags(), which handles some DBO_TRX sanity logic
* lazyLoadReplicationPositions(), which handles the chronology callback
Make sure "waitForPos" is loaded before pickReaderIndex() so that the
optimization of being extra picky about replication lag (in seconds)
actually applies.
Change-Id: I225ed6e6edf39cdf237f2322ea59f35d30f2e01a
There is no guarantee that this is a maintenance able connection,
but drop, create or alter is also not needed in this case
Change-Id: I7dd294b3d28ef8c4e416e826f38ed39f824b2f8f
Phan will automatically use these stubs if the extensions are not installed.
Also added a brief README for how to generate the stubs in the first place.
Bug: T224893
Change-Id: I1d31d03801fbc7b18dfc758453c95439acd96d19
This changeset lays down the basic groundwork required to implement
T89432 and related tickets and is based on exploration done
at the Prague Hackathon. The goal is to identify tests in MediaWiki core
that can be run without having to install & configure MediaWiki and its dependencies,
and provide a way to execute these tests via the standard phpunit entry point,
allowing for faster development and integration with existing tooling like IDEs.
This changeset creates a new subdirectory under phpunit/ and organizes it
into a separate test suite. The environment for this suite is set up
via a PHPUnit bootstrap file without a custom entry point. For B/C, this
directory is also registered in suite.xml, to ensure that existing CI jobs
still pick up tests in the new suite.
For initial testing, a single test class, PasswordFactoryTest, was moved
to this new suite.
You can run the new suite using the follwoing command:
$ vendor/bin/phpunit -d memory_limit=512M -c tests/phpunit/unit-tests.xml
Bug: T84948
Bug: T89432
Bug: T87781
Change-Id: I69b92db3e70093570e05cc0a64c7780a278b321a
This is needed in order for Phan not to consider calls to
IDatabase::buildLike as invalid. Interestingly, it does not
consider calls to Database::buildLike invalid.
Bug: T191668
Change-Id: I0e027f5ec66d20b1d11e3441086001f6a751e1f5
Do not send headers if they were already flushed. Split off some
chronology protection logic into a separate private method. Use
ILBFactory over LBFactory in a few places. Also, update various
code comments.
Bug: T225655
Change-Id: Iecb574e11d8ba09147ff7b84ad57d8845069ba99