This shows that 'zh-classical' is not even a well-formed language tag
because 'classical' has more than 8 characters.
Change-Id: Ic07baf98ca4d92fa4c196895533650145c440584
We also bring along Database::attributesFromType(), which relied on the
private ::getClass(). This requires us to inject DatabaseFactory through
the LBFactory/LoadBalancer hierarchy.
Database::factory() is now soft deprecated. All callers outside of
includes/installer/ still need migration.
Bug: T299691
Bug: T315270
Change-Id: I7d057a9438f1b097554679975e4e9b2fc99e7c2b
The static function isWellFormedLanguageTag is related to BCP 47
language codes not to the internal language codes or language names.
The new function LanguageCode::isWellFormedLanguageTag uses type hints.
THe explicit type cast (bool) is not necessary anymore.
The old function Language::isWellFormedLanguageTag is now deprecated.
Change-Id: I6431dbd82ed6dfcc2a7c3495eca025506551db05
Previously, prior changes to the global UrlUtils instance could interfere
with testInterWikiMap() and trigger a BadMethodCallException exception in
UrlUtils::expand().
Bug: T297078
Change-Id: If75a91e33c5881244de388d203d0fc4879000f46
This is really hard to read. What is code, what is string? These
places are so simple, they really don't need the "{$var}" syntax.
Change-Id: I589dedb8c0193eec4eef500bbb896b5b790b727b
Since (T208881) "CSS using var() to create exponential sized calc() on wiki page will crash visitor's browser" was fixed by disabling var in inline CSS, the issue with browser crashes appears to have been fixed in Firefox, Chrome, modern Edge, and Opera.
This change reverts T208881.
Bug: T288201
Change-Id: I387a0e9fdd02faa69616890c613462c83b91b789
It is not possible to set $wgUseEnotif on LocalSettings.php,
because it is always set on setup, it should not be a global/setting.
Just remove it from the dynamic setup and use the config it is set from
Bug: T305093
Change-Id: I9bfa502a0b9798bd149b4cfe4db86a0461e76f55
When creating ServiceOptions objects or fake HashConfigs use the
constant to refer the config name
Change-Id: I59a29f25b76e896c07e82156c6cc4494f98e64cc
It's just a nice, lesser known convenience function. Exists since
PHP 5.5.
The changes to SerializationTestTrait ended being a little different.
Original I tried to use array_column() as well. But it drops the
array keys, which is relevant here.
We found that calling the two methods getTestInstances(AndAssertions)
multiple times is quite expensive and should be avoided. I changed
the code slightly so it's much less likely this is done unintentionally.
Change-Id: Ifaba3c370871a7c97b4d81ec21ff6ec134433fc0
Split out from the I44045b3b9e78e change.
This is consistent with what Parsoid will use for the TOC marker.
Bug: T287767
Bug: T270199
Bug: T311502
Depends-On: I1f607cf1ef1b61fb4d2e1880de756fb94d5a6b22
Change-Id: Ie63eed07b9bca1bfa07d4c256aba3728cedd8f93
This just makes the class overly complex and defies the whole point of
having this class in the first place (=delaying getting db connections).
It makes it harder to read and understand and specially polymorphic
arguments are quite confusing.
It also would break the reloading db on the fly (I6c3ffde62f6e), users
of DBConnectionRef should not know about the underlying connection, this
class is trying encpsulate that and accepting connection in constructor
breaks this encapsulation.
Bug: T298485
Depends-On: I951ab99ae766788dbae8bd338aaae114a388b21f
Change-Id: I743c0565504c65c4dedf29f2a36d4c386601fda0
Calling ->onlyMethods( [] ) with an empty array does have an effect.
By default, all methods are mocked, which means the original code is
not called. Calling ->onlyMethods( [] ) turns this around. No methods
are mocked but all call the original code.
This is almost the same as ->enableProxyingToOriginalMethods(). The
difference is that ->enableProxyingToOriginalMethods() also requires
the original constructor to be called, but ->onlyMethods( [] ) does
not.
We can get rid of this confusing setup in tests that don't need it.
All tests in this patch that succeed with a simple ->createMock()
just demonstrated that they don't need it.
Change-Id: I341323a1ca793c039498f80b7f073c124b6b6ae0
Now that we moved considerable chunk of DatabaseSqlite to
SqlitePlatform, it's easier to mock and test without actually needing a
live db connection.
This allows moving a lot of tests from integration to unit tests making
them much faster.
Change-Id: I8ce7c470abed5144ba456a000c733e5d739c5c4e
createMock() is still relatively new. This code was using more
complicated mock builders before. This was changed just recently.
createMock() is now so short, the extra helper methods don't make
the code more readable, I would argue.
Change-Id: Ia7e24827157d5f49fc7da102418c79ae33c8e053
There was never anything actually executed in this test.
This patch also removes a little bit of unused code and inlines
trivial test setup code.
Change-Id: I7dd019cac383313913e06adbea22bb6540162280
Clarify docs and reasoning in the tests.
Add some line breaks.
Consistent comment formatting.
Add "NOTE" in both directions.
This is in prep for an implementation change to the JS version, to
detect/prevent regressions.
Change-Id: Iaae47c040e13dcb55b141e5bc8304e8d140ce04f
This introduces $wgLBFactoryConf['configCallback'] which can be set to a
function that returns updates to be applied to $wgLBFactoryConf. The new
method LBFactory::autoreConfigure() can be called to check the callabck
and, if the config changed, reconfigure all existing LoadBalancers.
Reconfiguring the LoadBalancers causes all open connections to be
invalidated; however, any DBConnRef instances will remain valid and will
acquire a fresh connection from the LoadBalancer automatically when
appropriate.
As a proof of concept, this patch adds support for config reloding
into WikiExporter.
Bug: T298485
Change-Id: I6c3ffde62f6e038730736abe980befd90ec43e1a
The "${var}" and "${expr}" style string interpolations are deprecated in
PHP 8.2. Migrate usages in core to "{$var}" as appropriate.
Bug: T314096
Change-Id: I269bad3d4a68c2b251b3e71a066289d4ad9fd496
We really shouldn't do regex matching on SQL we produced, we are better
then that but until we refactor the code to a better shape, it can move
to the platform.
Bug: T307616
Change-Id: Ie2c84f208dfbed036b14c0a0669e004cc84e0f4b
This fixes a bug experienced by jawiki users in which overriding names
of extension namespaces (e.g. "モジュール・トーク") would unexpectedly
also override extension-provided canonical names (e.g. "Module talk").
Pretty much the only Wikimedia-deployed code that reads the config
variable directly is NamespaceInfo::getCanonicalNamespaces(), which
already takes into account $wgExtraNamespaces, so this should be OK.
Bug: T314013
Change-Id: Icd3405c02886651f8e4ec87f6d66783314c1024b
Follows I3ea6fb26296f (MySQLPlatformTest):
* Avoid uncertainty and make the code improvable/removable by explaining
what the suppression is for.
* Remove use of outdated AtEase, which hasn't been used in core tests
for several months (ref phpcs.xml), and more generally not in new code
in core or extensions (ref T253461).
Follows I12c17e327628 (FileBackendTest):
* I was going to similarly explain the reason by stating from the linked
task that it is for preg_match, and I was goingn to move the wholesale
suppression to just the getMockForAbstractClass() call that constructs
the FileBackend and thus triggers the issue.
* Instead, I've fixed the constructor to not pass a string there in the first
place as all non-string values are naturally invalid. Even if there is
a way to satisfy the regex with a non-string value that casts to a
valid string, that'd be an invalid value for a FileBackend name as it
pubicly documented as requiring a string, and internally also stored
and typed as assumed to be (after validation) a string.
* Change the valid test cases to be more representative of actually
intended-to-be-valid input, and actually-likely-attempted-but-invalid
input. The regex permits `[a-zA-Z0-9-_]` yet no numbers, capitals
or dashes were validated by the test, and no special characters
rejected by the test.
This follows If29780653 (c250d07bac) from 2019 which added these test
cases to improve code coverage without input from any (admitedly,
non-existent) active maintainers.
Bug: T313663
Change-Id: Ia326e17231a53c7102dcb116817a0c3830c510e4
On php8.1, this test was throwing a warning because readChunk() returned
null, which confused things. Mock out atEnd() method to make it look like
a zero byte stream to avoid the issue
Bug: T313663
Change-Id: I0d7271a07a31dc0cbe6108748d9cabb2c8f04f41
The ->getTitle wasn't mocked, which resulted in a bunch of
warnings about passing null as string.
Bug: T313663
Change-Id: I50c6dd2dcafefd1bb4536d31b2b6005e10dce570
This was calling wfTmpDir(), which depended on the value
of $wgTmpDirectory being not null, but the parent class of the
test sets the entire environment to null.
Bug: T313663
Change-Id: I37f224195a5aacbd69454cc406fbd06f4e71a133
Cast values to string. This seems to be consistent with what
Router::substPathParams does, and also would be consistent with
the pre php-8.1 behaviour.
Bug: T313663
Change-Id: I631478101b7a679efa7bb897c6c2bb5d51d6281b
This test would fail if the developer's local settings had wgLanguageCode
different from 'en'. Title parsing depends on a number of services; this
should have been an integration test from the start.
Change-Id: I56160f7385239d71e6ec112a7d900cf1e1212987
Previously, `$this->summary` was used for two different purposes.
Usually it was just the summary. But when `$this->section` was 'new',
then it was actually the section title most of the time – unless
`$this->sectiontitle` was also set (in which case it took priority),
and until it was replaced by the real edit summary (near the end of
the processing, after copying the section title to the page content
and before saving changes).
Unsurprisingly some of the code didn't handle this duality correctly,
causing T191722 and T311533.
Now `$this->summary` is always the summary, and when `$this->section`
is 'new', then `$this->sectiontitle` is always the new section title.
The only place where this duality remains is in the input attributes
and query parameters, where 'wpSummary' is still used for both the
summary and the section title inputs (only one of them can appear,
depending on whether `$this->section` is 'new'). It would be an
unreasonable backwards-compatibility break to change this, and the
code handling this is somewhat isolated from the rest of the logic.
Bug: T191722
Bug: T311533
Change-Id: I5313ca9a045d112ece390b011a34192220e2abc1
Less setup code, easier to read.
I also found something that looks like it should have been an
assertInstanceOf(), so I made it one.
Change-Id: I7ba9b580c270a103feb0f55b910157f93197fa43
This adds two tests:
1) ensure that &can-bypass can be used to impose limits on users who are
otherwise exempt from limits.
2) ensure that among multiple limits derived from group membership,
the most permissive one is used.
Change-Id: Iaf9e5d9cc15cbbd3ba117662dd89885ff517580d
createMock() does the same, but is much easier to read.
A small difference is that some of the replacements made in this
patch didn't use disableOriginalConstructor() before. In case this
was relevant we should see the respective test fail. If not we can
save some CPU cycles and skip these constructors.
Change-Id: Ib98fb06e0fe753b7a53cb087a47e1159515a8ad5
This adds functionality to SettingsBuilder for collecting warnings to be
logged later, when the logging mechanism has been set up.
This also adds a validation step to update.php that aborts the update
if any warnings have been registered in SettingsBuilder, or the settings
fail to validate against the settings schema.
Change-Id: I387905289fb93591f79b96bf4c6cb5ec692b2aff
We need a way to determine the URL of routes that are not public,
and should be using $wgInternalServer rather than $wgCanonicalServer.
This patch also refactors some test code to make changes to the
constructor of the Router class less painful.
Bug: T311867
Change-Id: If1878365d019434bb862c643c2350b63479c9844
- schema change to allow tl_namespace and tl_title being empty
This is done by removing them from primary key. They don't need to be
nullable as they have default value.
- Make sure with WRITE_NEW, updater avoids writing to the old columns
Bug: T306674
Change-Id: I2b8a29043e952060e7a79b6a7a3d647d48cd16fb
The language codes sr-ec and sr-el are not conform to BCP 47.
BCP 47 explicit mentions sr-Latn and sr-Cyrl as examples.
This change adds support for the language codes sr-cyrl and sr-latn
as fallback languages of the language codes sr-ec and sr-el. This
allows to rename the message files and the system messages without
changing the language codes yet.
The next step is to rename the language codes in Translatewiki as
described in https://translatewiki.net/wiki/Renaming_language_codes
Also local system messages in MediaWiki:*/sr-ec and MediaWiki:*/sr-el
can moved to MediaWiki:*/sr-cyrl and MediaWiki:*/sr-latn.
The final step is the change I75da0af35a2066e7963e50c56c99daf1e07c55e6
to complete the rename of the language codes.
Bug: T117845
Change-Id: I666fbdea89ccf21aab6ca1849adf22813dec052e
Apparently, $wgLocaltimezone is set to the empty string in many
existing LocalSettings.php file, presumably because the installer
failed to detect the correct time zone.
The new code for handling automatic defaults will only trigger if
$wgLocaltimezone is null, not when it is otherwise empty.
This adds fallback code in strategic places to ensure that the empty
string is handled correctly.
Bug: T305093
Change-Id: I39226466f2bb6a36823ae9032fc62f981eabc64a
This implements config overrides with a HashConfig that is layered on
top of the base config, so we can move away from global variables.
Global variables are still updated using setMwGlobals, for compatibility
with code that is still reading configuration from global variables.
This fixes an issue with the default overrides not being applied to
global variables.
Change-Id: I1922d9b903dcafb83691c2d96790f72747eeef9c
The goal is to keep the actual default values for settings in the same
place as the setting is declared, and applied using the regular means
for loading the settings -- not in a separate piece of code that needs
to be loaded through some entirely different mechanism.
SetupDynamicConfig.php now contains a few categories of things:
* Post-processing of configuration settings, where already-set settings
are altered. This could be moved to MainConfigSchema too as a separate
set of methods.
* Processing of old aliases of settings (blacklist, slave) that are not
registered as settings anymore and therefore are not available to
MainConfigSchema. This could perhaps be moved to LocalSettings
processing somehow?
* Setting $wgUseEnotif, which is also not registered as a setting.
Easiest would be just to declare it as a setting and have it set
unconditionally.
* Setting the actual timezone to $wgLocaltimezone. This is not related
to configuration and should just be in Setup.php.
Bug: T305093
Change-Id: Ia5c23b52dbbfcb3d07ffcf5d3b7f2d7befba2a26
Unused since change I88754b52c2 (commit 9e95539fc9) – this was only used
for SessionProviders, which is now a map/object instead.
Change-Id: I8da686e6379eb33a63799874fb44f9b0030ab5ba
Besides being used for caching of the responses of GET requests,
the ETag and Last-Modified headers can be used with PUT and POST
requests to control the conditional execution of requests using
the If-Match and If-Unmodified-Since headers.
For that reason it is important to distinguish between the ETag and
modification date of a resource at the time a request is received
(before the resource is modified), and at the time the response is
being sent (after the resource has been modified). The before-state
is used to check conditionals, while the after-state can be sent back
to the client in the response.
For a GET request, it is reasonable to re-use the ETag and Last-Modified
values that were used to check conditionals in the response.
For PUT and POST, that would generally be wrong, since the resource has
since changed.
Bug: T311819
Change-Id: I1a09b0ef35ae2365e0b261fb5295003aec1f5b17
A library for storage of counter value time series statistics, based
around the observation that memcached getMulti() is apparently fast
enough to do this in a simple manner, with incremented values stored
in time window buckets.
Bug: T310662
Change-Id: I26b1cdba0a06ad16ad8bb71b455e1b6180924d17
DerivateContext::canUseWikiPage checks the derivated title before
calling the underlying request.
Let getWikiPage also use the derivated title first, before calling the
underlying request to be in sync
This avoids "MWException: RequestContext::getWikiPage called without
Title object set" when the derivated request has a title, but the
underlying request does not.
Bug: T297688
Change-Id: I72f5650986b5a6585dc4909b8fe49e39f60f6a14
Add test for the setter/getter of
Authority, Title, WikiPage and ActionName
Move the inital set into the test function, because some setter
resetting other properties and at test time the state is undefinded.
Also move the unconditional call of UserFactory::newFromAuthority into
::getUser to avoid calling MediaWikiServices from the unit tests
Change-Id: Ibf5eca24f056b2ee5388fa121674366424869f11
This adds support for JSONSchema style property declarations with nested
schemas. This is a step towards using more nested structured for
configuration, rather than adding to the over 700 keys already defined
in the main config schema.
Defaults from property schemas are aggregated into a default value in
the top level schema. Descriptions are however not yet aggregated.
Change-Id: Iaf46a9ecc83bee3566098c56137a1be66bff2ab9
This patch introduces a ParsoidOutputAccess service for
getting parsoid outputs and warms the cache with pregenerated
outputs.
It also introduces a config variable in ParsoidCacheConfig that
is turned off by default for controlling the cache warming.
Bug: T301371
Change-Id: I6152c42ea765d94093d8d62598b1b4278314adec
This changes handling of the If-Match header so a weak ETag coming from
the client may match a strong ETag generated by the handler.
This is needed because ETags may get "weakened" on the way to the client
by proxies and middleware, e.g. Varnish applying compression, see
<https://varnish-cache.org/docs/6.0/users-guide/compression.html>.
This behavior is technically a violation of RFC 7232 section 3.1, but it
should actually be safe: A client sending a weak ETag is still ok with
getting a strong match, and a handler that generates a strong ETag knows
that it can rely on strong semantics holding, even if the tag sent by
the client is weak.
Bug: T310710
Bug: T238849
Change-Id: I2a604f2f46719a5f74ddac1b1fa58c8a36910240
* Export nofollow and target settings in siteinfo API so that Parsoid's
developer mode of ApiSiteConfig works.
* Implement SiteConfig::getNoFollowConfig and
SiteConfig::getExternalLinkTarget, which are defined as abstract
in the parent class in Parsoid.
Bug: T186241
Change-Id: I6a1f12335be19509d4c5a17e2cae96ecdb677103
Added a EtcdSource to handle loading of settings from etcd. The
implementation is based on EtcdConfig but is much simpler due to
the reliance on the existing source caching layer.
GuzzleHttp\Client is used over MultiHttpClient as the latter depends on
MediaWikiServices and therefore should not be used during early
initialization.
A naive cache key is based on the etcd request URL, effectively
representing the etcd API version and settings directory, and uses
either the DNS SRV entry as the host name or the host name itself if
discovery is disabled.
The cache TTL is set to 10 seconds. The combination of this low TTL and
the naive key should replicate the current caching pattern of
EtcdConfig. Stale results are allowed for failover in case of temporary
unavailability.
At this time, the expiry weight was not changed from the suggested 1.0.
However, verification of this as a suitable early expiration coefficient
should be performed in a production like environment.
Bug: T296771
Change-Id: I782f4ee567a986fd23df1a84aec629e648a29066
* Verify that the fallback chain is not too long
* Add some other obvious tests and fix the files that fail them.
Bug: T310532
Change-Id: I00f3aed35e756a3985f9f16af6d4721e2b61d3f6
This introduces the ParsoidOutputStash config setting, which defines the
storage backend and cache duration. The storage backend name refers to
an entry in the ObjectCache setting, and defaults to the main stash.
Bug: T267990
Bug: T309016
Change-Id: Ic67dc43ed9843810e4b180127f9a3bb7608f7608
This moves the handling for the following parameters fully into the
MaintenanceRunner class:
--conf, --wiki, --globlas, --memory-limit, --server, --profiler
Change-Id: I63624ba1fcbcf446630eba1b81b2c84b1a943932
Rewrite the queries so that the column values of conflicted
proposed rows can be referenced in the SET expressions used to
update existing rows. Add IDatabase::buildExcludedValue() to
derive such references.
Make upsert() only use the first key in the unique key list as
the one to use for finding existing rows and merging them. Any
other key will just cause duplicate key errors/rollback upon
row collisions. For example, suppose a `user` table has unique
keys on both UUID and email address. It would be undesirable
for upsert() to clobber an existing `user` row just because
someone tried to make an account with the same email address.
Using upsert() makes sense when the following hold:
- The table has a single unique key that conveys "identity".
AUTOINCREMENT and UUID columns are particularly good here.
If row A existed at time t1, row B existed at time t2, and
both rows have matching values for this "identity key", then
they are conceptually the "same" row. It does not matter if
other columns differ or if the row was deleted and recreated.
- Any other unique keys are just business constraints unrelated
to the concept of identity. For example, an `accounts` table
might have ID, name, and email address each as unique keys.
- For each proposed row, upsert() looks for an existing row
that conflicts along the identity key. If there is one, then
it gets updated, otherwise, the proposed row is inserted.
Other unique key collisions result in operation rollback.
Bug: T113916
Change-Id: Iddd9f120ee966c76b3acb35e62ea14ec4c6f925d
Add Database::queryMulti(), which will execute an array of
queries as a batch with minimal roundtrips.
SQLite fallbacks to looping through each statement and
invoking doQuery().
Add QueryStatus class to reduce complexity in Database.
Rewrite doQuery() as doSingleStatementQuery().
Change-Id: I3d51083e36ab06fcc1d94558e51b38e106f71bb9
This change cleans up when and how we register autoloader info for
extensions.
This bumps CACHE_VERSION to 8, to avoid issues in case this patch gets
reverted: the new code doesn't copy the map of class files into
$info['globals']['AutoloadClasses']. If old code was to read a new cache
entry, autoloading would fail.
BREAKING CHANGE: The following methods have been removed from
ExtensionRegistry without deprecation and without replacement.
They had been introduced in 1.35 for use in the testing framework,
and were not in use by any known extension:
- exportAutoloadClassesAndNamespaces
- exportTestAutoloadClassesAndNamespaces
NOTE: breaks the hack that SocialProfile has in place for T243861.
Bug: T240535
Change-Id: I6e1ceac034c443d9475f1adc1babecddd6af6d05
When JSON support was introduced into ParserCache in 1.36, it was
controlled by a feature flag, $wgParserCacheUseJson. The feature flag
was "born deprecated" in 1.36. It can now be removed.
This means that ParserCache will always store entries as JSON.
Support for reading old non-JSON entries remains intact.
This is needed when updating wikis from a version older than 1.36
to the current version.
Change-Id: Id04e42bfb458d98414bac50e0d6c505e8878e5c0
Per RFC 7231 (https://www.rfc-editor.org/rfc/rfc7231#section-4.3.5), sending a body
with the DELETE method "has no defined semantics". Allow it, as it is useful for
passing the csrf token required by some authentication methods.
Bug: T309388
Change-Id: I9fb7f3c536af4636e33f776de32f9f90b88827c9
MediaWiki\Rest\Validator is largely a wrapper, but has some behavior
of its own which deserves testing.
Bug: T309388
Change-Id: Ida4be429fa6795a3494593c457b93ef8e4f68b3b
Versions of PECL xdiff older than 1.5.2 cannot be compiled against
PHP 5.4 and newer (we require PHP 7.2+). See changelog:
https://pecl.php.net/package-changelog.php?package=xdiff
Change-Id: I28d27fd3bbac6a42827a2b46f06f25657023cc10
MediaWiki has required this PHP extension for quite a while by now.
Furthermore, it is always available in PHP 7.4 and later.
Change-Id: Ifbf3400bca75351ea8fa461ca27259ee31543237
ResourceLoader's FilePath is designed to allow a FileModule
to include files that exist outside of the module's localBasePath,
to allow skins and extensions to extend core MediaWiki modules.
This is accomplished by having the FileModule use the FilePath's
localBasePath instead, in FileModule::getLocalPath.
(Similarly for remoteBasePath, but these are going out of fashion.)
However, the code processing 'packageFiles' did not handle this right:
it used FilePath's localBasePath when it appeared as a 'file',
but not when it was returned by a 'callback' or 'versionCallback',
using the FileModule's localBasePath instead in that case. Most
existing uses of FilePath in 'packageFiles' required the same base
path as the module, so it was convenient to avoid providing it twice.
To keep that convenience (already relied on by some extensions too)
while also allowing skins and extensions to add files from their own
directories to existing modules, the code processing 'packageFiles'
now uses FilePath's base paths in all cases, but they are optional,
and will fall back to the FileModule's paths when not provided.
Follow-up to 2890bca27d.
Change-Id: I38a0761ae4633a567b685b52c1d73b6ce280ffb7
This reverts parts of I8520d8cb16 and Ib941c22d6b7e.
The documentation of ShowExceptionDetails, as well as all other
uses of it (e.g. MWExeceptionRenderer for index.php, API, and
ResourceLoader) take it to mean to hide both exception message and
details.
This is why MWExceptionHandler didn't have, and didn't need,
the added complexity of this as a parameter as this method
simply wouldn't be called at all in that case.
* Rename the method added in I8520d8cb16 to match the one
in MWExceptionRenderer.
* Update REST handling to now print any exception details
when it is true.
* Remove the now-unused code introduced in Ib941c22d6b7e.
Change-Id: I1a9920dea0bafe315a20489efbe46ea9b55b0f74
We will need parameter handling in the runner as well as in the actual
maintenance script. So pull it out, so we can re-use it.
Change-Id: Ib67667fead8350e0a539323fb05b160f4c2d882e
Move ResourceLoader classes to their own namespace. Strip the
"ResourceLoader" prefix from all except ResourceLoader itself.
Move the tests by analogy.
I used a namespace alias "RL" in some callers since RL\Module is less
ambiguous at the call site than just "Module".
I did not address DependencyStore which continues to have a non-standard
location and namespace.
Revert of a241d83e0a.
Bug: T308718
Change-Id: Id08a220e1d6085e2b33f3f6c9d0e3935a4204659