2015-10-12 08:05:45 +00:00
|
|
|
<?php
|
2019-05-28 14:04:23 +00:00
|
|
|
|
2015-10-12 08:05:45 +00:00
|
|
|
namespace MediaWiki;
|
|
|
|
|
|
2018-03-22 16:36:25 +00:00
|
|
|
use ActorMigration;
|
2019-11-07 22:04:31 +00:00
|
|
|
use BagOStuff;
|
2021-06-22 19:28:29 +00:00
|
|
|
use CentralIdLookup;
|
2018-01-24 23:41:01 +00:00
|
|
|
use CommentStore;
|
2016-05-01 19:29:11 +00:00
|
|
|
use Config;
|
2015-10-12 08:05:45 +00:00
|
|
|
use ConfigFactory;
|
2019-11-07 22:04:31 +00:00
|
|
|
use ConfiguredReadOnlyMode;
|
2016-10-04 17:48:02 +00:00
|
|
|
use CryptHKDF;
|
Rehabilitate DateFormatter
This code is surprisingly little changed since I added the class in
November 2003, and needs some modernisation.
* Remove the "linked" option, unused since 1.21. Similarly, make the
"match-whole" option implied. This allows the regexes to be
simplified. Nothing will be broken, according to CodeSearch.
* Instead of ucfirst(), use the canonical month name from the language.
This will work with e.g. French which does not capitalise month names.
* Stop caching DateFormatter instances in APC. Caching was added
in 2005 when initialisation was being done on every request, but now
it is only needed when parsing a page with {{#formatdate}}, which is
rarely, and the constructor overhead is only 200µs after Language
object data initialisation. Instead, use an in-process cache via a
factory service.
* Add docs and extra tests.
* Remove todo note obsolete since 38 minutes after the original commit.
* Rename many variables.
* Use double-slash comments
* Don't store the Language object, just get arrays.
* Use mb_strtolower() instead of Language::lc() -- any customisation of
Language::lc() would break PCRE case-insensitive matching.
* Use named subpatterns instead of "keys"
* Remove the ISO1/ISO2 distinction, the only difference was linking.
* Use closure variables instead of temporary object members
Change-Id: I25fb1203dba2930724d7bc28ad0d51f59f88e1ea
2019-04-10 05:33:57 +00:00
|
|
|
use DateFormatterFactory;
|
2016-04-26 12:49:02 +00:00
|
|
|
use EventRelayerGroup;
|
2019-11-07 22:04:31 +00:00
|
|
|
use ExternalStoreAccess;
|
|
|
|
|
use ExternalStoreFactory;
|
2019-08-13 08:52:13 +00:00
|
|
|
use FileBackendGroup;
|
2016-05-07 12:15:44 +00:00
|
|
|
use GenderCache;
|
2015-10-12 08:05:45 +00:00
|
|
|
use GlobalVarConfig;
|
2019-03-15 00:23:26 +00:00
|
|
|
use HtmlCacheUpdater;
|
2017-07-08 00:19:39 +00:00
|
|
|
use IBufferingStatsdDataFactory;
|
2021-03-17 12:37:06 +00:00
|
|
|
use JobQueueGroup;
|
2020-02-07 02:24:00 +00:00
|
|
|
use JobRunner;
|
2019-11-07 22:04:31 +00:00
|
|
|
use Language;
|
2019-11-07 22:06:04 +00:00
|
|
|
use LinkCache;
|
2018-08-18 10:22:38 +00:00
|
|
|
use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
|
2019-05-01 13:56:41 +00:00
|
|
|
use LocalisationCache;
|
2019-11-07 22:06:04 +00:00
|
|
|
use MagicWordFactory;
|
|
|
|
|
use MediaHandlerFactory;
|
2021-03-21 22:34:04 +00:00
|
|
|
use MediaWiki\Actions\ActionFactory;
|
2019-11-08 21:24:00 +00:00
|
|
|
use MediaWiki\Auth\AuthManager;
|
Introduce infrastructure for partial blocks for actions
This adds a new type of block restriction for actions, which extends
AbstractRestriction. Like page and namespace restrictions, action
restrictions are stored in the ipblocks_restrictions table.
Blockable actions are defined in a BlockActionInfo service, with a
method for getting all the blockable actions, getAllBlockActions.
Action blocks are checked for in PermissionManager::checkUserBlock
using DatabaseBlock::appliesToRight. To make this work, this patch
also removes the 'edit' case from AbstractBlock::appliesToRight,
which always returned true. This was incorrect, as blocks do not
always apply to edit, so cases that called appliesToRight('edit')
were fixed before this commit. appliesToRight('edit') now returns
null (i.e. unsure), which is correct because it is not possible to
determine whether a block applies to editing a particular page
without knowing what that page is, and appliesToRight doesn't know
that page.
There are some flags on sitewide blocks that predate partial blocks,
which block particular actions: 'createaccount' and 'sendemail'.
These are still handled in AbstractBlock::appliesToRight, and are
still checked for separately in the peripheral components.
The feature flag $wgEnablePartialActionBlocks must set to true to
enable partial action blocks.
Bug: T279556
Bug: T6995
Change-Id: I17962bb7c4247a12c722e7bc6bcaf8c36efd8600
2021-04-26 23:07:17 +00:00
|
|
|
use MediaWiki\Block\BlockActionInfo;
|
2019-09-20 15:03:48 +00:00
|
|
|
use MediaWiki\Block\BlockErrorFormatter;
|
2019-04-05 19:13:17 +00:00
|
|
|
use MediaWiki\Block\BlockManager;
|
2020-05-07 18:50:24 +00:00
|
|
|
use MediaWiki\Block\BlockPermissionCheckerFactory;
|
2019-04-11 19:54:10 +00:00
|
|
|
use MediaWiki\Block\BlockRestrictionStore;
|
2020-04-23 19:33:56 +00:00
|
|
|
use MediaWiki\Block\BlockUserFactory;
|
2020-09-18 19:01:34 +00:00
|
|
|
use MediaWiki\Block\BlockUtils;
|
2020-05-08 06:29:23 +00:00
|
|
|
use MediaWiki\Block\DatabaseBlockStore;
|
2020-04-23 19:33:03 +00:00
|
|
|
use MediaWiki\Block\UnblockUserFactory;
|
2021-09-08 17:19:11 +00:00
|
|
|
use MediaWiki\Cache\BacklinkCacheFactory;
|
2019-10-19 11:08:40 +00:00
|
|
|
use MediaWiki\Cache\LinkBatchFactory;
|
2021-08-24 19:12:39 +00:00
|
|
|
use MediaWiki\Collation\CollationFactory;
|
2019-11-07 22:06:04 +00:00
|
|
|
use MediaWiki\Config\ConfigRepository;
|
2020-01-18 20:25:04 +00:00
|
|
|
use MediaWiki\Content\IContentHandlerFactory;
|
2021-07-21 01:03:59 +00:00
|
|
|
use MediaWiki\Content\Transform\ContentTransformer;
|
2020-04-25 04:21:55 +00:00
|
|
|
use MediaWiki\EditPage\SpamChecker;
|
2019-08-16 10:00:15 +00:00
|
|
|
use MediaWiki\FileBackend\FSFile\TempFSFileFactory;
|
2019-08-15 18:07:36 +00:00
|
|
|
use MediaWiki\FileBackend\LockManager\LockManagerGroupFactory;
|
2020-04-17 06:03:29 +00:00
|
|
|
use MediaWiki\HookContainer\HookContainer;
|
Hooks::run() call site migration
Migrate all callers of Hooks::run() to use the new
HookContainer/HookRunner system.
General principles:
* Use DI if it is already used. We're not changing the way state is
managed in this patch.
* HookContainer is always injected, not HookRunner. HookContainer
is a service, it's a more generic interface, it is the only
thing that provides isRegistered() which is needed in some cases,
and a HookRunner can be efficiently constructed from it
(confirmed by benchmark). Because HookContainer is needed
for object construction, it is also needed by all factories.
* "Ask your friendly local base class". Big hierarchies like
SpecialPage and ApiBase have getHookContainer() and getHookRunner()
methods in the base class, and classes that extend that base class
are not expected to know or care where the base class gets its
HookContainer from.
* ProtectedHookAccessorTrait provides protected getHookContainer() and
getHookRunner() methods, getting them from the global service
container. The point of this is to ease migration to DI by ensuring
that call sites ask their local friendly base class rather than
getting a HookRunner from the service container directly.
* Private $this->hookRunner. In some smaller classes where accessor
methods did not seem warranted, there is a private HookRunner property
which is accessed directly. Very rarely (two cases), there is a
protected property, for consistency with code that conventionally
assumes protected=private, but in cases where the class might actually
be overridden, a protected accessor is preferred over a protected
property.
* The last resort: Hooks::runner(). Mostly for static, file-scope and
global code. In a few cases it was used for objects with broken
construction schemes, out of horror or laziness.
Constructors with new required arguments:
* AuthManager
* BadFileLookup
* BlockManager
* ClassicInterwikiLookup
* ContentHandlerFactory
* ContentSecurityPolicy
* DefaultOptionsManager
* DerivedPageDataUpdater
* FullSearchResultWidget
* HtmlCacheUpdater
* LanguageFactory
* LanguageNameUtils
* LinkRenderer
* LinkRendererFactory
* LocalisationCache
* MagicWordFactory
* MessageCache
* NamespaceInfo
* PageEditStash
* PageHandlerFactory
* PageUpdater
* ParserFactory
* PermissionManager
* RevisionStore
* RevisionStoreFactory
* SearchEngineConfig
* SearchEngineFactory
* SearchFormWidget
* SearchNearMatcher
* SessionBackend
* SpecialPageFactory
* UserNameUtils
* UserOptionsManager
* WatchedItemQueryService
* WatchedItemStore
Constructors with new optional arguments:
* DefaultPreferencesFactory
* Language
* LinkHolderArray
* MovePage
* Parser
* ParserCache
* PasswordReset
* Router
setHookContainer() now required after construction:
* AuthenticationProvider
* ResourceLoaderModule
* SearchEngine
Change-Id: Id442b0dbe43aba84bd5cf801d86dedc768b082c7
2020-03-19 02:42:09 +00:00
|
|
|
use MediaWiki\HookContainer\HookRunner;
|
2018-01-16 23:11:08 +00:00
|
|
|
use MediaWiki\Http\HttpRequestFactory;
|
2019-11-07 22:06:04 +00:00
|
|
|
use MediaWiki\Interwiki\InterwikiLookup;
|
2021-03-17 12:37:06 +00:00
|
|
|
use MediaWiki\JobQueue\JobQueueGroupFactory;
|
2020-11-18 00:26:53 +00:00
|
|
|
use MediaWiki\Json\JsonCodec;
|
2020-01-23 18:39:23 +00:00
|
|
|
use MediaWiki\Languages\LanguageConverterFactory;
|
2018-08-07 13:17:16 +00:00
|
|
|
use MediaWiki\Languages\LanguageFactory;
|
2019-08-22 15:39:26 +00:00
|
|
|
use MediaWiki\Languages\LanguageFallback;
|
2019-05-02 14:23:42 +00:00
|
|
|
use MediaWiki\Languages\LanguageNameUtils;
|
2019-11-07 22:06:04 +00:00
|
|
|
use MediaWiki\Linker\LinkRenderer;
|
|
|
|
|
use MediaWiki\Linker\LinkRendererFactory;
|
2020-03-09 11:00:28 +00:00
|
|
|
use MediaWiki\Mail\IEmailer;
|
2020-05-30 19:10:58 +00:00
|
|
|
use MediaWiki\Page\ContentModelChangeFactory;
|
2021-08-20 19:56:10 +00:00
|
|
|
use MediaWiki\Page\DeletePageFactory;
|
2020-04-28 22:54:18 +00:00
|
|
|
use MediaWiki\Page\MergeHistoryFactory;
|
2019-05-01 11:39:45 +00:00
|
|
|
use MediaWiki\Page\MovePageFactory;
|
2021-02-09 11:08:36 +00:00
|
|
|
use MediaWiki\Page\PageStore;
|
2021-03-17 22:13:35 +00:00
|
|
|
use MediaWiki\Page\PageStoreFactory;
|
2020-09-30 19:25:29 +00:00
|
|
|
use MediaWiki\Page\ParserOutputAccess;
|
2021-03-26 22:56:39 +00:00
|
|
|
use MediaWiki\Page\RollbackPageFactory;
|
2020-07-27 13:24:05 +00:00
|
|
|
use MediaWiki\Page\WikiPageFactory;
|
2020-09-25 20:02:03 +00:00
|
|
|
use MediaWiki\Parser\ParserCacheFactory;
|
2021-01-05 23:08:09 +00:00
|
|
|
use MediaWiki\Permissions\GroupPermissionsLookup;
|
2019-03-07 20:02:07 +00:00
|
|
|
use MediaWiki\Permissions\PermissionManager;
|
2021-07-26 13:24:22 +00:00
|
|
|
use MediaWiki\Permissions\RestrictionStore;
|
2017-11-07 03:10:14 +00:00
|
|
|
use MediaWiki\Preferences\PreferencesFactory;
|
2020-06-02 21:24:59 +00:00
|
|
|
use MediaWiki\Revision\ContributionsLookup;
|
2019-11-07 22:06:04 +00:00
|
|
|
use MediaWiki\Revision\RevisionFactory;
|
|
|
|
|
use MediaWiki\Revision\RevisionLookup;
|
2018-08-07 16:52:40 +00:00
|
|
|
use MediaWiki\Revision\RevisionRenderer;
|
2019-11-07 22:06:04 +00:00
|
|
|
use MediaWiki\Revision\RevisionStore;
|
|
|
|
|
use MediaWiki\Revision\RevisionStoreFactory;
|
2018-11-19 11:39:56 +00:00
|
|
|
use MediaWiki\Revision\SlotRoleRegistry;
|
2019-05-01 11:39:45 +00:00
|
|
|
use MediaWiki\Shell\CommandFactory;
|
2020-09-11 03:21:24 +00:00
|
|
|
use MediaWiki\Shell\ShellboxClientFactory;
|
2020-02-21 00:01:43 +00:00
|
|
|
use MediaWiki\SpecialPage\SpecialPageFactory;
|
2017-11-15 12:02:40 +00:00
|
|
|
use MediaWiki\Storage\BlobStore;
|
2017-12-23 17:14:28 +00:00
|
|
|
use MediaWiki\Storage\BlobStoreFactory;
|
2018-01-16 13:53:22 +00:00
|
|
|
use MediaWiki\Storage\NameTableStore;
|
2018-09-04 01:59:03 +00:00
|
|
|
use MediaWiki\Storage\NameTableStoreFactory;
|
2019-11-07 22:06:04 +00:00
|
|
|
use MediaWiki\Storage\PageEditStash;
|
2021-07-16 17:32:30 +00:00
|
|
|
use MediaWiki\Storage\PageUpdaterFactory;
|
2020-07-06 11:47:22 +00:00
|
|
|
use MediaWiki\Storage\RevertedTagUpdateManager;
|
2021-02-18 16:51:12 +00:00
|
|
|
use MediaWiki\Tidy\TidyDriverBase;
|
2021-01-22 19:51:43 +00:00
|
|
|
use MediaWiki\User\ActorNormalization;
|
|
|
|
|
use MediaWiki\User\ActorStore;
|
|
|
|
|
use MediaWiki\User\ActorStoreFactory;
|
2020-10-30 17:33:33 +00:00
|
|
|
use MediaWiki\User\BotPasswordStore;
|
2021-06-22 19:28:29 +00:00
|
|
|
use MediaWiki\User\CentralId\CentralIdLookupFactory;
|
2020-04-04 03:39:01 +00:00
|
|
|
use MediaWiki\User\TalkPageNotificationManager;
|
2020-05-26 03:33:28 +00:00
|
|
|
use MediaWiki\User\UserEditTracker;
|
2020-05-23 03:48:21 +00:00
|
|
|
use MediaWiki\User\UserFactory;
|
2019-10-24 03:14:31 +00:00
|
|
|
use MediaWiki\User\UserGroupManager;
|
|
|
|
|
use MediaWiki\User\UserGroupManagerFactory;
|
2021-02-16 23:47:45 +00:00
|
|
|
use MediaWiki\User\UserIdentityLookup;
|
2020-10-02 02:21:23 +00:00
|
|
|
use MediaWiki\User\UserNamePrefixSearch;
|
Add a new UserNameUtils service
This replaces User::isValidUserName, ::isUsableName, ::isCreatableName,
::getCanonicalName, and ::isIP.
Unlike User::isIP, UserNameUtils::isIP will //not// return true
for IPv6 ranges.
UserNameUtils::isIPRange, like User::isIPRange, accepts a name and
simply calls IPUtils::isValidRange.
User::isValidUserName, ::isUsableName, ::isCreatableName,
::getCanonical, ::isIP, and ::isValidRange are all soft deprecated
A follow up patch will add this to the release notes, to avoid merge
conflicts.
Bug: T245231
Bug: T239527
Change-Id: I46684bc492bb74b728ff102971f6cdd4d746a50a
2020-02-23 23:52:44 +00:00
|
|
|
use MediaWiki\User\UserNameUtils;
|
2020-01-17 06:21:28 +00:00
|
|
|
use MediaWiki\User\UserOptionsLookup;
|
|
|
|
|
use MediaWiki\User\UserOptionsManager;
|
2021-03-26 22:24:43 +00:00
|
|
|
use MediaWiki\Watchlist\WatchlistManager;
|
2019-04-08 15:21:49 +00:00
|
|
|
use MessageCache;
|
2016-09-22 04:57:13 +00:00
|
|
|
use MimeAnalyzer;
|
2020-01-10 00:00:51 +00:00
|
|
|
use MWException;
|
2018-08-05 08:36:32 +00:00
|
|
|
use NamespaceInfo;
|
2016-05-13 19:27:06 +00:00
|
|
|
use ObjectCache;
|
2019-11-07 22:06:04 +00:00
|
|
|
use OldRevisionImporter;
|
2020-05-21 03:47:11 +00:00
|
|
|
use PageProps;
|
2016-08-16 20:47:43 +00:00
|
|
|
use Parser;
|
2017-05-30 00:10:16 +00:00
|
|
|
use ParserCache;
|
2018-08-03 08:25:15 +00:00
|
|
|
use ParserFactory;
|
2016-10-02 07:41:55 +00:00
|
|
|
use PasswordFactory;
|
2019-11-07 22:06:04 +00:00
|
|
|
use PasswordReset;
|
2016-09-22 02:52:06 +00:00
|
|
|
use ProxyLookup;
|
2019-11-07 22:04:31 +00:00
|
|
|
use ReadOnlyMode;
|
2019-05-01 12:54:54 +00:00
|
|
|
use RepoGroup;
|
2019-02-16 23:16:09 +00:00
|
|
|
use ResourceLoader;
|
2016-04-27 10:10:16 +00:00
|
|
|
use SearchEngine;
|
|
|
|
|
use SearchEngineConfig;
|
|
|
|
|
use SearchEngineFactory;
|
2015-10-12 08:05:45 +00:00
|
|
|
use SiteLookup;
|
|
|
|
|
use SiteStore;
|
2016-04-19 11:55:23 +00:00
|
|
|
use SkinFactory;
|
2019-11-07 22:06:04 +00:00
|
|
|
use TitleFactory;
|
2016-04-25 05:41:32 +00:00
|
|
|
use TitleFormatter;
|
|
|
|
|
use TitleParser;
|
2019-11-07 22:06:04 +00:00
|
|
|
use UploadRevisionImporter;
|
2020-05-18 20:12:34 +00:00
|
|
|
use UserCache;
|
2016-08-22 00:14:57 +00:00
|
|
|
use VirtualRESTServiceClient;
|
2019-11-07 22:04:31 +00:00
|
|
|
use WANObjectCache;
|
2019-11-07 22:06:04 +00:00
|
|
|
use WatchedItemQueryService;
|
|
|
|
|
use WatchedItemStoreInterface;
|
2021-05-14 23:16:34 +00:00
|
|
|
use WikiImporterFactory;
|
2019-11-07 22:06:04 +00:00
|
|
|
use Wikimedia\Message\IMessageFormatterFactory;
|
2020-09-07 09:30:43 +00:00
|
|
|
use Wikimedia\NonSerializable\NonSerializableTrait;
|
2019-08-21 16:10:30 +00:00
|
|
|
use Wikimedia\ObjectFactory;
|
2019-11-07 22:06:04 +00:00
|
|
|
use Wikimedia\Rdbms\ILoadBalancer;
|
2019-06-27 21:04:47 +00:00
|
|
|
use Wikimedia\Rdbms\LBFactory;
|
2021-01-06 05:23:15 +00:00
|
|
|
use Wikimedia\RequestTimeout\CriticalSectionProvider;
|
2019-11-07 22:06:04 +00:00
|
|
|
use Wikimedia\Services\NoSuchServiceException;
|
2018-12-10 17:33:38 +00:00
|
|
|
use Wikimedia\Services\SalvageableService;
|
|
|
|
|
use Wikimedia\Services\ServiceContainer;
|
2019-05-31 23:24:56 +00:00
|
|
|
use Wikimedia\UUID\GlobalIdGenerator;
|
2015-10-12 08:05:45 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Service locator for MediaWiki core services.
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
|
|
|
*
|
|
|
|
|
* @file
|
|
|
|
|
*
|
|
|
|
|
* @since 1.27
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* MediaWikiServices is the service locator for the application scope of MediaWiki.
|
|
|
|
|
* Its implemented as a simple configurable DI container.
|
|
|
|
|
* MediaWikiServices acts as a top level factory/registry for top level services, and builds
|
|
|
|
|
* the network of service objects that defines MediaWiki's application logic.
|
|
|
|
|
* It acts as an entry point to MediaWiki's dependency injection mechanism.
|
|
|
|
|
*
|
|
|
|
|
* Services are defined in the "wiring" array passed to the constructor,
|
|
|
|
|
* or by calling defineService().
|
|
|
|
|
*
|
2019-12-14 04:13:17 +00:00
|
|
|
* @see docs/Injection.md for an overview of using dependency injection in the
|
2015-10-12 08:05:45 +00:00
|
|
|
* MediaWiki code base.
|
|
|
|
|
*/
|
|
|
|
|
class MediaWikiServices extends ServiceContainer {
|
2020-09-07 09:30:43 +00:00
|
|
|
use NonSerializableTrait;
|
2015-10-12 08:05:45 +00:00
|
|
|
|
2020-12-22 14:51:13 +00:00
|
|
|
/**
|
|
|
|
|
* @var bool
|
|
|
|
|
*/
|
|
|
|
|
private static $globalInstanceAllowed = false;
|
|
|
|
|
|
2016-05-01 19:29:11 +00:00
|
|
|
/**
|
|
|
|
|
* @var MediaWikiServices|null
|
|
|
|
|
*/
|
|
|
|
|
private static $instance = null;
|
|
|
|
|
|
2020-12-22 14:51:13 +00:00
|
|
|
/**
|
|
|
|
|
* Allows a global service container instance to exist.
|
|
|
|
|
*
|
|
|
|
|
* This should be called only after configuration settings have been read and extensions
|
|
|
|
|
* have been registered. Any change made to configuration after this method has been called
|
|
|
|
|
* may be ineffective or even harmful.
|
|
|
|
|
*
|
|
|
|
|
* @see getInstance()
|
|
|
|
|
*
|
|
|
|
|
* @since 1.36
|
|
|
|
|
*/
|
|
|
|
|
public static function allowGlobalInstance() {
|
|
|
|
|
self::$globalInstanceAllowed = true;
|
|
|
|
|
|
|
|
|
|
if ( self::$instance ) {
|
|
|
|
|
// TODO: in 1.37, getInstance() should fail if $globalInstanceAllowed is false! (T153256)
|
|
|
|
|
// Until then, we have to reset service instances that have already been created.
|
|
|
|
|
// No need to warn here, getService() has already triggered a deprecation warning.
|
|
|
|
|
self::resetGlobalInstance( null, 'quick' );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-07 13:17:16 +00:00
|
|
|
/**
|
|
|
|
|
* Returns true if an instance has already been initialized. This can be used to avoid accessing
|
|
|
|
|
* services if it's not safe, such as in unit tests or early setup.
|
|
|
|
|
*
|
|
|
|
|
* @return bool
|
|
|
|
|
*/
|
|
|
|
|
public static function hasInstance() {
|
|
|
|
|
return self::$instance !== null;
|
|
|
|
|
}
|
|
|
|
|
|
2015-10-12 08:05:45 +00:00
|
|
|
/**
|
|
|
|
|
* Returns the global default instance of the top level service locator.
|
|
|
|
|
*
|
2020-12-22 14:51:13 +00:00
|
|
|
* @note if called before allowGlobalInstance(), this method will fail.
|
|
|
|
|
*
|
2016-05-07 12:22:17 +00:00
|
|
|
* @since 1.27
|
|
|
|
|
*
|
2015-10-12 08:05:45 +00:00
|
|
|
* The default instance is initialized using the service instantiator functions
|
|
|
|
|
* defined in ServiceWiring.php.
|
|
|
|
|
*
|
|
|
|
|
* @note This should only be called by static functions! The instance returned here
|
|
|
|
|
* should not be passed around! Objects that need access to a service should have
|
|
|
|
|
* that service injected into the constructor, never a service locator!
|
|
|
|
|
*
|
|
|
|
|
* @return MediaWikiServices
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public static function getInstance(): self {
|
2020-12-22 14:51:13 +00:00
|
|
|
// TODO: in 1.37, getInstance() should fail if $globalInstanceAllowed is false! (T153256)
|
|
|
|
|
if ( !self::$globalInstanceAllowed ) {
|
|
|
|
|
wfDeprecatedMsg( 'Premature access to service container', '1.36' );
|
|
|
|
|
}
|
|
|
|
|
|
2016-05-01 19:29:11 +00:00
|
|
|
if ( self::$instance === null ) {
|
2015-10-12 08:05:45 +00:00
|
|
|
// NOTE: constructing GlobalVarConfig here is not particularly pretty,
|
|
|
|
|
// but some information from the global scope has to be injected here,
|
|
|
|
|
// even if it's just a file name or database credentials to load
|
|
|
|
|
// configuration from.
|
2016-05-01 19:29:11 +00:00
|
|
|
$bootstrapConfig = new GlobalVarConfig();
|
2016-04-14 19:02:31 +00:00
|
|
|
self::$instance = self::newInstance( $bootstrapConfig, 'load' );
|
2015-10-12 08:05:45 +00:00
|
|
|
|
2020-02-10 14:47:46 +00:00
|
|
|
// Provides a traditional hook point to allow extensions to configure services.
|
|
|
|
|
// NOTE: Ideally this would be in newInstance() but it causes an infinite run loop
|
Hooks::run() call site migration
Migrate all callers of Hooks::run() to use the new
HookContainer/HookRunner system.
General principles:
* Use DI if it is already used. We're not changing the way state is
managed in this patch.
* HookContainer is always injected, not HookRunner. HookContainer
is a service, it's a more generic interface, it is the only
thing that provides isRegistered() which is needed in some cases,
and a HookRunner can be efficiently constructed from it
(confirmed by benchmark). Because HookContainer is needed
for object construction, it is also needed by all factories.
* "Ask your friendly local base class". Big hierarchies like
SpecialPage and ApiBase have getHookContainer() and getHookRunner()
methods in the base class, and classes that extend that base class
are not expected to know or care where the base class gets its
HookContainer from.
* ProtectedHookAccessorTrait provides protected getHookContainer() and
getHookRunner() methods, getting them from the global service
container. The point of this is to ease migration to DI by ensuring
that call sites ask their local friendly base class rather than
getting a HookRunner from the service container directly.
* Private $this->hookRunner. In some smaller classes where accessor
methods did not seem warranted, there is a private HookRunner property
which is accessed directly. Very rarely (two cases), there is a
protected property, for consistency with code that conventionally
assumes protected=private, but in cases where the class might actually
be overridden, a protected accessor is preferred over a protected
property.
* The last resort: Hooks::runner(). Mostly for static, file-scope and
global code. In a few cases it was used for objects with broken
construction schemes, out of horror or laziness.
Constructors with new required arguments:
* AuthManager
* BadFileLookup
* BlockManager
* ClassicInterwikiLookup
* ContentHandlerFactory
* ContentSecurityPolicy
* DefaultOptionsManager
* DerivedPageDataUpdater
* FullSearchResultWidget
* HtmlCacheUpdater
* LanguageFactory
* LanguageNameUtils
* LinkRenderer
* LinkRendererFactory
* LocalisationCache
* MagicWordFactory
* MessageCache
* NamespaceInfo
* PageEditStash
* PageHandlerFactory
* PageUpdater
* ParserFactory
* PermissionManager
* RevisionStore
* RevisionStoreFactory
* SearchEngineConfig
* SearchEngineFactory
* SearchFormWidget
* SearchNearMatcher
* SessionBackend
* SpecialPageFactory
* UserNameUtils
* UserOptionsManager
* WatchedItemQueryService
* WatchedItemStore
Constructors with new optional arguments:
* DefaultPreferencesFactory
* Language
* LinkHolderArray
* MovePage
* Parser
* ParserCache
* PasswordReset
* Router
setHookContainer() now required after construction:
* AuthenticationProvider
* ResourceLoaderModule
* SearchEngine
Change-Id: Id442b0dbe43aba84bd5cf801d86dedc768b082c7
2020-03-19 02:42:09 +00:00
|
|
|
$runner = new HookRunner( self::$instance->getHookContainer() );
|
|
|
|
|
$runner->onMediaWikiServices( self::$instance );
|
2020-02-10 14:47:46 +00:00
|
|
|
}
|
2016-05-01 19:29:11 +00:00
|
|
|
return self::$instance;
|
|
|
|
|
}
|
2015-10-12 08:05:45 +00:00
|
|
|
|
2020-12-22 14:51:13 +00:00
|
|
|
public function getService( $name ) {
|
|
|
|
|
// TODO: in 1.37, getInstance() should fail if $globalInstanceAllowed is false! (T153256)
|
|
|
|
|
if ( !self::$globalInstanceAllowed && $this === self::$instance ) {
|
|
|
|
|
wfDeprecatedMsg( "Premature access to service '$name'", '1.36', false, 3 );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return parent::getService( $name );
|
|
|
|
|
}
|
|
|
|
|
|
2016-05-01 19:29:11 +00:00
|
|
|
/**
|
|
|
|
|
* Replaces the global MediaWikiServices instance.
|
|
|
|
|
*
|
2016-05-07 12:22:17 +00:00
|
|
|
* @since 1.28
|
|
|
|
|
*
|
2016-05-01 19:29:11 +00:00
|
|
|
* @note This is for use in PHPUnit tests only!
|
|
|
|
|
*
|
|
|
|
|
* @throws MWException if called outside of PHPUnit tests.
|
|
|
|
|
*
|
|
|
|
|
* @param MediaWikiServices $services The new MediaWikiServices object.
|
|
|
|
|
*
|
|
|
|
|
* @return MediaWikiServices The old MediaWikiServices object, so it can be restored later.
|
|
|
|
|
*/
|
|
|
|
|
public static function forceGlobalInstance( MediaWikiServices $services ) {
|
2020-12-23 18:52:12 +00:00
|
|
|
if ( !defined( 'MW_PHPUNIT_TEST' ) && !defined( 'MW_PARSER_TEST' ) ) {
|
2016-05-01 19:29:11 +00:00
|
|
|
throw new MWException( __METHOD__ . ' must not be used outside unit tests.' );
|
2015-10-12 08:05:45 +00:00
|
|
|
}
|
|
|
|
|
|
2016-05-01 19:29:11 +00:00
|
|
|
$old = self::getInstance();
|
|
|
|
|
self::$instance = $services;
|
|
|
|
|
|
|
|
|
|
return $old;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Creates a new instance of MediaWikiServices and sets it as the global default
|
|
|
|
|
* instance. getInstance() will return a different MediaWikiServices object
|
2016-04-14 19:02:31 +00:00
|
|
|
* after every call to resetGlobalInstance().
|
2016-05-01 19:29:11 +00:00
|
|
|
*
|
2016-05-07 12:22:17 +00:00
|
|
|
* @since 1.28
|
|
|
|
|
*
|
2016-05-01 19:29:11 +00:00
|
|
|
* @warning This should not be used during normal operation. It is intended for use
|
|
|
|
|
* when the configuration has changed significantly since bootstrap time, e.g.
|
|
|
|
|
* during the installation process or during testing.
|
|
|
|
|
*
|
2016-04-14 19:02:31 +00:00
|
|
|
* @warning Calling resetGlobalInstance() may leave the application in an inconsistent
|
2016-05-01 19:29:11 +00:00
|
|
|
* state. Calling this is only safe under the ASSUMPTION that NO REFERENCE to
|
|
|
|
|
* any of the services managed by MediaWikiServices exist. If any service objects
|
|
|
|
|
* managed by the old MediaWikiServices instance remain in use, they may INTERFERE
|
|
|
|
|
* with the operation of the services managed by the new MediaWikiServices.
|
|
|
|
|
* Operating with a mix of services created by the old and the new
|
|
|
|
|
* MediaWikiServices instance may lead to INCONSISTENCIES and even DATA LOSS!
|
|
|
|
|
* Any class implementing LAZY LOADING is especially prone to this problem,
|
|
|
|
|
* since instances would typically retain a reference to a storage layer service.
|
|
|
|
|
*
|
|
|
|
|
* @see forceGlobalInstance()
|
|
|
|
|
* @see resetGlobalInstance()
|
|
|
|
|
* @see resetBetweenTest()
|
|
|
|
|
*
|
|
|
|
|
* @param Config|null $bootstrapConfig The Config object to be registered as the
|
|
|
|
|
* 'BootstrapConfig' service. This has to contain at least the information
|
|
|
|
|
* needed to set up the 'ConfigFactory' service. If not given, the bootstrap
|
|
|
|
|
* config of the old instance of MediaWikiServices will be re-used. If there
|
|
|
|
|
* was no previous instance, a new GlobalVarConfig object will be used to
|
|
|
|
|
* bootstrap the services.
|
|
|
|
|
*
|
2016-04-14 19:02:31 +00:00
|
|
|
* @param string $quick Set this to "quick" to allow expensive resources to be re-used.
|
|
|
|
|
* See SalvageableService for details.
|
|
|
|
|
*
|
2016-05-01 19:29:11 +00:00
|
|
|
* @throws MWException If called after MW_SERVICE_BOOTSTRAP_COMPLETE has been defined in
|
|
|
|
|
* Setup.php (unless MW_PHPUNIT_TEST or MEDIAWIKI_INSTALL or RUN_MAINTENANCE_IF_MAIN
|
|
|
|
|
* is defined).
|
|
|
|
|
*/
|
2016-04-14 19:02:31 +00:00
|
|
|
public static function resetGlobalInstance( Config $bootstrapConfig = null, $quick = '' ) {
|
2016-05-01 19:29:11 +00:00
|
|
|
if ( self::$instance === null ) {
|
|
|
|
|
// no global instance yet, nothing to reset
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
self::failIfResetNotAllowed( __METHOD__ );
|
|
|
|
|
|
|
|
|
|
if ( $bootstrapConfig === null ) {
|
|
|
|
|
$bootstrapConfig = self::$instance->getBootstrapConfig();
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-14 19:02:31 +00:00
|
|
|
$oldInstance = self::$instance;
|
2016-05-01 19:29:11 +00:00
|
|
|
|
2016-10-18 10:41:59 +00:00
|
|
|
self::$instance = self::newInstance( $bootstrapConfig, 'load' );
|
2020-02-10 14:47:46 +00:00
|
|
|
|
|
|
|
|
// Provides a traditional hook point to allow extensions to configure services.
|
2020-11-30 02:26:44 +00:00
|
|
|
$runner = new HookRunner( $oldInstance->getHookContainer() );
|
Hooks::run() call site migration
Migrate all callers of Hooks::run() to use the new
HookContainer/HookRunner system.
General principles:
* Use DI if it is already used. We're not changing the way state is
managed in this patch.
* HookContainer is always injected, not HookRunner. HookContainer
is a service, it's a more generic interface, it is the only
thing that provides isRegistered() which is needed in some cases,
and a HookRunner can be efficiently constructed from it
(confirmed by benchmark). Because HookContainer is needed
for object construction, it is also needed by all factories.
* "Ask your friendly local base class". Big hierarchies like
SpecialPage and ApiBase have getHookContainer() and getHookRunner()
methods in the base class, and classes that extend that base class
are not expected to know or care where the base class gets its
HookContainer from.
* ProtectedHookAccessorTrait provides protected getHookContainer() and
getHookRunner() methods, getting them from the global service
container. The point of this is to ease migration to DI by ensuring
that call sites ask their local friendly base class rather than
getting a HookRunner from the service container directly.
* Private $this->hookRunner. In some smaller classes where accessor
methods did not seem warranted, there is a private HookRunner property
which is accessed directly. Very rarely (two cases), there is a
protected property, for consistency with code that conventionally
assumes protected=private, but in cases where the class might actually
be overridden, a protected accessor is preferred over a protected
property.
* The last resort: Hooks::runner(). Mostly for static, file-scope and
global code. In a few cases it was used for objects with broken
construction schemes, out of horror or laziness.
Constructors with new required arguments:
* AuthManager
* BadFileLookup
* BlockManager
* ClassicInterwikiLookup
* ContentHandlerFactory
* ContentSecurityPolicy
* DefaultOptionsManager
* DerivedPageDataUpdater
* FullSearchResultWidget
* HtmlCacheUpdater
* LanguageFactory
* LanguageNameUtils
* LinkRenderer
* LinkRendererFactory
* LocalisationCache
* MagicWordFactory
* MessageCache
* NamespaceInfo
* PageEditStash
* PageHandlerFactory
* PageUpdater
* ParserFactory
* PermissionManager
* RevisionStore
* RevisionStoreFactory
* SearchEngineConfig
* SearchEngineFactory
* SearchFormWidget
* SearchNearMatcher
* SessionBackend
* SpecialPageFactory
* UserNameUtils
* UserOptionsManager
* WatchedItemQueryService
* WatchedItemStore
Constructors with new optional arguments:
* DefaultPreferencesFactory
* Language
* LinkHolderArray
* MovePage
* Parser
* ParserCache
* PasswordReset
* Router
setHookContainer() now required after construction:
* AuthenticationProvider
* ResourceLoaderModule
* SearchEngine
Change-Id: Id442b0dbe43aba84bd5cf801d86dedc768b082c7
2020-03-19 02:42:09 +00:00
|
|
|
$runner->onMediaWikiServices( self::$instance );
|
2020-02-10 14:47:46 +00:00
|
|
|
|
2016-04-14 19:02:31 +00:00
|
|
|
self::$instance->importWiring( $oldInstance, [ 'BootstrapConfig' ] );
|
|
|
|
|
|
|
|
|
|
if ( $quick === 'quick' ) {
|
|
|
|
|
self::$instance->salvage( $oldInstance );
|
|
|
|
|
} else {
|
|
|
|
|
$oldInstance->destroy();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-22 08:21:50 +00:00
|
|
|
/** @noinspection PhpDocSignatureInspection */
|
2019-05-11 01:17:43 +00:00
|
|
|
|
2016-04-14 19:02:31 +00:00
|
|
|
/**
|
|
|
|
|
* Salvages the state of any salvageable service instances in $other.
|
|
|
|
|
*
|
|
|
|
|
* @note $other will have been destroyed when salvage() returns.
|
|
|
|
|
*
|
|
|
|
|
* @param MediaWikiServices $other
|
|
|
|
|
*/
|
|
|
|
|
private function salvage( self $other ) {
|
|
|
|
|
foreach ( $this->getServiceNames() as $name ) {
|
MediaWikiServices: Don't assume, that old and new instances contains the same services
As the services, that are registered in MediaWikiServices can be changed by
extensions using the MediaWikiServices hook, it's not save to assume, that
the first created instance of MediaWikiServices (which could be created before
any extension is loaded, e.g. in ExtensionRegistry) contains the same services
as a later created one (in the reset process of resetGlobalInstance). Doing this
could result in a NoSuchServiceException, if an extension registers new services,
which aren't registered before the extension is loaded (as, in the reset process,
MediaWikiServices tries to minimize the service instantiation cost by preserving
services, that can be preserved).
This patch adds a check, if a service is registered in the MediaWikiServices object
that should be reset, before the salvage-logic tries to fetch the services. If the
service object does not exist, it simply skips it, as it will simply instantiated
later.
Follow up: Ie2ca3ff99aa74fffa9eb6c8faccab857dc0874f7
Follow up: I2a26b6af07a48ad15414a8428daa9cfcfe02e933
Bug: T143974
Change-Id: Ifc587d6138ab565c2f38eb0805acf0dd0473d433
2016-08-28 16:33:40 +00:00
|
|
|
// The service could be new in the new instance and not registered in the
|
|
|
|
|
// other instance (e.g. an extension that was loaded after the instantiation of
|
|
|
|
|
// the other instance. Skip this service in this case. See T143974
|
|
|
|
|
try {
|
|
|
|
|
$oldService = $other->peekService( $name );
|
|
|
|
|
} catch ( NoSuchServiceException $e ) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
2016-04-14 19:02:31 +00:00
|
|
|
|
|
|
|
|
if ( $oldService instanceof SalvageableService ) {
|
|
|
|
|
/** @var SalvageableService $newService */
|
|
|
|
|
$newService = $this->getService( $name );
|
|
|
|
|
$newService->salvage( $oldService );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$other->destroy();
|
2016-05-01 19:29:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Creates a new MediaWikiServices instance and initializes it according to the
|
|
|
|
|
* given $bootstrapConfig. In particular, all wiring files defined in the
|
|
|
|
|
* ServiceWiringFiles setting are loaded, and the MediaWikiServices hook is called.
|
|
|
|
|
*
|
2021-08-26 19:42:03 +00:00
|
|
|
* @param Config $bootstrapConfig The Config object to be registered as the
|
2016-04-14 19:02:31 +00:00
|
|
|
* 'BootstrapConfig' service.
|
|
|
|
|
*
|
|
|
|
|
* @param string $loadWiring set this to 'load' to load the wiring files specified
|
|
|
|
|
* in the 'ServiceWiringFiles' setting in $bootstrapConfig.
|
2016-05-01 19:29:11 +00:00
|
|
|
*
|
|
|
|
|
* @return MediaWikiServices
|
|
|
|
|
* @throws MWException
|
2016-04-14 19:02:31 +00:00
|
|
|
* @throws \FatalError
|
2016-05-01 19:29:11 +00:00
|
|
|
*/
|
2016-04-14 19:02:31 +00:00
|
|
|
private static function newInstance( Config $bootstrapConfig, $loadWiring = '' ) {
|
2016-05-01 19:29:11 +00:00
|
|
|
$instance = new self( $bootstrapConfig );
|
|
|
|
|
|
|
|
|
|
// Load the default wiring from the specified files.
|
2016-04-14 19:02:31 +00:00
|
|
|
if ( $loadWiring === 'load' ) {
|
|
|
|
|
$wiringFiles = $bootstrapConfig->get( 'ServiceWiringFiles' );
|
|
|
|
|
$instance->loadWiringFiles( $wiringFiles );
|
|
|
|
|
}
|
2016-05-01 19:29:11 +00:00
|
|
|
|
2015-10-12 08:05:45 +00:00
|
|
|
return $instance;
|
|
|
|
|
}
|
|
|
|
|
|
2016-05-01 19:29:11 +00:00
|
|
|
/**
|
|
|
|
|
* Disables all storage layer services. After calling this, any attempt to access the
|
|
|
|
|
* storage layer will result in an error. Use resetGlobalInstance() to restore normal
|
|
|
|
|
* operation.
|
|
|
|
|
*
|
2016-05-07 12:22:17 +00:00
|
|
|
* @since 1.28
|
|
|
|
|
*
|
2016-05-01 19:29:11 +00:00
|
|
|
* @warning This is intended for extreme situations only and should never be used
|
|
|
|
|
* while serving normal web requests. Legitimate use cases for this method include
|
|
|
|
|
* the installation process. Test fixtures may also use this, if the fixture relies
|
|
|
|
|
* on globalState.
|
|
|
|
|
*
|
|
|
|
|
* @see resetGlobalInstance()
|
|
|
|
|
* @see resetChildProcessServices()
|
|
|
|
|
*/
|
|
|
|
|
public static function disableStorageBackend() {
|
|
|
|
|
// TODO: also disable some Caches, JobQueues, etc
|
|
|
|
|
$destroy = [ 'DBLoadBalancer', 'DBLoadBalancerFactory' ];
|
|
|
|
|
$services = self::getInstance();
|
|
|
|
|
|
|
|
|
|
foreach ( $destroy as $name ) {
|
|
|
|
|
$services->disableService( $name );
|
|
|
|
|
}
|
2016-05-13 19:27:06 +00:00
|
|
|
|
|
|
|
|
ObjectCache::clear();
|
2016-05-01 19:29:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Resets any services that may have become stale after a child process
|
|
|
|
|
* returns from after pcntl_fork(). It's also safe, but generally unnecessary,
|
|
|
|
|
* to call this method from the parent process.
|
|
|
|
|
*
|
2016-05-07 12:22:17 +00:00
|
|
|
* @since 1.28
|
|
|
|
|
*
|
2016-05-01 19:29:11 +00:00
|
|
|
* @note This is intended for use in the context of process forking only!
|
|
|
|
|
*
|
|
|
|
|
* @see resetGlobalInstance()
|
|
|
|
|
* @see disableStorageBackend()
|
|
|
|
|
*/
|
|
|
|
|
public static function resetChildProcessServices() {
|
|
|
|
|
// NOTE: for now, just reset everything. Since we don't know the interdependencies
|
|
|
|
|
// between services, we can't do this more selectively at this time.
|
|
|
|
|
self::resetGlobalInstance();
|
|
|
|
|
|
|
|
|
|
// Child, reseed because there is no bug in PHP:
|
2016-10-13 05:34:26 +00:00
|
|
|
// https://bugs.php.net/bug.php?id=42465
|
2016-05-01 19:29:11 +00:00
|
|
|
mt_srand( getmypid() );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Resets the given service for testing purposes.
|
|
|
|
|
*
|
2016-05-07 12:22:17 +00:00
|
|
|
* @since 1.28
|
|
|
|
|
*
|
2016-05-01 19:29:11 +00:00
|
|
|
* @warning This is generally unsafe! Other services may still retain references
|
|
|
|
|
* to the stale service instance, leading to failures and inconsistencies. Subclasses
|
|
|
|
|
* may use this method to reset specific services under specific instances, but
|
|
|
|
|
* it should not be exposed to application logic.
|
|
|
|
|
*
|
|
|
|
|
* @note With proper dependency injection used throughout the codebase, this method
|
|
|
|
|
* should not be needed. It is provided to allow tests that pollute global service
|
|
|
|
|
* instances to clean up.
|
|
|
|
|
*
|
|
|
|
|
* @param string $name
|
2016-05-18 19:36:05 +00:00
|
|
|
* @param bool $destroy Whether the service instance should be destroyed if it exists.
|
2016-05-01 19:29:11 +00:00
|
|
|
* When set to false, any existing service instance will effectively be detached
|
|
|
|
|
* from the container.
|
|
|
|
|
*
|
|
|
|
|
* @throws MWException if called outside of PHPUnit tests.
|
|
|
|
|
*/
|
|
|
|
|
public function resetServiceForTesting( $name, $destroy = true ) {
|
|
|
|
|
if ( !defined( 'MW_PHPUNIT_TEST' ) && !defined( 'MW_PARSER_TEST' ) ) {
|
|
|
|
|
throw new MWException( 'resetServiceForTesting() must not be used outside unit tests.' );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->resetService( $name, $destroy );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Convenience method that throws an exception unless it is called during a phase in which
|
|
|
|
|
* resetting of global services is allowed. In general, services should not be reset
|
|
|
|
|
* individually, since that may introduce inconsistencies.
|
|
|
|
|
*
|
2016-05-07 12:22:17 +00:00
|
|
|
* @since 1.28
|
|
|
|
|
*
|
2016-05-01 19:29:11 +00:00
|
|
|
* This method will throw an exception if:
|
|
|
|
|
*
|
|
|
|
|
* - self::$resetInProgress is false (to allow all services to be reset together
|
|
|
|
|
* via resetGlobalInstance)
|
|
|
|
|
* - and MEDIAWIKI_INSTALL is not defined (to allow services to be reset during installation)
|
|
|
|
|
* - and MW_PHPUNIT_TEST is not defined (to allow services to be reset during testing)
|
|
|
|
|
*
|
|
|
|
|
* This method is intended to be used to safeguard against accidentally resetting
|
|
|
|
|
* global service instances that are not yet managed by MediaWikiServices. It is
|
|
|
|
|
* defined here in the MediaWikiServices services class to have a central place
|
|
|
|
|
* for managing service bootstrapping and resetting.
|
|
|
|
|
*
|
|
|
|
|
* @param string $method the name of the caller method, as given by __METHOD__.
|
|
|
|
|
*
|
|
|
|
|
* @throws MWException if called outside bootstrap mode.
|
|
|
|
|
*
|
|
|
|
|
* @see resetGlobalInstance()
|
|
|
|
|
* @see forceGlobalInstance()
|
|
|
|
|
* @see disableStorageBackend()
|
|
|
|
|
*/
|
|
|
|
|
public static function failIfResetNotAllowed( $method ) {
|
|
|
|
|
if ( !defined( 'MW_PHPUNIT_TEST' )
|
|
|
|
|
&& !defined( 'MW_PARSER_TEST' )
|
|
|
|
|
&& !defined( 'MEDIAWIKI_INSTALL' )
|
|
|
|
|
&& !defined( 'RUN_MAINTENANCE_IF_MAIN' )
|
|
|
|
|
&& defined( 'MW_SERVICE_BOOTSTRAP_COMPLETE' )
|
|
|
|
|
) {
|
|
|
|
|
throw new MWException( $method . ' may only be called during bootstrapping and unit tests!' );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-10-12 08:05:45 +00:00
|
|
|
/**
|
|
|
|
|
* @param Config $config The Config object to be registered as the 'BootstrapConfig' service.
|
|
|
|
|
* This has to contain at least the information needed to set up the 'ConfigFactory'
|
|
|
|
|
* service.
|
|
|
|
|
*/
|
|
|
|
|
public function __construct( Config $config ) {
|
|
|
|
|
parent::__construct();
|
|
|
|
|
|
2016-05-01 19:29:11 +00:00
|
|
|
// Register the given Config object as the bootstrap config service.
|
2021-02-10 22:31:02 +00:00
|
|
|
$this->defineService( 'BootstrapConfig', static function () use ( $config ) {
|
2015-10-12 08:05:45 +00:00
|
|
|
return $config;
|
|
|
|
|
} );
|
|
|
|
|
}
|
|
|
|
|
|
2016-05-01 19:29:11 +00:00
|
|
|
// CONVENIENCE GETTERS ////////////////////////////////////////////////////
|
|
|
|
|
|
2021-03-21 22:34:04 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.37
|
|
|
|
|
* @return ActionFactory
|
|
|
|
|
*/
|
|
|
|
|
public function getActionFactory(): ActionFactory {
|
|
|
|
|
return $this->getService( 'ActionFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2015-10-12 08:05:45 +00:00
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* @since 1.31
|
|
|
|
|
* @return ActorMigration
|
2015-10-12 08:05:45 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getActorMigration(): ActorMigration {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'ActorMigration' );
|
2015-10-12 08:05:45 +00:00
|
|
|
}
|
|
|
|
|
|
2021-01-22 19:51:43 +00:00
|
|
|
/**
|
2021-02-16 23:47:45 +00:00
|
|
|
* @return ActorNormalization
|
2021-01-22 19:51:43 +00:00
|
|
|
* @since 1.36
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getActorNormalization(): ActorNormalization {
|
2021-02-22 10:58:46 +00:00
|
|
|
return $this->getService( 'ActorNormalization' );
|
2021-01-22 19:51:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return ActorStore
|
|
|
|
|
* @since 1.36
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getActorStore(): ActorStore {
|
2021-02-16 23:47:45 +00:00
|
|
|
return $this->getService( 'ActorStore' );
|
2021-01-22 19:51:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @since 1.36
|
|
|
|
|
* @return ActorStoreFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getActorStoreFactory(): ActorStoreFactory {
|
2021-01-22 19:51:43 +00:00
|
|
|
return $this->getService( 'ActorStoreFactory' );
|
2015-10-12 08:05:45 +00:00
|
|
|
}
|
|
|
|
|
|
2019-11-08 21:24:00 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.35
|
|
|
|
|
* @return AuthManager
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getAuthManager(): AuthManager {
|
2019-11-08 21:24:00 +00:00
|
|
|
return $this->getService( 'AuthManager' );
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-08 17:19:11 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.37
|
|
|
|
|
* @return BacklinkCacheFactory
|
|
|
|
|
*/
|
|
|
|
|
public function getBacklinkCacheFactory(): BacklinkCacheFactory {
|
|
|
|
|
return $this->getService( 'BacklinkCacheFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-18 18:19:05 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.34
|
|
|
|
|
* @return BadFileLookup
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getBadFileLookup(): BadFileLookup {
|
2019-08-18 18:19:05 +00:00
|
|
|
return $this->getService( 'BadFileLookup' );
|
|
|
|
|
}
|
|
|
|
|
|
2015-10-12 08:05:45 +00:00
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* @since 1.31
|
|
|
|
|
* @return BlobStore
|
2015-10-12 08:05:45 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getBlobStore(): BlobStore {
|
2020-05-27 14:45:29 +00:00
|
|
|
return $this->getService( 'BlobStore' );
|
2015-10-12 08:05:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* @since 1.31
|
|
|
|
|
* @return BlobStoreFactory
|
2015-10-12 08:05:45 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getBlobStoreFactory(): BlobStoreFactory {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'BlobStoreFactory' );
|
2015-10-12 08:05:45 +00:00
|
|
|
}
|
|
|
|
|
|
Introduce infrastructure for partial blocks for actions
This adds a new type of block restriction for actions, which extends
AbstractRestriction. Like page and namespace restrictions, action
restrictions are stored in the ipblocks_restrictions table.
Blockable actions are defined in a BlockActionInfo service, with a
method for getting all the blockable actions, getAllBlockActions.
Action blocks are checked for in PermissionManager::checkUserBlock
using DatabaseBlock::appliesToRight. To make this work, this patch
also removes the 'edit' case from AbstractBlock::appliesToRight,
which always returned true. This was incorrect, as blocks do not
always apply to edit, so cases that called appliesToRight('edit')
were fixed before this commit. appliesToRight('edit') now returns
null (i.e. unsure), which is correct because it is not possible to
determine whether a block applies to editing a particular page
without knowing what that page is, and appliesToRight doesn't know
that page.
There are some flags on sitewide blocks that predate partial blocks,
which block particular actions: 'createaccount' and 'sendemail'.
These are still handled in AbstractBlock::appliesToRight, and are
still checked for separately in the peripheral components.
The feature flag $wgEnablePartialActionBlocks must set to true to
enable partial action blocks.
Bug: T279556
Bug: T6995
Change-Id: I17962bb7c4247a12c722e7bc6bcaf8c36efd8600
2021-04-26 23:07:17 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.37
|
|
|
|
|
* @return BlockActionInfo
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getBlockActionInfo(): BlockActionInfo {
|
Introduce infrastructure for partial blocks for actions
This adds a new type of block restriction for actions, which extends
AbstractRestriction. Like page and namespace restrictions, action
restrictions are stored in the ipblocks_restrictions table.
Blockable actions are defined in a BlockActionInfo service, with a
method for getting all the blockable actions, getAllBlockActions.
Action blocks are checked for in PermissionManager::checkUserBlock
using DatabaseBlock::appliesToRight. To make this work, this patch
also removes the 'edit' case from AbstractBlock::appliesToRight,
which always returned true. This was incorrect, as blocks do not
always apply to edit, so cases that called appliesToRight('edit')
were fixed before this commit. appliesToRight('edit') now returns
null (i.e. unsure), which is correct because it is not possible to
determine whether a block applies to editing a particular page
without knowing what that page is, and appliesToRight doesn't know
that page.
There are some flags on sitewide blocks that predate partial blocks,
which block particular actions: 'createaccount' and 'sendemail'.
These are still handled in AbstractBlock::appliesToRight, and are
still checked for separately in the peripheral components.
The feature flag $wgEnablePartialActionBlocks must set to true to
enable partial action blocks.
Bug: T279556
Bug: T6995
Change-Id: I17962bb7c4247a12c722e7bc6bcaf8c36efd8600
2021-04-26 23:07:17 +00:00
|
|
|
return $this->getService( 'BlockActionInfo' );
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-20 15:03:48 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.35
|
|
|
|
|
* @return BlockErrorFormatter
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getBlockErrorFormatter(): BlockErrorFormatter {
|
2019-09-20 15:03:48 +00:00
|
|
|
return $this->getService( 'BlockErrorFormatter' );
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-05 19:13:17 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.34
|
|
|
|
|
* @return BlockManager
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getBlockManager(): BlockManager {
|
2019-04-05 19:13:17 +00:00
|
|
|
return $this->getService( 'BlockManager' );
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-07 18:50:24 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.35
|
|
|
|
|
* @return BlockPermissionCheckerFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getBlockPermissionCheckerFactory(): BlockPermissionCheckerFactory {
|
2020-05-07 18:50:24 +00:00
|
|
|
return $this->getService( 'BlockPermissionCheckerFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-11 19:54:10 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.33
|
|
|
|
|
* @return BlockRestrictionStore
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getBlockRestrictionStore(): BlockRestrictionStore {
|
2019-04-11 19:54:10 +00:00
|
|
|
return $this->getService( 'BlockRestrictionStore' );
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-23 19:33:56 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.36
|
|
|
|
|
* @return BlockUserFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getBlockUserFactory(): BlockUserFactory {
|
2020-04-23 19:33:56 +00:00
|
|
|
return $this->getService( 'BlockUserFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-18 19:01:34 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.36
|
|
|
|
|
* @return BlockUtils
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getBlockUtils(): BlockUtils {
|
2020-09-18 19:01:34 +00:00
|
|
|
return $this->getService( 'BlockUtils' );
|
|
|
|
|
}
|
|
|
|
|
|
2015-10-12 08:05:45 +00:00
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* Returns the Config object containing the bootstrap configuration.
|
|
|
|
|
* Bootstrap configuration would typically include database credentials
|
|
|
|
|
* and other information that may be needed before the ConfigFactory
|
|
|
|
|
* service can be instantiated.
|
|
|
|
|
*
|
|
|
|
|
* @note This should only be used during bootstrapping, in particular
|
|
|
|
|
* when creating the MainConfig service. Application logic should
|
|
|
|
|
* use getMainConfig() to get a Config instances.
|
|
|
|
|
*
|
2016-05-07 12:22:17 +00:00
|
|
|
* @since 1.27
|
2018-08-03 08:05:44 +00:00
|
|
|
* @return Config
|
2015-10-12 08:05:45 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getBootstrapConfig(): Config {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'BootstrapConfig' );
|
2015-10-12 08:05:45 +00:00
|
|
|
}
|
|
|
|
|
|
2020-10-30 17:33:33 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.37
|
|
|
|
|
* @return BotPasswordStore
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getBotPasswordStore(): BotPasswordStore {
|
2020-10-30 17:33:33 +00:00
|
|
|
return $this->getService( 'BotPasswordStore' );
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-22 19:28:29 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.37
|
|
|
|
|
* @return CentralIdLookup
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getCentralIdLookup(): CentralIdLookup {
|
2021-06-22 19:28:29 +00:00
|
|
|
return $this->getService( 'CentralIdLookup' );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @since 1.37
|
|
|
|
|
* @return CentralIdLookupFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getCentralIdLookupFactory(): CentralIdLookupFactory {
|
2021-06-22 19:28:29 +00:00
|
|
|
return $this->getService( 'CentralIdLookupFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2015-10-12 08:05:45 +00:00
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* @since 1.32
|
|
|
|
|
* @return NameTableStore
|
2015-10-12 08:05:45 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getChangeTagDefStore(): NameTableStore {
|
2020-05-27 14:45:29 +00:00
|
|
|
return $this->getService( 'ChangeTagDefStore' );
|
2015-10-12 08:05:45 +00:00
|
|
|
}
|
|
|
|
|
|
2021-08-24 19:12:39 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.37
|
|
|
|
|
* @return CollationFactory
|
|
|
|
|
*/
|
|
|
|
|
public function getCollationFactory(): CollationFactory {
|
|
|
|
|
return $this->getService( 'CollationFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2015-10-30 22:04:52 +00:00
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* @since 1.31
|
|
|
|
|
* @return CommentStore
|
2015-10-30 22:04:52 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getCommentStore(): CommentStore {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'CommentStore' );
|
2015-10-30 22:04:52 +00:00
|
|
|
}
|
|
|
|
|
|
2016-04-11 18:28:17 +00:00
|
|
|
/**
|
2016-05-07 12:22:17 +00:00
|
|
|
* @since 1.27
|
2018-08-03 08:05:44 +00:00
|
|
|
* @return ConfigFactory
|
2016-04-11 18:28:17 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getConfigFactory(): ConfigFactory {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'ConfigFactory' );
|
2016-04-11 18:28:17 +00:00
|
|
|
}
|
|
|
|
|
|
2018-07-02 17:01:45 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.32
|
2018-08-03 08:05:44 +00:00
|
|
|
* @return ConfigRepository
|
2016-04-23 00:09:14 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getConfigRepository(): ConfigRepository {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'ConfigRepository' );
|
2016-04-23 00:09:14 +00:00
|
|
|
}
|
|
|
|
|
|
2016-04-03 08:37:11 +00:00
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* @since 1.29
|
2019-11-07 22:04:31 +00:00
|
|
|
* @return ConfiguredReadOnlyMode
|
2016-04-03 08:37:11 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getConfiguredReadOnlyMode(): ConfiguredReadOnlyMode {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'ConfiguredReadOnlyMode' );
|
2016-04-03 08:37:11 +00:00
|
|
|
}
|
|
|
|
|
|
2020-01-18 20:25:04 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.35
|
|
|
|
|
* @return IContentHandlerFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getContentHandlerFactory(): IContentHandlerFactory {
|
2020-01-18 20:25:04 +00:00
|
|
|
return $this->getService( 'ContentHandlerFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-03 08:37:11 +00:00
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* @since 1.32
|
2019-11-07 22:04:31 +00:00
|
|
|
* @return Language
|
2016-04-03 08:37:11 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getContentLanguage(): Language {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'ContentLanguage' );
|
2016-04-03 08:37:11 +00:00
|
|
|
}
|
|
|
|
|
|
2020-05-30 19:10:58 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.35
|
|
|
|
|
* @return ContentModelChangeFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getContentModelChangeFactory(): ContentModelChangeFactory {
|
2020-05-30 19:10:58 +00:00
|
|
|
return $this->getService( 'ContentModelChangeFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-03 08:37:11 +00:00
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* @since 1.31
|
|
|
|
|
* @return NameTableStore
|
2016-04-03 08:37:11 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getContentModelStore(): NameTableStore {
|
2020-05-27 14:45:29 +00:00
|
|
|
return $this->getService( 'ContentModelStore' );
|
2016-04-03 08:37:11 +00:00
|
|
|
}
|
|
|
|
|
|
2021-07-21 01:03:59 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.37
|
|
|
|
|
* @return ContentTransformer
|
|
|
|
|
*/
|
|
|
|
|
public function getContentTransformer(): ContentTransformer {
|
|
|
|
|
return $this->getService( 'ContentTransformer' );
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-02 21:24:59 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.35
|
|
|
|
|
* @return ContributionsLookup
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getContributionsLookup(): ContributionsLookup {
|
2020-06-02 21:24:59 +00:00
|
|
|
return $this->getService( 'ContributionsLookup' );
|
|
|
|
|
}
|
|
|
|
|
|
2021-01-06 05:23:15 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.36
|
|
|
|
|
* @return CriticalSectionProvider
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getCriticalSectionProvider(): CriticalSectionProvider {
|
2021-01-06 05:23:15 +00:00
|
|
|
return $this->getService( 'CriticalSectionProvider' );
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-19 11:55:23 +00:00
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* @since 1.28
|
|
|
|
|
* @return CryptHKDF
|
2016-04-19 11:55:23 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getCryptHKDF(): CryptHKDF {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'CryptHKDF' );
|
2016-04-19 11:55:23 +00:00
|
|
|
}
|
|
|
|
|
|
2020-05-08 06:29:23 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.36
|
|
|
|
|
* @return DatabaseBlockStore
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getDatabaseBlockStore(): DatabaseBlockStore {
|
2020-05-08 06:29:23 +00:00
|
|
|
return $this->getService( 'DatabaseBlockStore' );
|
|
|
|
|
}
|
|
|
|
|
|
Rehabilitate DateFormatter
This code is surprisingly little changed since I added the class in
November 2003, and needs some modernisation.
* Remove the "linked" option, unused since 1.21. Similarly, make the
"match-whole" option implied. This allows the regexes to be
simplified. Nothing will be broken, according to CodeSearch.
* Instead of ucfirst(), use the canonical month name from the language.
This will work with e.g. French which does not capitalise month names.
* Stop caching DateFormatter instances in APC. Caching was added
in 2005 when initialisation was being done on every request, but now
it is only needed when parsing a page with {{#formatdate}}, which is
rarely, and the constructor overhead is only 200µs after Language
object data initialisation. Instead, use an in-process cache via a
factory service.
* Add docs and extra tests.
* Remove todo note obsolete since 38 minutes after the original commit.
* Rename many variables.
* Use double-slash comments
* Don't store the Language object, just get arrays.
* Use mb_strtolower() instead of Language::lc() -- any customisation of
Language::lc() would break PCRE case-insensitive matching.
* Use named subpatterns instead of "keys"
* Remove the ISO1/ISO2 distinction, the only difference was linking.
* Use closure variables instead of temporary object members
Change-Id: I25fb1203dba2930724d7bc28ad0d51f59f88e1ea
2019-04-10 05:33:57 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.33
|
|
|
|
|
* @return DateFormatterFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getDateFormatterFactory(): DateFormatterFactory {
|
Rehabilitate DateFormatter
This code is surprisingly little changed since I added the class in
November 2003, and needs some modernisation.
* Remove the "linked" option, unused since 1.21. Similarly, make the
"match-whole" option implied. This allows the regexes to be
simplified. Nothing will be broken, according to CodeSearch.
* Instead of ucfirst(), use the canonical month name from the language.
This will work with e.g. French which does not capitalise month names.
* Stop caching DateFormatter instances in APC. Caching was added
in 2005 when initialisation was being done on every request, but now
it is only needed when parsing a page with {{#formatdate}}, which is
rarely, and the constructor overhead is only 200µs after Language
object data initialisation. Instead, use an in-process cache via a
factory service.
* Add docs and extra tests.
* Remove todo note obsolete since 38 minutes after the original commit.
* Rename many variables.
* Use double-slash comments
* Don't store the Language object, just get arrays.
* Use mb_strtolower() instead of Language::lc() -- any customisation of
Language::lc() would break PCRE case-insensitive matching.
* Use named subpatterns instead of "keys"
* Remove the ISO1/ISO2 distinction, the only difference was linking.
* Use closure variables instead of temporary object members
Change-Id: I25fb1203dba2930724d7bc28ad0d51f59f88e1ea
2019-04-10 05:33:57 +00:00
|
|
|
return $this->getService( 'DateFormatterFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2016-05-01 19:29:11 +00:00
|
|
|
/**
|
2016-05-07 12:22:17 +00:00
|
|
|
* @since 1.28
|
2019-06-27 21:04:47 +00:00
|
|
|
* @return ILoadBalancer The main DB load balancer for the local wiki.
|
2016-05-01 19:29:11 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getDBLoadBalancer(): ILoadBalancer {
|
2016-05-01 19:29:11 +00:00
|
|
|
return $this->getService( 'DBLoadBalancer' );
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-06 10:46:50 +00:00
|
|
|
/**
|
2016-05-07 12:22:17 +00:00
|
|
|
* @since 1.28
|
2018-08-03 08:05:44 +00:00
|
|
|
* @return LBFactory
|
2016-04-19 09:34:31 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getDBLoadBalancerFactory(): LBFactory {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'DBLoadBalancerFactory' );
|
2021-08-20 19:56:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @since 1.37
|
|
|
|
|
* @return DeletePageFactory
|
|
|
|
|
*/
|
|
|
|
|
public function getDeletePageFactory(): DeletePageFactory {
|
|
|
|
|
return $this->getService( 'DeletePageFactory' );
|
2016-04-19 09:34:31 +00:00
|
|
|
}
|
|
|
|
|
|
2020-03-09 11:00:28 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.35
|
|
|
|
|
* @return IEmailer
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getEmailer(): IEmailer {
|
2020-03-09 11:00:28 +00:00
|
|
|
return $this->getService( 'Emailer' );
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-02 07:04:17 +00:00
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* @since 1.27
|
|
|
|
|
* @return EventRelayerGroup
|
2016-10-02 07:04:17 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getEventRelayerGroup(): EventRelayerGroup {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'EventRelayerGroup' );
|
2016-10-02 07:04:17 +00:00
|
|
|
}
|
|
|
|
|
|
2018-02-27 06:24:46 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.34
|
2019-11-07 22:04:31 +00:00
|
|
|
* @return ExternalStoreAccess
|
2018-02-27 06:24:46 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getExternalStoreAccess(): ExternalStoreAccess {
|
2018-02-27 06:24:46 +00:00
|
|
|
return $this->getService( 'ExternalStoreAccess' );
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-04 17:48:02 +00:00
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* @since 1.31
|
2019-11-07 22:04:31 +00:00
|
|
|
* @return ExternalStoreFactory
|
2016-10-04 17:48:02 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getExternalStoreFactory(): ExternalStoreFactory {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'ExternalStoreFactory' );
|
2016-10-04 17:48:02 +00:00
|
|
|
}
|
|
|
|
|
|
2019-08-13 08:52:13 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.35
|
|
|
|
|
* @return FileBackendGroup
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getFileBackendGroup(): FileBackendGroup {
|
2019-08-13 08:52:13 +00:00
|
|
|
return $this->getService( 'FileBackendGroup' );
|
|
|
|
|
}
|
|
|
|
|
|
2016-07-26 02:19:25 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.28
|
2018-08-03 08:05:44 +00:00
|
|
|
* @return GenderCache
|
2016-07-26 02:19:25 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getGenderCache(): GenderCache {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'GenderCache' );
|
2016-07-26 02:19:25 +00:00
|
|
|
}
|
|
|
|
|
|
2019-05-31 23:24:56 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.35
|
|
|
|
|
* @return GlobalIdGenerator
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getGlobalIdGenerator(): GlobalIdGenerator {
|
2019-05-31 23:24:56 +00:00
|
|
|
return $this->getService( 'GlobalIdGenerator' );
|
|
|
|
|
}
|
|
|
|
|
|
2021-01-05 23:08:09 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.36
|
|
|
|
|
* @return GroupPermissionsLookup
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getGroupPermissionsLookup(): GroupPermissionsLookup {
|
2021-01-05 23:08:09 +00:00
|
|
|
return $this->getService( 'GroupPermissionsLookup' );
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-10 14:47:46 +00:00
|
|
|
/**
|
2020-04-30 13:08:50 +00:00
|
|
|
* @since 1.35
|
2020-02-10 14:47:46 +00:00
|
|
|
* @return HookContainer
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getHookContainer(): HookContainer {
|
2020-02-10 14:47:46 +00:00
|
|
|
return $this->getService( 'HookContainer' );
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-15 00:23:26 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.35
|
|
|
|
|
* @return HtmlCacheUpdater
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getHtmlCacheUpdater(): HtmlCacheUpdater {
|
2019-03-15 00:23:26 +00:00
|
|
|
return $this->getService( 'HtmlCacheUpdater' );
|
|
|
|
|
}
|
|
|
|
|
|
2016-09-22 04:57:13 +00:00
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* @since 1.31
|
|
|
|
|
* @return HttpRequestFactory
|
2016-09-22 04:57:13 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getHttpRequestFactory(): HttpRequestFactory {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'HttpRequestFactory' );
|
2016-09-22 04:57:13 +00:00
|
|
|
}
|
|
|
|
|
|
2016-09-22 02:52:06 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.28
|
2018-08-03 08:05:44 +00:00
|
|
|
* @return InterwikiLookup
|
2017-05-30 00:10:16 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getInterwikiLookup(): InterwikiLookup {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'InterwikiLookup' );
|
2017-05-30 00:10:16 +00:00
|
|
|
}
|
|
|
|
|
|
2021-03-17 12:37:06 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.37
|
|
|
|
|
* @return JobQueueGroup
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getJobQueueGroup(): JobQueueGroup {
|
2021-03-17 12:37:06 +00:00
|
|
|
return $this->getService( 'JobQueueGroup' );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @since 1.37
|
|
|
|
|
* @return JobQueueGroupFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getJobQueueGroupFactory(): JobQueueGroupFactory {
|
2021-03-17 12:37:06 +00:00
|
|
|
return $this->getService( 'JobQueueGroupFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-07 02:24:00 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.35
|
|
|
|
|
* @return JobRunner
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getJobRunner(): JobRunner {
|
2020-02-07 02:24:00 +00:00
|
|
|
return $this->getService( 'JobRunner' );
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-23 00:17:31 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.36
|
2020-11-18 00:26:53 +00:00
|
|
|
* @return JsonCodec
|
2020-10-23 00:17:31 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getJsonCodec(): JsonCodec {
|
2020-11-18 00:26:53 +00:00
|
|
|
return $this->getService( 'JsonCodec' );
|
2020-10-23 00:17:31 +00:00
|
|
|
}
|
|
|
|
|
|
2020-01-23 18:39:23 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.35
|
|
|
|
|
* @return LanguageConverterFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getLanguageConverterFactory(): LanguageConverterFactory {
|
2020-01-23 18:39:23 +00:00
|
|
|
return $this->getService( 'LanguageConverterFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-07 13:17:16 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.35
|
|
|
|
|
* @return LanguageFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getLanguageFactory(): LanguageFactory {
|
2018-08-07 13:17:16 +00:00
|
|
|
return $this->getService( 'LanguageFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-22 15:39:26 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.35
|
|
|
|
|
* @return LanguageFallback
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getLanguageFallback(): LanguageFallback {
|
2019-08-22 15:39:26 +00:00
|
|
|
return $this->getService( 'LanguageFallback' );
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-02 14:23:42 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.34
|
|
|
|
|
* @return LanguageNameUtils
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getLanguageNameUtils(): LanguageNameUtils {
|
2019-05-02 14:23:42 +00:00
|
|
|
return $this->getService( 'LanguageNameUtils' );
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-19 11:08:40 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.35
|
|
|
|
|
* @return LinkBatchFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getLinkBatchFactory(): LinkBatchFactory {
|
2019-10-19 11:08:40 +00:00
|
|
|
return $this->getService( 'LinkBatchFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2016-05-07 12:15:44 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.28
|
2018-08-03 08:05:44 +00:00
|
|
|
* @return LinkCache
|
2016-05-07 12:15:44 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getLinkCache(): LinkCache {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'LinkCache' );
|
2016-05-07 12:15:44 +00:00
|
|
|
}
|
2016-05-12 22:44:33 +00:00
|
|
|
|
|
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* LinkRenderer instance that can be used
|
|
|
|
|
* if no custom options are needed
|
|
|
|
|
*
|
2016-05-12 22:44:33 +00:00
|
|
|
* @since 1.28
|
2018-08-03 08:05:44 +00:00
|
|
|
* @return LinkRenderer
|
2016-05-12 22:44:33 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getLinkRenderer(): LinkRenderer {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'LinkRenderer' );
|
2016-05-12 22:44:33 +00:00
|
|
|
}
|
|
|
|
|
|
Add LinkRenderer (rewrite of Linker::link())
This is a rewrite of Linker::link() to a non-static, LinkTarget-based
interface. Users of plain Linker::link() with no options can use the
LinkRenderer instance provided by MediaWikiServices. Others that
have specific options should create and configure their own instance,
which can be used to create as many links as necessary.
The main entrypoints for making links are:
* ->makeLink( $target, $text, $attribs, $query );
* ->makeKnownLink( $target, $text, $attribs, $query );
* ->makeBrokenLink( $target, $text, $attribs, $query );
The order of the parameters are the same as Linker::link(), except
$options are now part of the LinkRenderer instance, and
known/broken status requires calling the function explicitly.
Additionally, instead of passing in raw $html for the link text, the
$text parameter will automatically be escaped unless it is specially
marked as safe HTML using the MediaWiki\Linker\HtmlArmor class.
The LinkBegin and LinkEnd hooks are now deprecated, but still function
for backwards-compatability. Clients should migrate to the nearly-
equivalent LinkRendererBegin and LinkRendererEnd hooks.
The main differences between the hooks are:
* Passing HtmlPageLinkRenderer object instead of deprecated DummyLinker
* Using LinkTarget instead of Title
* Begin hook can no longer change known/broken status of link. Use the
TitleIsAlwaysKnown hook for that.
* $options are no longer passed, they can be read (but shouldn't be
modified!) from the LinkRenderer object.
Bug: T469
Change-Id: I057cc86ae6404a080aa3c8e0e956ecbb10a897d5
2016-04-21 20:13:21 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.28
|
|
|
|
|
* @return LinkRendererFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getLinkRendererFactory(): LinkRendererFactory {
|
Add LinkRenderer (rewrite of Linker::link())
This is a rewrite of Linker::link() to a non-static, LinkTarget-based
interface. Users of plain Linker::link() with no options can use the
LinkRenderer instance provided by MediaWikiServices. Others that
have specific options should create and configure their own instance,
which can be used to create as many links as necessary.
The main entrypoints for making links are:
* ->makeLink( $target, $text, $attribs, $query );
* ->makeKnownLink( $target, $text, $attribs, $query );
* ->makeBrokenLink( $target, $text, $attribs, $query );
The order of the parameters are the same as Linker::link(), except
$options are now part of the LinkRenderer instance, and
known/broken status requires calling the function explicitly.
Additionally, instead of passing in raw $html for the link text, the
$text parameter will automatically be escaped unless it is specially
marked as safe HTML using the MediaWiki\Linker\HtmlArmor class.
The LinkBegin and LinkEnd hooks are now deprecated, but still function
for backwards-compatability. Clients should migrate to the nearly-
equivalent LinkRendererBegin and LinkRendererEnd hooks.
The main differences between the hooks are:
* Passing HtmlPageLinkRenderer object instead of deprecated DummyLinker
* Using LinkTarget instead of Title
* Begin hook can no longer change known/broken status of link. Use the
TitleIsAlwaysKnown hook for that.
* $options are no longer passed, they can be read (but shouldn't be
modified!) from the LinkRenderer object.
Bug: T469
Change-Id: I057cc86ae6404a080aa3c8e0e956ecbb10a897d5
2016-04-21 20:13:21 +00:00
|
|
|
return $this->getService( 'LinkRendererFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-01 13:56:41 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.34
|
|
|
|
|
* @return LocalisationCache
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getLocalisationCache(): LocalisationCache {
|
2019-05-01 13:56:41 +00:00
|
|
|
return $this->getService( 'LocalisationCache' );
|
|
|
|
|
}
|
|
|
|
|
|
Add LinkRenderer (rewrite of Linker::link())
This is a rewrite of Linker::link() to a non-static, LinkTarget-based
interface. Users of plain Linker::link() with no options can use the
LinkRenderer instance provided by MediaWikiServices. Others that
have specific options should create and configure their own instance,
which can be used to create as many links as necessary.
The main entrypoints for making links are:
* ->makeLink( $target, $text, $attribs, $query );
* ->makeKnownLink( $target, $text, $attribs, $query );
* ->makeBrokenLink( $target, $text, $attribs, $query );
The order of the parameters are the same as Linker::link(), except
$options are now part of the LinkRenderer instance, and
known/broken status requires calling the function explicitly.
Additionally, instead of passing in raw $html for the link text, the
$text parameter will automatically be escaped unless it is specially
marked as safe HTML using the MediaWiki\Linker\HtmlArmor class.
The LinkBegin and LinkEnd hooks are now deprecated, but still function
for backwards-compatability. Clients should migrate to the nearly-
equivalent LinkRendererBegin and LinkRendererEnd hooks.
The main differences between the hooks are:
* Passing HtmlPageLinkRenderer object instead of deprecated DummyLinker
* Using LinkTarget instead of Title
* Begin hook can no longer change known/broken status of link. Use the
TitleIsAlwaysKnown hook for that.
* $options are no longer passed, they can be read (but shouldn't be
modified!) from the LinkRenderer object.
Bug: T469
Change-Id: I057cc86ae6404a080aa3c8e0e956ecbb10a897d5
2016-04-21 20:13:21 +00:00
|
|
|
/**
|
2021-06-29 11:24:37 +00:00
|
|
|
* Returns the main server-local cache, yielding EmptyBagOStuff if there is none
|
2020-09-28 19:58:17 +00:00
|
|
|
*
|
|
|
|
|
* In web request mode, the cache should at least be shared among web workers.
|
|
|
|
|
* In CLI mode, the cache should at least be shared among processes run by the same user.
|
|
|
|
|
*
|
Add LinkRenderer (rewrite of Linker::link())
This is a rewrite of Linker::link() to a non-static, LinkTarget-based
interface. Users of plain Linker::link() with no options can use the
LinkRenderer instance provided by MediaWikiServices. Others that
have specific options should create and configure their own instance,
which can be used to create as many links as necessary.
The main entrypoints for making links are:
* ->makeLink( $target, $text, $attribs, $query );
* ->makeKnownLink( $target, $text, $attribs, $query );
* ->makeBrokenLink( $target, $text, $attribs, $query );
The order of the parameters are the same as Linker::link(), except
$options are now part of the LinkRenderer instance, and
known/broken status requires calling the function explicitly.
Additionally, instead of passing in raw $html for the link text, the
$text parameter will automatically be escaped unless it is specially
marked as safe HTML using the MediaWiki\Linker\HtmlArmor class.
The LinkBegin and LinkEnd hooks are now deprecated, but still function
for backwards-compatability. Clients should migrate to the nearly-
equivalent LinkRendererBegin and LinkRendererEnd hooks.
The main differences between the hooks are:
* Passing HtmlPageLinkRenderer object instead of deprecated DummyLinker
* Using LinkTarget instead of Title
* Begin hook can no longer change known/broken status of link. Use the
TitleIsAlwaysKnown hook for that.
* $options are no longer passed, they can be read (but shouldn't be
modified!) from the LinkRenderer object.
Bug: T469
Change-Id: I057cc86ae6404a080aa3c8e0e956ecbb10a897d5
2016-04-21 20:13:21 +00:00
|
|
|
* @since 1.28
|
2019-11-07 22:04:31 +00:00
|
|
|
* @return BagOStuff
|
Add LinkRenderer (rewrite of Linker::link())
This is a rewrite of Linker::link() to a non-static, LinkTarget-based
interface. Users of plain Linker::link() with no options can use the
LinkRenderer instance provided by MediaWikiServices. Others that
have specific options should create and configure their own instance,
which can be used to create as many links as necessary.
The main entrypoints for making links are:
* ->makeLink( $target, $text, $attribs, $query );
* ->makeKnownLink( $target, $text, $attribs, $query );
* ->makeBrokenLink( $target, $text, $attribs, $query );
The order of the parameters are the same as Linker::link(), except
$options are now part of the LinkRenderer instance, and
known/broken status requires calling the function explicitly.
Additionally, instead of passing in raw $html for the link text, the
$text parameter will automatically be escaped unless it is specially
marked as safe HTML using the MediaWiki\Linker\HtmlArmor class.
The LinkBegin and LinkEnd hooks are now deprecated, but still function
for backwards-compatability. Clients should migrate to the nearly-
equivalent LinkRendererBegin and LinkRendererEnd hooks.
The main differences between the hooks are:
* Passing HtmlPageLinkRenderer object instead of deprecated DummyLinker
* Using LinkTarget instead of Title
* Begin hook can no longer change known/broken status of link. Use the
TitleIsAlwaysKnown hook for that.
* $options are no longer passed, they can be read (but shouldn't be
modified!) from the LinkRenderer object.
Bug: T469
Change-Id: I057cc86ae6404a080aa3c8e0e956ecbb10a897d5
2016-04-21 20:13:21 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getLocalServerObjectCache(): BagOStuff {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'LocalServerObjectCache' );
|
Add LinkRenderer (rewrite of Linker::link())
This is a rewrite of Linker::link() to a non-static, LinkTarget-based
interface. Users of plain Linker::link() with no options can use the
LinkRenderer instance provided by MediaWikiServices. Others that
have specific options should create and configure their own instance,
which can be used to create as many links as necessary.
The main entrypoints for making links are:
* ->makeLink( $target, $text, $attribs, $query );
* ->makeKnownLink( $target, $text, $attribs, $query );
* ->makeBrokenLink( $target, $text, $attribs, $query );
The order of the parameters are the same as Linker::link(), except
$options are now part of the LinkRenderer instance, and
known/broken status requires calling the function explicitly.
Additionally, instead of passing in raw $html for the link text, the
$text parameter will automatically be escaped unless it is specially
marked as safe HTML using the MediaWiki\Linker\HtmlArmor class.
The LinkBegin and LinkEnd hooks are now deprecated, but still function
for backwards-compatability. Clients should migrate to the nearly-
equivalent LinkRendererBegin and LinkRendererEnd hooks.
The main differences between the hooks are:
* Passing HtmlPageLinkRenderer object instead of deprecated DummyLinker
* Using LinkTarget instead of Title
* Begin hook can no longer change known/broken status of link. Use the
TitleIsAlwaysKnown hook for that.
* $options are no longer passed, they can be read (but shouldn't be
modified!) from the LinkRenderer object.
Bug: T469
Change-Id: I057cc86ae6404a080aa3c8e0e956ecbb10a897d5
2016-04-21 20:13:21 +00:00
|
|
|
}
|
|
|
|
|
|
2019-08-15 18:07:36 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.34
|
|
|
|
|
* @return LockManagerGroupFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getLockManagerGroupFactory(): LockManagerGroupFactory {
|
2019-08-15 18:07:36 +00:00
|
|
|
return $this->getService( 'LockManagerGroupFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-25 05:41:32 +00:00
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* @since 1.32
|
|
|
|
|
* @return MagicWordFactory
|
2016-04-25 05:41:32 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getMagicWordFactory(): MagicWordFactory {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'MagicWordFactory' );
|
2016-04-25 05:41:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* Returns the Config object that provides configuration for MediaWiki core.
|
|
|
|
|
* This may or may not be the same object that is returned by getBootstrapConfig().
|
|
|
|
|
*
|
|
|
|
|
* @since 1.27
|
|
|
|
|
* @return Config
|
2016-04-25 05:41:32 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getMainConfig(): Config {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'MainConfig' );
|
2016-04-25 05:41:32 +00:00
|
|
|
}
|
2016-05-07 12:15:44 +00:00
|
|
|
|
2016-09-29 19:36:27 +00:00
|
|
|
/**
|
2021-06-29 11:24:37 +00:00
|
|
|
* Returns the main object stash, yielding EmptyBagOStuff if there is none
|
2020-09-28 19:58:17 +00:00
|
|
|
*
|
|
|
|
|
* The stash should be shared among all datacenters
|
|
|
|
|
*
|
2016-09-29 19:36:27 +00:00
|
|
|
* @since 1.28
|
2019-11-07 22:04:31 +00:00
|
|
|
* @return BagOStuff
|
2016-09-29 19:36:27 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getMainObjectStash(): BagOStuff {
|
2016-09-29 19:36:27 +00:00
|
|
|
return $this->getService( 'MainObjectStash' );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2021-06-29 11:24:37 +00:00
|
|
|
* Returns the main WAN cache, yielding EmptyBagOStuff if there is none
|
2020-09-28 19:58:17 +00:00
|
|
|
*
|
|
|
|
|
* The cache should relay any purge operations to all datacenterss
|
|
|
|
|
*
|
2016-09-29 19:36:27 +00:00
|
|
|
* @since 1.28
|
2019-11-07 22:04:31 +00:00
|
|
|
* @return WANObjectCache
|
2016-09-29 19:36:27 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getMainWANObjectCache(): WANObjectCache {
|
2016-09-29 19:36:27 +00:00
|
|
|
return $this->getService( 'MainWANObjectCache' );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @since 1.28
|
2018-08-03 08:05:44 +00:00
|
|
|
* @return MediaHandlerFactory
|
2016-09-29 19:36:27 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getMediaHandlerFactory(): MediaHandlerFactory {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'MediaHandlerFactory' );
|
2016-09-29 19:36:27 +00:00
|
|
|
}
|
|
|
|
|
|
2020-04-28 22:54:18 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.35
|
|
|
|
|
* @return MergeHistoryFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getMergeHistoryFactory(): MergeHistoryFactory {
|
2020-04-28 22:54:18 +00:00
|
|
|
return $this->getService( 'MergeHistoryFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-08 15:21:49 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.34
|
|
|
|
|
* @return MessageCache
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getMessageCache(): MessageCache {
|
2019-04-08 15:21:49 +00:00
|
|
|
return $this->getService( 'MessageCache' );
|
|
|
|
|
}
|
|
|
|
|
|
2019-07-15 10:24:38 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.34
|
|
|
|
|
* @return IMessageFormatterFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getMessageFormatterFactory(): IMessageFormatterFactory {
|
2019-07-15 10:24:38 +00:00
|
|
|
return $this->getService( 'MessageFormatterFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2016-08-22 00:14:57 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.28
|
2018-08-03 08:05:44 +00:00
|
|
|
* @return MimeAnalyzer
|
2016-08-22 00:14:57 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getMimeAnalyzer(): MimeAnalyzer {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'MimeAnalyzer' );
|
2016-08-22 00:14:57 +00:00
|
|
|
}
|
|
|
|
|
|
2019-05-01 11:39:45 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.34
|
|
|
|
|
* @return MovePageFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getMovePageFactory(): MovePageFactory {
|
2019-05-01 11:39:45 +00:00
|
|
|
return $this->getService( 'MovePageFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-04 01:59:03 +00:00
|
|
|
/**
|
2019-04-11 11:21:41 +00:00
|
|
|
* @since 1.34
|
2018-08-05 08:36:32 +00:00
|
|
|
* @return NamespaceInfo
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getNamespaceInfo(): NamespaceInfo {
|
2018-08-05 08:36:32 +00:00
|
|
|
return $this->getService( 'NamespaceInfo' );
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-10 10:36:02 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.32
|
|
|
|
|
* @return NameTableStoreFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getNameTableStoreFactory(): NameTableStoreFactory {
|
2019-04-10 10:36:02 +00:00
|
|
|
return $this->getService( 'NameTableStoreFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-21 16:10:30 +00:00
|
|
|
/**
|
|
|
|
|
* ObjectFactory is intended for instantiating "handlers" from declarative definitions,
|
|
|
|
|
* such as Action API modules, special pages, or REST API handlers.
|
|
|
|
|
*
|
|
|
|
|
* @since 1.34
|
|
|
|
|
* @return ObjectFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getObjectFactory(): ObjectFactory {
|
2019-08-21 16:10:30 +00:00
|
|
|
return $this->getService( 'ObjectFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-05 08:36:32 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.32
|
2018-08-03 08:05:44 +00:00
|
|
|
* @return OldRevisionImporter
|
2017-04-10 05:34:30 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getOldRevisionImporter(): OldRevisionImporter {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'OldRevisionImporter' );
|
2017-04-10 05:34:30 +00:00
|
|
|
}
|
|
|
|
|
|
2019-04-13 04:38:55 +00:00
|
|
|
/**
|
|
|
|
|
* @return PageEditStash
|
|
|
|
|
* @since 1.34
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getPageEditStash(): PageEditStash {
|
2019-04-13 04:38:55 +00:00
|
|
|
return $this->getService( 'PageEditStash' );
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-21 03:47:11 +00:00
|
|
|
/**
|
|
|
|
|
* @return PageProps
|
|
|
|
|
* @since 1.36
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getPageProps(): PageProps {
|
2020-05-21 03:47:11 +00:00
|
|
|
return $this->getService( 'PageProps' );
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-09 11:08:36 +00:00
|
|
|
/**
|
|
|
|
|
* @return PageStore
|
|
|
|
|
* @since 1.36
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getPageStore(): PageStore {
|
2021-02-09 11:08:36 +00:00
|
|
|
return $this->getService( 'PageStore' );
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-17 22:13:35 +00:00
|
|
|
/**
|
|
|
|
|
* @return PageStoreFactory
|
|
|
|
|
* @since 1.36
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getPageStoreFactory(): PageStoreFactory {
|
2021-03-17 22:13:35 +00:00
|
|
|
return $this->getService( 'PageStoreFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-16 17:32:30 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.37
|
|
|
|
|
* @return PageUpdaterFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getPageUpdaterFactory(): PageUpdaterFactory {
|
2021-07-16 17:32:30 +00:00
|
|
|
return $this->getService( 'PageUpdaterFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-10 05:34:30 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.29
|
2018-08-03 08:05:44 +00:00
|
|
|
* @return Parser
|
2017-04-10 05:34:30 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getParser(): Parser {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'Parser' );
|
2017-04-10 05:34:30 +00:00
|
|
|
}
|
|
|
|
|
|
2017-07-04 21:07:04 +00:00
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* @since 1.30
|
|
|
|
|
* @return ParserCache
|
2017-07-04 21:07:04 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getParserCache(): ParserCache {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'ParserCache' );
|
2017-07-04 21:07:04 +00:00
|
|
|
}
|
|
|
|
|
|
2020-09-25 20:02:03 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.36
|
|
|
|
|
* @return ParserCacheFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getParserCacheFactory(): ParserCacheFactory {
|
2020-09-25 20:02:03 +00:00
|
|
|
return $this->getService( 'ParserCacheFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-03 08:25:15 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.32
|
|
|
|
|
* @return ParserFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getParserFactory(): ParserFactory {
|
2018-08-03 08:25:15 +00:00
|
|
|
return $this->getService( 'ParserFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-30 19:25:29 +00:00
|
|
|
/**
|
|
|
|
|
* @return ParserOutputAccess
|
|
|
|
|
* @since 1.36
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getParserOutputAccess(): ParserOutputAccess {
|
2020-09-30 19:25:29 +00:00
|
|
|
return $this->getService( 'ParserOutputAccess' );
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-04 21:46:46 +00:00
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* @since 1.32
|
|
|
|
|
* @return PasswordFactory
|
2017-07-04 21:46:46 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getPasswordFactory(): PasswordFactory {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'PasswordFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-10 02:49:12 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.34
|
|
|
|
|
* @return PasswordReset
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getPasswordReset(): PasswordReset {
|
2019-09-10 02:49:12 +00:00
|
|
|
return $this->getService( 'PasswordReset' );
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-03 08:05:44 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.32
|
2018-08-18 10:22:38 +00:00
|
|
|
* @return StatsdDataFactoryInterface
|
2018-08-03 08:05:44 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getPerDbNameStatsdDataFactory(): StatsdDataFactoryInterface {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'PerDbNameStatsdDataFactory' );
|
2017-07-04 21:46:46 +00:00
|
|
|
}
|
|
|
|
|
|
2019-03-07 20:02:07 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.33
|
|
|
|
|
* @return PermissionManager
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getPermissionManager(): PermissionManager {
|
2019-03-07 20:02:07 +00:00
|
|
|
return $this->getService( 'PermissionManager' );
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-04 21:46:46 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.31
|
2018-08-03 08:05:44 +00:00
|
|
|
* @return PreferencesFactory
|
2017-07-04 21:46:46 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getPreferencesFactory(): PreferencesFactory {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'PreferencesFactory' );
|
2017-07-04 21:46:46 +00:00
|
|
|
}
|
|
|
|
|
|
2017-10-07 02:26:52 +00:00
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* @since 1.28
|
|
|
|
|
* @return ProxyLookup
|
2017-10-07 02:26:52 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getProxyLookup(): ProxyLookup {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'ProxyLookup' );
|
2017-10-07 02:26:52 +00:00
|
|
|
}
|
|
|
|
|
|
2017-11-14 11:17:34 +00:00
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* @since 1.29
|
2019-11-07 22:04:31 +00:00
|
|
|
* @return ReadOnlyMode
|
2017-11-14 11:17:34 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getReadOnlyMode(): ReadOnlyMode {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'ReadOnlyMode' );
|
2017-11-14 11:17:34 +00:00
|
|
|
}
|
|
|
|
|
|
2019-05-01 12:54:54 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.34
|
|
|
|
|
* @return RepoGroup
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getRepoGroup(): RepoGroup {
|
2019-05-01 12:54:54 +00:00
|
|
|
return $this->getService( 'RepoGroup' );
|
|
|
|
|
}
|
|
|
|
|
|
2019-02-16 23:16:09 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.33
|
|
|
|
|
* @return ResourceLoader
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getResourceLoader(): ResourceLoader {
|
2019-02-16 23:16:09 +00:00
|
|
|
return $this->getService( 'ResourceLoader' );
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-26 13:24:22 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.37
|
|
|
|
|
* @return RestrictionStore
|
|
|
|
|
*/
|
|
|
|
|
public function getRestrictionStore(): RestrictionStore {
|
|
|
|
|
return $this->getService( 'RestrictionStore' );
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-06 11:47:22 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.36
|
|
|
|
|
* @return RevertedTagUpdateManager
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getRevertedTagUpdateManager(): RevertedTagUpdateManager {
|
2020-07-06 11:47:22 +00:00
|
|
|
return $this->getService( 'RevertedTagUpdateManager' );
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-23 17:14:28 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.31
|
2018-08-03 08:05:44 +00:00
|
|
|
* @return RevisionFactory
|
2017-12-23 17:14:28 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getRevisionFactory(): RevisionFactory {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'RevisionFactory' );
|
2017-12-23 17:14:28 +00:00
|
|
|
}
|
|
|
|
|
|
2017-11-15 12:02:40 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.31
|
2018-08-03 08:05:44 +00:00
|
|
|
* @return RevisionLookup
|
2017-11-15 12:02:40 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getRevisionLookup(): RevisionLookup {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'RevisionLookup' );
|
2017-11-15 12:02:40 +00:00
|
|
|
}
|
|
|
|
|
|
2018-08-07 16:52:40 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.32
|
|
|
|
|
* @return RevisionRenderer
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getRevisionRenderer(): RevisionRenderer {
|
2018-08-07 16:52:40 +00:00
|
|
|
return $this->getService( 'RevisionRenderer' );
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-15 12:02:40 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.31
|
|
|
|
|
* @return RevisionStore
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getRevisionStore(): RevisionStore {
|
2017-11-15 12:02:40 +00:00
|
|
|
return $this->getService( 'RevisionStore' );
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-27 12:16:35 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.32
|
|
|
|
|
* @return RevisionStoreFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getRevisionStoreFactory(): RevisionStoreFactory {
|
2018-06-27 12:16:35 +00:00
|
|
|
return $this->getService( 'RevisionStoreFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-26 22:56:39 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.37
|
|
|
|
|
* @return RollbackPageFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getRollbackPageFactory(): RollbackPageFactory {
|
2021-03-26 22:56:39 +00:00
|
|
|
return $this->getService( 'RollbackPageFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-09 08:53:38 +00:00
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* @since 1.27
|
|
|
|
|
* @return SearchEngine
|
2018-01-09 08:53:38 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function newSearchEngine(): SearchEngine {
|
2018-08-03 08:05:44 +00:00
|
|
|
// New engine object every time, since they keep state
|
|
|
|
|
return $this->getService( 'SearchEngineFactory' )->create();
|
2018-01-09 08:53:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* @since 1.27
|
|
|
|
|
* @return SearchEngineConfig
|
2018-01-09 08:53:38 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getSearchEngineConfig(): SearchEngineConfig {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'SearchEngineConfig' );
|
2018-01-09 08:53:38 +00:00
|
|
|
}
|
|
|
|
|
|
2018-01-16 13:53:22 +00:00
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* @since 1.27
|
|
|
|
|
* @return SearchEngineFactory
|
2018-01-16 13:53:22 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getSearchEngineFactory(): SearchEngineFactory {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'SearchEngineFactory' );
|
2018-01-16 13:53:22 +00:00
|
|
|
}
|
|
|
|
|
|
2020-09-11 03:21:24 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.36
|
|
|
|
|
* @return ShellboxClientFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getShellboxClientFactory(): ShellboxClientFactory {
|
2020-09-11 03:21:24 +00:00
|
|
|
return $this->getService( 'ShellboxClientFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-16 13:53:22 +00:00
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* @since 1.30
|
|
|
|
|
* @return CommandFactory
|
2018-01-16 13:53:22 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getShellCommandFactory(): CommandFactory {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'ShellCommandFactory' );
|
2018-01-16 13:53:22 +00:00
|
|
|
}
|
|
|
|
|
|
2018-06-21 06:59:02 +00:00
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* @since 1.27
|
|
|
|
|
* @return SiteLookup
|
2018-06-21 06:59:02 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getSiteLookup(): SiteLookup {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'SiteLookup' );
|
2018-06-21 06:59:02 +00:00
|
|
|
}
|
|
|
|
|
|
2017-11-07 03:10:14 +00:00
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* @since 1.27
|
|
|
|
|
* @return SiteStore
|
2017-11-07 03:10:14 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getSiteStore(): SiteStore {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'SiteStore' );
|
2017-11-07 03:10:14 +00:00
|
|
|
}
|
|
|
|
|
|
2018-01-16 23:11:08 +00:00
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* @since 1.27
|
|
|
|
|
* @return SkinFactory
|
2018-01-16 23:11:08 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getSkinFactory(): SkinFactory {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'SkinFactory' );
|
2018-01-16 23:11:08 +00:00
|
|
|
}
|
|
|
|
|
|
2018-11-19 11:39:56 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.33
|
|
|
|
|
* @return SlotRoleRegistry
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getSlotRoleRegistry(): SlotRoleRegistry {
|
2018-11-19 11:39:56 +00:00
|
|
|
return $this->getService( 'SlotRoleRegistry' );
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-24 23:41:01 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.31
|
2018-08-03 08:05:44 +00:00
|
|
|
* @return NameTableStore
|
2018-01-24 23:41:01 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getSlotRoleStore(): NameTableStore {
|
2020-05-27 14:45:29 +00:00
|
|
|
return $this->getService( 'SlotRoleStore' );
|
2018-01-24 23:41:01 +00:00
|
|
|
}
|
|
|
|
|
|
2020-04-25 04:21:55 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.35
|
|
|
|
|
* @return SpamChecker
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getSpamChecker(): SpamChecker {
|
2020-04-25 04:21:55 +00:00
|
|
|
return $this->getService( 'SpamChecker' );
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-07 10:58:31 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.32
|
|
|
|
|
* @return SpecialPageFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getSpecialPageFactory(): SpecialPageFactory {
|
2018-08-07 10:58:31 +00:00
|
|
|
return $this->getService( 'SpecialPageFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-12 17:12:29 +00:00
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* @since 1.27
|
|
|
|
|
* @return IBufferingStatsdDataFactory
|
2017-09-12 17:12:29 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getStatsdDataFactory(): IBufferingStatsdDataFactory {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'StatsdDataFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-04 03:39:01 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.35
|
|
|
|
|
* @return TalkPageNotificationManager
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getTalkPageNotificationManager(): TalkPageNotificationManager {
|
2020-04-04 03:39:01 +00:00
|
|
|
return $this->getService( 'TalkPageNotificationManager' );
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-16 10:00:15 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.34
|
|
|
|
|
* @return TempFSFileFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getTempFSFileFactory(): TempFSFileFactory {
|
2019-08-16 10:00:15 +00:00
|
|
|
return $this->getService( 'TempFSFileFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-18 16:51:12 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.36
|
|
|
|
|
* @return TidyDriverBase
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getTidy(): TidyDriverBase {
|
2021-02-18 16:51:12 +00:00
|
|
|
return $this->getService( 'Tidy' );
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-17 16:48:39 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.35
|
|
|
|
|
* @return TitleFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getTitleFactory(): TitleFactory {
|
2019-10-17 16:48:39 +00:00
|
|
|
return $this->getService( 'TitleFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-03 08:05:44 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.28
|
|
|
|
|
* @return TitleFormatter
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getTitleFormatter(): TitleFormatter {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'TitleFormatter' );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @since 1.28
|
|
|
|
|
* @return TitleParser
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getTitleParser(): TitleParser {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'TitleParser' );
|
2017-09-12 17:12:29 +00:00
|
|
|
}
|
|
|
|
|
|
2020-04-23 19:33:03 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.36
|
|
|
|
|
* @return UnblockUserFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getUnblockUserFactory(): UnblockUserFactory {
|
2020-04-23 19:33:03 +00:00
|
|
|
return $this->getService( 'UnblockUserFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-29 09:31:27 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.32
|
|
|
|
|
* @return UploadRevisionImporter
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getUploadRevisionImporter(): UploadRevisionImporter {
|
2018-06-29 09:31:27 +00:00
|
|
|
return $this->getService( 'UploadRevisionImporter' );
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-18 20:12:34 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.36
|
|
|
|
|
* @return UserCache
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getUserCache(): UserCache {
|
2020-05-18 20:12:34 +00:00
|
|
|
return $this->getService( 'UserCache' );
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-26 03:33:28 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.35
|
|
|
|
|
* @return UserEditTracker
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getUserEditTracker(): UserEditTracker {
|
2020-05-26 03:33:28 +00:00
|
|
|
return $this->getService( 'UserEditTracker' );
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-23 03:48:21 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.35
|
|
|
|
|
* @return UserFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getUserFactory(): UserFactory {
|
2020-05-23 03:48:21 +00:00
|
|
|
return $this->getService( 'UserFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-24 03:14:31 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.35
|
|
|
|
|
* @return UserGroupManager
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getUserGroupManager(): UserGroupManager {
|
2019-10-24 03:14:31 +00:00
|
|
|
return $this->getService( 'UserGroupManager' );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @since 1.35
|
|
|
|
|
* @return UserGroupManagerFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getUserGroupManagerFactory(): UserGroupManagerFactory {
|
2019-10-24 03:14:31 +00:00
|
|
|
return $this->getService( 'UserGroupManagerFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-16 23:47:45 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.36
|
|
|
|
|
* @return UserIdentityLookup
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getUserIdentityLookup(): UserIdentityLookup {
|
2021-02-16 23:47:45 +00:00
|
|
|
return $this->getService( 'UserIdentityLookup' );
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-02 02:21:23 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.36
|
|
|
|
|
* @return UserNamePrefixSearch
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getUserNamePrefixSearch(): UserNamePrefixSearch {
|
2020-10-02 02:21:23 +00:00
|
|
|
return $this->getService( 'UserNamePrefixSearch' );
|
|
|
|
|
}
|
|
|
|
|
|
Add a new UserNameUtils service
This replaces User::isValidUserName, ::isUsableName, ::isCreatableName,
::getCanonicalName, and ::isIP.
Unlike User::isIP, UserNameUtils::isIP will //not// return true
for IPv6 ranges.
UserNameUtils::isIPRange, like User::isIPRange, accepts a name and
simply calls IPUtils::isValidRange.
User::isValidUserName, ::isUsableName, ::isCreatableName,
::getCanonical, ::isIP, and ::isValidRange are all soft deprecated
A follow up patch will add this to the release notes, to avoid merge
conflicts.
Bug: T245231
Bug: T239527
Change-Id: I46684bc492bb74b728ff102971f6cdd4d746a50a
2020-02-23 23:52:44 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.35
|
|
|
|
|
* @return UserNameUtils
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getUserNameUtils(): UserNameUtils {
|
Add a new UserNameUtils service
This replaces User::isValidUserName, ::isUsableName, ::isCreatableName,
::getCanonicalName, and ::isIP.
Unlike User::isIP, UserNameUtils::isIP will //not// return true
for IPv6 ranges.
UserNameUtils::isIPRange, like User::isIPRange, accepts a name and
simply calls IPUtils::isValidRange.
User::isValidUserName, ::isUsableName, ::isCreatableName,
::getCanonical, ::isIP, and ::isValidRange are all soft deprecated
A follow up patch will add this to the release notes, to avoid merge
conflicts.
Bug: T245231
Bug: T239527
Change-Id: I46684bc492bb74b728ff102971f6cdd4d746a50a
2020-02-23 23:52:44 +00:00
|
|
|
return $this->getService( 'UserNameUtils' );
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-17 06:21:28 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.35
|
|
|
|
|
* @return UserOptionsLookup
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getUserOptionsLookup(): UserOptionsLookup {
|
2020-01-17 06:21:28 +00:00
|
|
|
return $this->getService( 'UserOptionsLookup' );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @since 1.35
|
|
|
|
|
* @return UserOptionsManager
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getUserOptionsManager(): UserOptionsManager {
|
2020-01-17 06:21:28 +00:00
|
|
|
return $this->getService( 'UserOptionsManager' );
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-29 09:31:27 +00:00
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* @since 1.28
|
|
|
|
|
* @return VirtualRESTServiceClient
|
2018-06-29 09:31:27 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getVirtualRESTServiceClient(): VirtualRESTServiceClient {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'VirtualRESTServiceClient' );
|
2018-06-29 09:31:27 +00:00
|
|
|
}
|
|
|
|
|
|
2016-12-14 20:55:56 +00:00
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* @since 1.28
|
|
|
|
|
* @return WatchedItemQueryService
|
2016-12-14 20:55:56 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getWatchedItemQueryService(): WatchedItemQueryService {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'WatchedItemQueryService' );
|
2016-12-14 20:55:56 +00:00
|
|
|
}
|
|
|
|
|
|
2018-07-24 16:44:09 +00:00
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* @since 1.28
|
|
|
|
|
* @return WatchedItemStoreInterface
|
2018-07-24 16:44:09 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getWatchedItemStore(): WatchedItemStoreInterface {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'WatchedItemStore' );
|
2018-07-24 16:44:09 +00:00
|
|
|
}
|
|
|
|
|
|
2020-05-23 08:43:34 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.35
|
2021-03-26 22:24:43 +00:00
|
|
|
* @return WatchlistManager
|
|
|
|
|
* @deprecated since 1.36 use getWatchlistManager() instead
|
2020-05-23 08:43:34 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getWatchlistNotificationManager(): WatchlistManager {
|
2021-04-07 16:31:51 +00:00
|
|
|
wfDeprecated( __METHOD__, '1.36' );
|
2021-03-26 22:24:43 +00:00
|
|
|
return $this->getWatchlistManager();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @since 1.36
|
|
|
|
|
* @return WatchlistManager
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getWatchlistManager(): WatchlistManager {
|
2021-03-26 22:24:43 +00:00
|
|
|
return $this->getService( 'WatchlistManager' );
|
2020-05-23 08:43:34 +00:00
|
|
|
}
|
|
|
|
|
|
2021-05-14 23:16:34 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.37
|
|
|
|
|
* @return WikiImporterFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getWikiImporterFactory(): WikiImporterFactory {
|
2021-05-14 23:16:34 +00:00
|
|
|
return $this->getService( 'WikiImporterFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-27 13:24:05 +00:00
|
|
|
/**
|
|
|
|
|
* @since 1.36
|
|
|
|
|
* @return WikiPageFactory
|
|
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getWikiPageFactory(): WikiPageFactory {
|
2020-07-27 13:24:05 +00:00
|
|
|
return $this->getService( 'WikiPageFactory' );
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-25 14:37:16 +00:00
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* @since 1.31
|
2019-11-07 22:04:31 +00:00
|
|
|
* @return OldRevisionImporter
|
2018-07-25 14:37:16 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getWikiRevisionOldRevisionImporter(): OldRevisionImporter {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'OldRevisionImporter' );
|
2018-07-25 14:37:16 +00:00
|
|
|
}
|
|
|
|
|
|
2016-10-02 07:41:55 +00:00
|
|
|
/**
|
2018-08-03 08:05:44 +00:00
|
|
|
* @since 1.31
|
2019-11-07 22:04:31 +00:00
|
|
|
* @return OldRevisionImporter
|
2016-10-02 07:41:55 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getWikiRevisionOldRevisionImporterNoUpdates(): OldRevisionImporter {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'WikiRevisionOldRevisionImporterNoUpdates' );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @since 1.31
|
2019-11-07 22:04:31 +00:00
|
|
|
* @return UploadRevisionImporter
|
2018-08-03 08:05:44 +00:00
|
|
|
*/
|
2021-07-22 03:11:47 +00:00
|
|
|
public function getWikiRevisionUploadImporter(): UploadRevisionImporter {
|
2018-08-03 08:05:44 +00:00
|
|
|
return $this->getService( 'UploadRevisionImporter' );
|
2016-10-02 07:41:55 +00:00
|
|
|
}
|
|
|
|
|
|
2015-10-12 08:05:45 +00:00
|
|
|
}
|