Merge "Namespace includes/cache"
This commit is contained in:
commit
845e69cb2e
70 changed files with 176 additions and 71 deletions
|
|
@ -423,6 +423,14 @@ because of Phabricator reports.
|
|||
In this release of MediaWiki, XYZ classes now have a namespace and XYZ do
|
||||
not yet (XYZ% done, up from 63% in MediaWiki 1.41.0). The following have newly
|
||||
been moved:
|
||||
- MediaWiki\Cache:
|
||||
- BacklinkCache
|
||||
- FileCacheBase
|
||||
- GenderCache
|
||||
- HTMLCacheUpdater (and fix case for consistency with HTMLFileCache)
|
||||
- LinkBatch
|
||||
- LinkCache
|
||||
- UserCache
|
||||
- MediaWiki\Context:
|
||||
- ContextSource
|
||||
- DerivativeContextSource
|
||||
|
|
|
|||
|
|
@ -612,7 +612,7 @@ $wgAutoloadLocalClasses = [
|
|||
'HistoryPager' => __DIR__ . '/includes/actions/pagers/HistoryPager.php',
|
||||
'Html' => __DIR__ . '/includes/Html/Html.php',
|
||||
'HtmlArmor' => __DIR__ . '/includes/libs/HtmlArmor.php',
|
||||
'HtmlCacheUpdater' => __DIR__ . '/includes/cache/HtmlCacheUpdater.php',
|
||||
'HtmlCacheUpdater' => __DIR__ . '/includes/cache/HTMLCacheUpdater.php',
|
||||
'HtmlFileCacheUpdate' => __DIR__ . '/includes/deferred/HtmlFileCacheUpdate.php',
|
||||
'HttpError' => __DIR__ . '/includes/exception/HttpError.php',
|
||||
'HttpStatus' => __DIR__ . '/includes/libs/HttpStatus.php',
|
||||
|
|
@ -943,8 +943,12 @@ $wgAutoloadLocalClasses = [
|
|||
'MediaWiki\\Block\\UnblockUser' => __DIR__ . '/includes/block/UnblockUser.php',
|
||||
'MediaWiki\\Block\\UnblockUserFactory' => __DIR__ . '/includes/block/UnblockUserFactory.php',
|
||||
'MediaWiki\\Block\\UserBlockCommandFactory' => __DIR__ . '/includes/block/UserBlockCommandFactory.php',
|
||||
'MediaWiki\\Cache\\BacklinkCache' => __DIR__ . '/includes/cache/BacklinkCache.php',
|
||||
'MediaWiki\\Cache\\BacklinkCacheFactory' => __DIR__ . '/includes/cache/BacklinkCacheFactory.php',
|
||||
'MediaWiki\\Cache\\CacheKeyHelper' => __DIR__ . '/includes/cache/CacheKeyHelper.php',
|
||||
'MediaWiki\\Cache\\FileCacheBase' => __DIR__ . '/includes/cache/FileCacheBase.php',
|
||||
'MediaWiki\\Cache\\GenderCache' => __DIR__ . '/includes/cache/GenderCache.php',
|
||||
'MediaWiki\\Cache\\HTMLCacheUpdater' => __DIR__ . '/includes/cache/HTMLCacheUpdater.php',
|
||||
'MediaWiki\\Cache\\Hook\\BacklinkCacheGetConditionsHook' => __DIR__ . '/includes/cache/Hook/BacklinkCacheGetConditionsHook.php',
|
||||
'MediaWiki\\Cache\\Hook\\BacklinkCacheGetPrefixHook' => __DIR__ . '/includes/cache/Hook/BacklinkCacheGetPrefixHook.php',
|
||||
'MediaWiki\\Cache\\Hook\\HTMLFileCache__useFileCacheHook' => __DIR__ . '/includes/cache/Hook/HTMLFileCache__useFileCacheHook.php',
|
||||
|
|
@ -954,7 +958,10 @@ $wgAutoloadLocalClasses = [
|
|||
'MediaWiki\\Cache\\Hook\\MessageCacheReplaceHook' => __DIR__ . '/includes/language/Hook/MessageCacheReplaceHook.php',
|
||||
'MediaWiki\\Cache\\Hook\\MessageCache__getHook' => __DIR__ . '/includes/language/Hook/MessageCache__getHook.php',
|
||||
'MediaWiki\\Cache\\Hook\\MessagesPreLoadHook' => __DIR__ . '/includes/language/Hook/MessagesPreLoadHook.php',
|
||||
'MediaWiki\\Cache\\LinkBatch' => __DIR__ . '/includes/cache/LinkBatch.php',
|
||||
'MediaWiki\\Cache\\LinkBatchFactory' => __DIR__ . '/includes/cache/LinkBatchFactory.php',
|
||||
'MediaWiki\\Cache\\LinkCache' => __DIR__ . '/includes/cache/LinkCache.php',
|
||||
'MediaWiki\\Cache\\UserCache' => __DIR__ . '/includes/cache/UserCache.php',
|
||||
'MediaWiki\\Category\\CategoriesRdf' => __DIR__ . '/includes/Category/CategoriesRdf.php',
|
||||
'MediaWiki\\Category\\Category' => __DIR__ . '/includes/Category/Category.php',
|
||||
'MediaWiki\\Category\\CategoryViewer' => __DIR__ . '/includes/Category/CategoryViewer.php',
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ use ILanguageConverter;
|
|||
use ImageGalleryBase;
|
||||
use ImageGalleryClassNotFoundException;
|
||||
use InvalidArgumentException;
|
||||
use LinkCache;
|
||||
use MediaWiki\Cache\LinkCache;
|
||||
use MediaWiki\Context\ContextSource;
|
||||
use MediaWiki\Context\IContextSource;
|
||||
use MediaWiki\HookContainer\ProtectedHookAccessorTrait;
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ namespace MediaWiki\CommentFormatter;
|
|||
use File;
|
||||
use HtmlArmor;
|
||||
use Language;
|
||||
use LinkBatch;
|
||||
use LinkCache;
|
||||
use MediaWiki\Cache\LinkBatch;
|
||||
use MediaWiki\Cache\LinkBatchFactory;
|
||||
use MediaWiki\Cache\LinkCache;
|
||||
use MediaWiki\HookContainer\HookContainer;
|
||||
use MediaWiki\HookContainer\HookRunner;
|
||||
use MediaWiki\Linker\Linker;
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
namespace MediaWiki\CommentFormatter;
|
||||
|
||||
use Language;
|
||||
use LinkCache;
|
||||
use MediaWiki\Cache\LinkBatchFactory;
|
||||
use MediaWiki\Cache\LinkCache;
|
||||
use MediaWiki\HookContainer\HookContainer;
|
||||
use MediaWiki\Linker\LinkRenderer;
|
||||
use MediaWiki\Title\NamespaceInfo;
|
||||
|
|
|
|||
|
|
@ -27,13 +27,10 @@ use ExtensionRegistry;
|
|||
use ExternalStoreAccess;
|
||||
use ExternalStoreFactory;
|
||||
use FileBackendGroup;
|
||||
use GenderCache;
|
||||
use HtmlCacheUpdater;
|
||||
use IBufferingStatsdDataFactory;
|
||||
use JobQueueGroup;
|
||||
use JobRunner;
|
||||
use Language;
|
||||
use LinkCache;
|
||||
use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
|
||||
use LocalisationCache;
|
||||
use LogicException;
|
||||
|
|
@ -55,7 +52,11 @@ use MediaWiki\Block\DatabaseBlockStoreFactory;
|
|||
use MediaWiki\Block\HideUserUtils;
|
||||
use MediaWiki\Block\UnblockUserFactory;
|
||||
use MediaWiki\Cache\BacklinkCacheFactory;
|
||||
use MediaWiki\Cache\GenderCache;
|
||||
use MediaWiki\Cache\HTMLCacheUpdater;
|
||||
use MediaWiki\Cache\LinkBatchFactory;
|
||||
use MediaWiki\Cache\LinkCache;
|
||||
use MediaWiki\Cache\UserCache;
|
||||
use MediaWiki\Category\TrackingCategories;
|
||||
use MediaWiki\ChangeTags\ChangeTagsStore;
|
||||
use MediaWiki\Collation\CollationFactory;
|
||||
|
|
@ -198,7 +199,6 @@ use SearchEngineConfig;
|
|||
use SearchEngineFactory;
|
||||
use SkinFactory;
|
||||
use UploadRevisionImporter;
|
||||
use UserCache;
|
||||
use WANObjectCache;
|
||||
use WatchedItemQueryService;
|
||||
use WatchedItemStoreInterface;
|
||||
|
|
@ -1192,7 +1192,7 @@ class MediaWikiServices extends ServiceContainer {
|
|||
/**
|
||||
* @since 1.35
|
||||
*/
|
||||
public function getHtmlCacheUpdater(): HtmlCacheUpdater {
|
||||
public function getHtmlCacheUpdater(): HTMLCacheUpdater {
|
||||
return $this->getService( 'HtmlCacheUpdater' );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ use InvalidArgumentException;
|
|||
use JavaScriptContent;
|
||||
use Language;
|
||||
use LanguageCode;
|
||||
use LinkCache;
|
||||
use MediaWiki\Cache\LinkCache;
|
||||
use MediaWiki\Config\Config;
|
||||
use MediaWiki\Context\ContextSource;
|
||||
use MediaWiki\Context\IContextSource;
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ use MediaWiki\Block\AbstractBlock;
|
|||
use MediaWiki\Block\Block;
|
||||
use MediaWiki\Block\BlockErrorFormatter;
|
||||
use MediaWiki\Block\BlockManager;
|
||||
use MediaWiki\Cache\UserCache;
|
||||
use MediaWiki\Config\ServiceOptions;
|
||||
use MediaWiki\Context\IContextSource;
|
||||
use MediaWiki\Context\RequestContext;
|
||||
|
|
@ -53,7 +54,6 @@ use MediaWiki\User\UserIdentity;
|
|||
use MessageSpecifier;
|
||||
use PermissionsError;
|
||||
use StatusValue;
|
||||
use UserCache;
|
||||
use Wikimedia\ScopedCallback;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ namespace MediaWiki\Permissions;
|
|||
|
||||
use DBAccessObjectUtils;
|
||||
use IDBAccessObject;
|
||||
use LinkCache;
|
||||
use MediaWiki\Cache\CacheKeyHelper;
|
||||
use MediaWiki\Cache\LinkCache;
|
||||
use MediaWiki\CommentStore\CommentStore;
|
||||
use MediaWiki\Config\ServiceOptions;
|
||||
use MediaWiki\HookContainer\HookContainer;
|
||||
|
|
|
|||
|
|
@ -61,8 +61,13 @@ use MediaWiki\Block\DatabaseBlockStoreFactory;
|
|||
use MediaWiki\Block\HideUserUtils;
|
||||
use MediaWiki\Block\UnblockUserFactory;
|
||||
use MediaWiki\Block\UserBlockCommandFactory;
|
||||
use MediaWiki\Cache\BacklinkCache;
|
||||
use MediaWiki\Cache\BacklinkCacheFactory;
|
||||
use MediaWiki\Cache\GenderCache;
|
||||
use MediaWiki\Cache\HTMLCacheUpdater;
|
||||
use MediaWiki\Cache\LinkBatchFactory;
|
||||
use MediaWiki\Cache\LinkCache;
|
||||
use MediaWiki\Cache\UserCache;
|
||||
use MediaWiki\Category\TrackingCategories;
|
||||
use MediaWiki\ChangeTags\ChangeTagsStore;
|
||||
use MediaWiki\Collation\CollationFactory;
|
||||
|
|
@ -938,10 +943,10 @@ return [
|
|||
return $hookContainer;
|
||||
},
|
||||
|
||||
'HtmlCacheUpdater' => static function ( MediaWikiServices $services ): HtmlCacheUpdater {
|
||||
'HtmlCacheUpdater' => static function ( MediaWikiServices $services ): HTMLCacheUpdater {
|
||||
$config = $services->getMainConfig();
|
||||
|
||||
return new HtmlCacheUpdater(
|
||||
return new HTMLCacheUpdater(
|
||||
$services->getHookContainer(),
|
||||
$services->getTitleFactory(),
|
||||
$config->get( MainConfigNames::CdnReboundPurgeDelay ),
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ class RawAction extends FormlessAction {
|
|||
$contentType == 'text/javascript'
|
||||
) {
|
||||
// CSS/JSON/JS raw content has its own CDN max age configuration.
|
||||
// Note: HtmlCacheUpdater::getUrls() includes action=raw for css/json/js
|
||||
// Note: HTMLCacheUpdater::getUrls() includes action=raw for css/json/js
|
||||
// pages, so if using the canonical url, this will get HTCP purges.
|
||||
$smaxage = intval( $config->get( MainConfigNames::ForcedRawSMaxage ) );
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,10 @@
|
|||
*/
|
||||
|
||||
use MediaWiki\Api\Validator\SubmoduleDef;
|
||||
use MediaWiki\Cache\GenderCache;
|
||||
use MediaWiki\Cache\LinkBatch;
|
||||
use MediaWiki\Cache\LinkBatchFactory;
|
||||
use MediaWiki\Cache\LinkCache;
|
||||
use MediaWiki\Linker\LinkTarget;
|
||||
use MediaWiki\MainConfigNames;
|
||||
use MediaWiki\MediaWikiServices;
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
*/
|
||||
|
||||
use MediaWiki\Cache\LinkBatchFactory;
|
||||
use MediaWiki\Cache\LinkCache;
|
||||
use MediaWiki\CommentFormatter\CommentFormatter;
|
||||
use MediaWiki\Content\IContentHandlerFactory;
|
||||
use MediaWiki\Content\Renderer\ContentRenderer;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
* @file
|
||||
*/
|
||||
|
||||
use MediaWiki\Cache\GenderCache;
|
||||
use MediaWiki\Linker\LinksMigration;
|
||||
use MediaWiki\ParamValidator\TypeDef\NamespaceDef;
|
||||
use MediaWiki\Title\NamespaceInfo;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
* @file
|
||||
*/
|
||||
|
||||
use MediaWiki\Cache\GenderCache;
|
||||
use MediaWiki\MainConfigNames;
|
||||
use MediaWiki\Permissions\RestrictionStore;
|
||||
use MediaWiki\Title\NamespaceInfo;
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
*/
|
||||
|
||||
use MediaWiki\Auth\AuthManager;
|
||||
use MediaWiki\Cache\GenderCache;
|
||||
use MediaWiki\User\User;
|
||||
use MediaWiki\User\UserFactory;
|
||||
use MediaWiki\User\UserGroupManager;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
* @file
|
||||
*/
|
||||
|
||||
use MediaWiki\Cache\GenderCache;
|
||||
use MediaWiki\CommentFormatter\CommentFormatter;
|
||||
use MediaWiki\CommentStore\CommentStore;
|
||||
use MediaWiki\Linker\LinkTarget;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
* @file
|
||||
*/
|
||||
|
||||
use MediaWiki\Cache\GenderCache;
|
||||
use MediaWiki\ParamValidator\TypeDef\UserDef;
|
||||
use MediaWiki\Title\NamespaceInfo;
|
||||
use MediaWiki\Title\Title;
|
||||
|
|
|
|||
11
includes/cache/BacklinkCache.php
vendored
11
includes/cache/BacklinkCache.php
vendored
|
|
@ -25,7 +25,10 @@
|
|||
* @copyright © 2011, Antoine Musso
|
||||
*/
|
||||
|
||||
use MediaWiki\Cache\CacheKeyHelper;
|
||||
namespace MediaWiki\Cache;
|
||||
|
||||
use Iterator;
|
||||
use LogicException;
|
||||
use MediaWiki\Config\ServiceOptions;
|
||||
use MediaWiki\HookContainer\HookContainer;
|
||||
use MediaWiki\HookContainer\HookRunner;
|
||||
|
|
@ -36,6 +39,9 @@ use MediaWiki\Page\PageIdentityValue;
|
|||
use MediaWiki\Page\PageReference;
|
||||
use MediaWiki\Title\Title;
|
||||
use MediaWiki\Title\TitleValue;
|
||||
use RuntimeException;
|
||||
use stdClass;
|
||||
use WANObjectCache;
|
||||
use Wikimedia\Rdbms\Database;
|
||||
use Wikimedia\Rdbms\IConnectionProvider;
|
||||
use Wikimedia\Rdbms\IReadableDatabase;
|
||||
|
|
@ -553,3 +559,6 @@ class BacklinkCache {
|
|||
return array_values( $mergedRes );
|
||||
}
|
||||
}
|
||||
|
||||
/** @deprecated since 1.42 */
|
||||
class_alias( BacklinkCache::class, 'BacklinkCache' );
|
||||
|
|
|
|||
7
includes/cache/FileCacheBase.php
vendored
7
includes/cache/FileCacheBase.php
vendored
|
|
@ -21,10 +21,14 @@
|
|||
* @ingroup Cache
|
||||
*/
|
||||
|
||||
namespace MediaWiki\Cache;
|
||||
|
||||
use BagOStuff;
|
||||
use MediaWiki\Config\ServiceOptions;
|
||||
use MediaWiki\MainConfigNames;
|
||||
use MediaWiki\MediaWikiServices;
|
||||
use MediaWiki\Request\WebRequest;
|
||||
use ObjectCache;
|
||||
use Wikimedia\AtEase\AtEase;
|
||||
use Wikimedia\IPUtils;
|
||||
|
||||
|
|
@ -287,3 +291,6 @@ abstract class FileCacheBase {
|
|||
return $cache->makeKey( static::class, 'misses', $this->mType, $this->mKey );
|
||||
}
|
||||
}
|
||||
|
||||
/** @deprecated since 1.42 */
|
||||
class_alias( FileCacheBase::class, 'FileCacheBase' );
|
||||
|
|
|
|||
5
includes/cache/GenderCache.php
vendored
5
includes/cache/GenderCache.php
vendored
|
|
@ -19,6 +19,8 @@
|
|||
* @author Niklas Laxström
|
||||
*/
|
||||
|
||||
namespace MediaWiki\Cache;
|
||||
|
||||
use MediaWiki\Context\RequestContext;
|
||||
use MediaWiki\Linker\LinkTarget;
|
||||
use MediaWiki\MediaWikiServices;
|
||||
|
|
@ -182,3 +184,6 @@ class GenderCache {
|
|||
return strtr( $username, '_', ' ' );
|
||||
}
|
||||
}
|
||||
|
||||
/** @deprecated since 1.42 */
|
||||
class_alias( GenderCache::class, 'GenderCache' );
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
* @file
|
||||
*/
|
||||
|
||||
namespace MediaWiki\Cache;
|
||||
|
||||
use MediaWiki\Deferred\CdnCacheUpdate;
|
||||
use MediaWiki\Deferred\DeferredUpdates;
|
||||
use MediaWiki\Deferred\HtmlFileCacheUpdate;
|
||||
|
|
@ -26,6 +28,7 @@ use MediaWiki\HookContainer\HookRunner;
|
|||
use MediaWiki\Page\PageIdentity;
|
||||
use MediaWiki\Page\PageReference;
|
||||
use MediaWiki\Title\TitleFactory;
|
||||
use Traversable;
|
||||
|
||||
/**
|
||||
* Class to invalidate the CDN and HTMLFileCache entries associated with URLs/titles
|
||||
|
|
@ -33,7 +36,7 @@ use MediaWiki\Title\TitleFactory;
|
|||
* @ingroup Cache
|
||||
* @since 1.35
|
||||
*/
|
||||
class HtmlCacheUpdater {
|
||||
class HTMLCacheUpdater {
|
||||
/** @var int Seconds between initial and rebound purges; 0 if disabled */
|
||||
private $reboundDelay;
|
||||
/** @var bool Whether filesystem-based HTML output caching is enabled */
|
||||
|
|
@ -126,8 +129,8 @@ class HtmlCacheUpdater {
|
|||
*
|
||||
* @param string[]|string $urls URL or list of URLs
|
||||
* @param int $flags Bit field of class PURGE_* constants
|
||||
* [Default: HtmlCacheUpdater::PURGE_PRESEND]
|
||||
* @param mixed[] $unless Optional map of (HtmlCacheUpdater::UNLESS_* constant => value)
|
||||
* [Default: HTMLCacheUpdater::PURGE_PRESEND]
|
||||
* @param mixed[] $unless Optional map of (HTMLCacheUpdater::UNLESS_* constant => value)
|
||||
*/
|
||||
public function purgeUrls( $urls, $flags = self::PURGE_PRESEND, array $unless = [] ) {
|
||||
$minFreshCacheMtime = $unless[self::UNLESS_CACHE_MTIME_AFTER] ?? null;
|
||||
|
|
@ -158,8 +161,8 @@ class HtmlCacheUpdater {
|
|||
* @param Traversable|PageReference[]|PageReference $pages PageReference or iterator yielding
|
||||
* PageReference instances
|
||||
* @param int $flags Bit field of class PURGE_* constants
|
||||
* [Default: HtmlCacheUpdater::PURGE_PRESEND]
|
||||
* @param mixed[] $unless Optional map of (HtmlCacheUpdater::UNLESS_* constant => value)
|
||||
* [Default: HTMLCacheUpdater::PURGE_PRESEND]
|
||||
* @param mixed[] $unless Optional map of (HTMLCacheUpdater::UNLESS_* constant => value)
|
||||
*/
|
||||
public function purgeTitleUrls( $pages, $flags = self::PURGE_PRESEND, array $unless = [] ) {
|
||||
$pages = is_iterable( $pages ) ? $pages : [ $pages ];
|
||||
|
|
@ -253,3 +256,6 @@ class HtmlCacheUpdater {
|
|||
return $urls;
|
||||
}
|
||||
}
|
||||
|
||||
/** @deprecated since 1.42 */
|
||||
class_alias( HTMLCacheUpdater::class, 'HtmlCacheUpdater' );
|
||||
|
|
@ -19,7 +19,7 @@ interface HtmlCacheUpdaterAppendUrlsHook {
|
|||
* re-render of the same content. For example, after a direct revision to the content the
|
||||
* history page will need to be purged. However when re-rendering after a cascading change
|
||||
* from a template, only URLs that render content need purging. The $mode will be either
|
||||
* HtmlCacheUpdater::PURGE_URLS_LINKSUPDATE_ONLY or 0.
|
||||
* HTMLCacheUpdater::PURGE_URLS_LINKSUPDATE_ONLY or 0.
|
||||
*
|
||||
* @since 1.35
|
||||
*
|
||||
|
|
|
|||
9
includes/cache/LinkBatch.php
vendored
9
includes/cache/LinkBatch.php
vendored
|
|
@ -21,7 +21,10 @@
|
|||
* @ingroup Cache
|
||||
*/
|
||||
|
||||
use MediaWiki\Cache\CacheKeyHelper;
|
||||
namespace MediaWiki\Cache;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use Language;
|
||||
use MediaWiki\Linker\LinksMigration;
|
||||
use MediaWiki\Linker\LinkTarget;
|
||||
use MediaWiki\Page\PageIdentityValue;
|
||||
|
|
@ -30,6 +33,7 @@ use MediaWiki\Page\ProperPageIdentity;
|
|||
use MediaWiki\Title\TitleFormatter;
|
||||
use MediaWiki\Title\TitleValue;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use RuntimeException;
|
||||
use Wikimedia\Assert\Assert;
|
||||
use Wikimedia\Rdbms\IConnectionProvider;
|
||||
use Wikimedia\Rdbms\IResultWrapper;
|
||||
|
|
@ -375,3 +379,6 @@ class LinkBatch {
|
|||
return $db->makeWhereFrom2d( $this->data, $blNamespace, $blTitle );
|
||||
}
|
||||
}
|
||||
|
||||
/** @deprecated since 1.42 */
|
||||
class_alias( LinkBatch::class, 'LinkBatch' );
|
||||
|
|
|
|||
11
includes/cache/LinkCache.php
vendored
11
includes/cache/LinkCache.php
vendored
|
|
@ -21,6 +21,12 @@
|
|||
* @ingroup Cache
|
||||
*/
|
||||
|
||||
namespace MediaWiki\Cache;
|
||||
|
||||
use DBAccessObjectUtils;
|
||||
use IDBAccessObject;
|
||||
use InvalidArgumentException;
|
||||
use MapCacheLRU;
|
||||
use MediaWiki\Linker\LinkTarget;
|
||||
use MediaWiki\MainConfigNames;
|
||||
use MediaWiki\MediaWikiServices;
|
||||
|
|
@ -33,6 +39,8 @@ use MediaWiki\Title\TitleValue;
|
|||
use Psr\Log\LoggerAwareInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Psr\Log\NullLogger;
|
||||
use stdClass;
|
||||
use WANObjectCache;
|
||||
use Wikimedia\Rdbms\Database;
|
||||
use Wikimedia\Rdbms\IDatabase;
|
||||
use Wikimedia\Rdbms\ILoadBalancer;
|
||||
|
|
@ -573,3 +581,6 @@ class LinkCache implements LoggerAwareInterface {
|
|||
$this->entries->clear();
|
||||
}
|
||||
}
|
||||
|
||||
/** @deprecated since 1.42 */
|
||||
class_alias( LinkCache::class, 'LinkCache' );
|
||||
|
|
|
|||
6
includes/cache/UserCache.php
vendored
6
includes/cache/UserCache.php
vendored
|
|
@ -21,7 +21,8 @@
|
|||
* @ingroup Cache
|
||||
*/
|
||||
|
||||
use MediaWiki\Cache\LinkBatchFactory;
|
||||
namespace MediaWiki\Cache;
|
||||
|
||||
use MediaWiki\MediaWikiServices;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Wikimedia\Rdbms\IConnectionProvider;
|
||||
|
|
@ -175,3 +176,6 @@ class UserCache {
|
|||
return ( in_array( $type, $options ) && !isset( $this->typesCached[$uid][$type] ) );
|
||||
}
|
||||
}
|
||||
|
||||
/** @deprecated since 1.42 */
|
||||
class_alias( UserCache::class, 'UserCache' );
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
|
||||
use MediaWiki\Cache\BacklinkCache;
|
||||
use MediaWiki\MediaWikiServices;
|
||||
use MediaWiki\Revision\RevisionRecord;
|
||||
use MediaWiki\Title\Title;
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ class CdnCacheUpdate implements DeferrableUpdate, MergeableUpdate {
|
|||
$services = MediaWikiServices::getInstance();
|
||||
/** @var PageReference $page */
|
||||
|
||||
// Avoid multiple queries for HtmlCacheUpdater::getUrls() call
|
||||
// Avoid multiple queries for HTMLCacheUpdater::getUrls() call
|
||||
$lb = $services->getLinkBatchFactory()->newLinkBatch();
|
||||
foreach ( $this->pageTuples as [ $page, ] ) {
|
||||
$lb->addObj( $page );
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@
|
|||
|
||||
namespace MediaWiki\Deferred\LinksUpdate;
|
||||
|
||||
use BacklinkCache;
|
||||
use IDBAccessObject;
|
||||
use Job;
|
||||
use MediaWiki\Cache\BacklinkCache;
|
||||
use MediaWiki\Deferred\AutoCommitUpdate;
|
||||
use MediaWiki\Deferred\DataUpdate;
|
||||
use MediaWiki\Deferred\DeferredUpdates;
|
||||
|
|
|
|||
|
|
@ -887,7 +887,7 @@ class FileRepo {
|
|||
public function getDescriptionStylesheetUrl() {
|
||||
if ( isset( $this->scriptDirUrl ) ) {
|
||||
// Must match canonical query parameter order for optimum caching
|
||||
// See HtmlCacheUpdater::getUrls
|
||||
// See HTMLCacheUpdater::getUrls
|
||||
return $this->makeUrl( 'title=MediaWiki:Filepage.css&action=raw&ctype=text/css' );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
*/
|
||||
|
||||
use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
|
||||
use MediaWiki\Cache\LinkCache;
|
||||
use MediaWiki\Config\ServiceOptions;
|
||||
use MediaWiki\Deferred\DeferredUpdates;
|
||||
use MediaWiki\Http\Telemetry;
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace MediaWiki\Linker;
|
|||
|
||||
use HtmlArmor;
|
||||
use Language;
|
||||
use LinkCache;
|
||||
use MediaWiki\Cache\LinkCache;
|
||||
use MediaWiki\Config\ServiceOptions;
|
||||
use MediaWiki\HookContainer\HookContainer;
|
||||
use MediaWiki\HookContainer\HookRunner;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
*/
|
||||
namespace MediaWiki\Linker;
|
||||
|
||||
use LinkCache;
|
||||
use MediaWiki\Cache\LinkCache;
|
||||
use MediaWiki\Config\ServiceOptions;
|
||||
use MediaWiki\HookContainer\HookContainer;
|
||||
use MediaWiki\SpecialPage\SpecialPageFactory;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
namespace MediaWiki\Page;
|
||||
|
||||
use Iterator;
|
||||
use LinkCache;
|
||||
use MediaWiki\Cache\LinkCache;
|
||||
use Wikimedia\Assert\Assert;
|
||||
use Wikimedia\Rdbms\IExpression;
|
||||
use Wikimedia\Rdbms\IReadableDatabase;
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ use EmptyIterator;
|
|||
use IDBAccessObject;
|
||||
use InvalidArgumentException;
|
||||
use Iterator;
|
||||
use LinkCache;
|
||||
use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
|
||||
use MediaWiki\Cache\LinkCache;
|
||||
use MediaWiki\Config\ServiceOptions;
|
||||
use MediaWiki\DAO\WikiAwareEntity;
|
||||
use MediaWiki\MainConfigNames;
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
namespace MediaWiki\Page;
|
||||
|
||||
use LinkCache;
|
||||
use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
|
||||
use MediaWiki\Cache\LinkCache;
|
||||
use MediaWiki\Config\ServiceOptions;
|
||||
use MediaWiki\DAO\WikiAwareEntity;
|
||||
use MediaWiki\Title\NamespaceInfo;
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
* @ingroup Parser
|
||||
*/
|
||||
|
||||
use MediaWiki\Cache\LinkCache;
|
||||
use MediaWiki\HookContainer\HookContainer;
|
||||
use MediaWiki\HookContainer\HookRunner;
|
||||
use MediaWiki\Linker\Linker;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
* @ingroup RevisionDelete
|
||||
*/
|
||||
|
||||
use MediaWiki\Cache\HTMLCacheUpdater;
|
||||
use MediaWiki\Context\IContextSource;
|
||||
use MediaWiki\HookContainer\HookContainer;
|
||||
use MediaWiki\MediaWikiServices;
|
||||
|
|
@ -43,7 +44,7 @@ class RevDelArchiveList extends RevDelRevisionList {
|
|||
* @param array $ids
|
||||
* @param LBFactory $lbFactory
|
||||
* @param HookContainer $hookContainer
|
||||
* @param HtmlCacheUpdater $htmlCacheUpdater
|
||||
* @param HTMLCacheUpdater $htmlCacheUpdater
|
||||
* @param RevisionStore $revisionStore
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
@ -52,7 +53,7 @@ class RevDelArchiveList extends RevDelRevisionList {
|
|||
array $ids,
|
||||
LBFactory $lbFactory,
|
||||
HookContainer $hookContainer,
|
||||
HtmlCacheUpdater $htmlCacheUpdater,
|
||||
HTMLCacheUpdater $htmlCacheUpdater,
|
||||
RevisionStore $revisionStore
|
||||
) {
|
||||
parent::__construct(
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
* @ingroup RevisionDelete
|
||||
*/
|
||||
|
||||
use MediaWiki\Cache\HTMLCacheUpdater;
|
||||
use MediaWiki\Context\IContextSource;
|
||||
use MediaWiki\FileRepo\File\FileSelectQueryBuilder;
|
||||
use MediaWiki\Page\PageIdentity;
|
||||
|
|
@ -37,7 +38,7 @@ class RevDelArchivedFileList extends RevDelFileList {
|
|||
* @param PageIdentity $page
|
||||
* @param array $ids
|
||||
* @param LBFactory $lbFactory
|
||||
* @param HtmlCacheUpdater $htmlCacheUpdater
|
||||
* @param HTMLCacheUpdater $htmlCacheUpdater
|
||||
* @param RepoGroup $repoGroup
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
@ -45,7 +46,7 @@ class RevDelArchivedFileList extends RevDelFileList {
|
|||
PageIdentity $page,
|
||||
array $ids,
|
||||
LBFactory $lbFactory,
|
||||
HtmlCacheUpdater $htmlCacheUpdater,
|
||||
HTMLCacheUpdater $htmlCacheUpdater,
|
||||
RepoGroup $repoGroup
|
||||
) {
|
||||
parent::__construct(
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
* @ingroup RevisionDelete
|
||||
*/
|
||||
|
||||
use MediaWiki\Cache\HTMLCacheUpdater;
|
||||
use MediaWiki\Context\IContextSource;
|
||||
use MediaWiki\FileRepo\File\FileSelectQueryBuilder;
|
||||
use MediaWiki\Page\PageIdentity;
|
||||
|
|
@ -35,7 +36,7 @@ class RevDelFileList extends RevDelList {
|
|||
|
||||
protected const SUPPRESS_BIT = File::DELETED_RESTRICTED;
|
||||
|
||||
/** @var HtmlCacheUpdater */
|
||||
/** @var HTMLCacheUpdater */
|
||||
private $htmlCacheUpdater;
|
||||
|
||||
/** @var RepoGroup */
|
||||
|
|
@ -55,7 +56,7 @@ class RevDelFileList extends RevDelList {
|
|||
* @param PageIdentity $page
|
||||
* @param array $ids
|
||||
* @param LBFactory $lbFactory
|
||||
* @param HtmlCacheUpdater $htmlCacheUpdater
|
||||
* @param HTMLCacheUpdater $htmlCacheUpdater
|
||||
* @param RepoGroup $repoGroup
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
@ -63,7 +64,7 @@ class RevDelFileList extends RevDelList {
|
|||
PageIdentity $page,
|
||||
array $ids,
|
||||
LBFactory $lbFactory,
|
||||
HtmlCacheUpdater $htmlCacheUpdater,
|
||||
HTMLCacheUpdater $htmlCacheUpdater,
|
||||
RepoGroup $repoGroup
|
||||
) {
|
||||
parent::__construct( $context, $page, $ids, $lbFactory );
|
||||
|
|
@ -153,7 +154,7 @@ class RevDelFileList extends RevDelList {
|
|||
|
||||
$this->htmlCacheUpdater->purgeUrls(
|
||||
$purgeUrls,
|
||||
HtmlCacheUpdater::PURGE_INTENT_TXROUND_REFLECTED
|
||||
HTMLCacheUpdater::PURGE_INTENT_TXROUND_REFLECTED
|
||||
);
|
||||
|
||||
return Status::newGood();
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
* @ingroup RevisionDelete
|
||||
*/
|
||||
|
||||
use MediaWiki\Cache\HTMLCacheUpdater;
|
||||
use MediaWiki\Context\IContextSource;
|
||||
use MediaWiki\HookContainer\HookContainer;
|
||||
use MediaWiki\HookContainer\HookRunner;
|
||||
|
|
@ -49,7 +50,7 @@ class RevDelRevisionList extends RevDelList {
|
|||
/** @var HookRunner */
|
||||
private $hookRunner;
|
||||
|
||||
/** @var HtmlCacheUpdater */
|
||||
/** @var HTMLCacheUpdater */
|
||||
private $htmlCacheUpdater;
|
||||
|
||||
/** @var RevisionStore */
|
||||
|
|
@ -64,7 +65,7 @@ class RevDelRevisionList extends RevDelList {
|
|||
* @param array $ids
|
||||
* @param LBFactory $lbFactory
|
||||
* @param HookContainer $hookContainer
|
||||
* @param HtmlCacheUpdater $htmlCacheUpdater
|
||||
* @param HTMLCacheUpdater $htmlCacheUpdater
|
||||
* @param RevisionStore $revisionStore
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
@ -73,7 +74,7 @@ class RevDelRevisionList extends RevDelList {
|
|||
array $ids,
|
||||
LBFactory $lbFactory,
|
||||
HookContainer $hookContainer,
|
||||
HtmlCacheUpdater $htmlCacheUpdater,
|
||||
HTMLCacheUpdater $htmlCacheUpdater,
|
||||
RevisionStore $revisionStore
|
||||
) {
|
||||
parent::__construct( $context, $page, $ids, $lbFactory );
|
||||
|
|
@ -192,7 +193,7 @@ class RevDelRevisionList extends RevDelList {
|
|||
public function doPostCommitUpdates( array $visibilityChangeMap ) {
|
||||
$this->htmlCacheUpdater->purgeTitleUrls(
|
||||
$this->page,
|
||||
HtmlCacheUpdater::PURGE_INTENT_TXROUND_REFLECTED
|
||||
HTMLCacheUpdater::PURGE_INTENT_TXROUND_REFLECTED
|
||||
);
|
||||
// Extensions that require referencing previous revisions may need this
|
||||
$this->hookRunner->onArticleRevisionVisibilitySet(
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ namespace MediaWiki\Specials;
|
|||
|
||||
use EditWatchlistCheckboxSeriesField;
|
||||
use EditWatchlistNormalHTMLForm;
|
||||
use GenderCache;
|
||||
use LogicException;
|
||||
use MediaWiki\Cache\GenderCache;
|
||||
use MediaWiki\Cache\LinkBatchFactory;
|
||||
use MediaWiki\Deferred\DeferredUpdates;
|
||||
use MediaWiki\Html\Html;
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
namespace MediaWiki\Specials;
|
||||
|
||||
use MediaWiki\Cache\UserCache;
|
||||
use MediaWiki\CommentFormatter\CommentFormatter;
|
||||
use MediaWiki\CommentStore\CommentStore;
|
||||
use MediaWiki\Pager\ImageListPager;
|
||||
|
|
@ -31,7 +32,6 @@ use MediaWiki\User\UserNamePrefixSearch;
|
|||
use MediaWiki\User\UserNameUtils;
|
||||
use MediaWiki\User\UserRigorOptions;
|
||||
use RepoGroup;
|
||||
use UserCache;
|
||||
use Wikimedia\Rdbms\IConnectionProvider;
|
||||
|
||||
class SpecialListFiles extends IncludableSpecialPage {
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
namespace MediaWiki\Specials;
|
||||
|
||||
use HTMLCheckField;
|
||||
use LinkCache;
|
||||
use MediaWiki\Cache\LinkCache;
|
||||
use MediaWiki\Html\Html;
|
||||
use MediaWiki\HTMLForm\HTMLForm;
|
||||
use MediaWiki\Title\Title;
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ use HTMLMultiSelectField;
|
|||
use HTMLSelectNamespace;
|
||||
use HTMLSizeFilterField;
|
||||
use MediaWiki\Cache\LinkBatchFactory;
|
||||
use MediaWiki\Cache\UserCache;
|
||||
use MediaWiki\CommentFormatter\RowCommentFormatter;
|
||||
use MediaWiki\CommentStore\CommentStore;
|
||||
use MediaWiki\HTMLForm\HTMLForm;
|
||||
|
|
@ -34,7 +35,6 @@ use MediaWiki\MainConfigNames;
|
|||
use MediaWiki\Pager\ProtectedPagesPager;
|
||||
use MediaWiki\Permissions\RestrictionStore;
|
||||
use MediaWiki\SpecialPage\SpecialPage;
|
||||
use UserCache;
|
||||
use Wikimedia\Rdbms\IConnectionProvider;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -29,10 +29,10 @@ use ChangeTags;
|
|||
use ErrorPageError;
|
||||
use File;
|
||||
use IDBAccessObject;
|
||||
use LinkBatch;
|
||||
use LocalRepo;
|
||||
use LogEventsList;
|
||||
use LogPage;
|
||||
use MediaWiki\Cache\LinkBatch;
|
||||
use MediaWiki\Cache\LinkBatchFactory;
|
||||
use MediaWiki\CommentFormatter\CommentFormatter;
|
||||
use MediaWiki\CommentStore\CommentStore;
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
namespace MediaWiki\Pager;
|
||||
|
||||
use LocalRepo;
|
||||
use MediaWiki\Cache\UserCache;
|
||||
use MediaWiki\CommentFormatter\CommentFormatter;
|
||||
use MediaWiki\CommentStore\CommentStore;
|
||||
use MediaWiki\Context\IContextSource;
|
||||
|
|
@ -35,7 +36,6 @@ use MediaWiki\User\User;
|
|||
use MediaWiki\User\UserNameUtils;
|
||||
use RepoGroup;
|
||||
use UnexpectedValueException;
|
||||
use UserCache;
|
||||
use Wikimedia\Rdbms\FakeResultWrapper;
|
||||
use Wikimedia\Rdbms\IConnectionProvider;
|
||||
use Wikimedia\Rdbms\IResultWrapper;
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ namespace MediaWiki\Pager;
|
|||
use LogEventsList;
|
||||
use LogPage;
|
||||
use MediaWiki\Cache\LinkBatchFactory;
|
||||
use MediaWiki\Cache\UserCache;
|
||||
use MediaWiki\CommentFormatter\RowCommentFormatter;
|
||||
use MediaWiki\CommentStore\CommentStore;
|
||||
use MediaWiki\Context\IContextSource;
|
||||
|
|
@ -32,7 +33,6 @@ use MediaWiki\Linker\Linker;
|
|||
use MediaWiki\Linker\LinkRenderer;
|
||||
use MediaWiki\Title\Title;
|
||||
use UnexpectedValueException;
|
||||
use UserCache;
|
||||
use Wikimedia\Rdbms\FakeResultWrapper;
|
||||
use Wikimedia\Rdbms\IConnectionProvider;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@
|
|||
|
||||
namespace MediaWiki\Title;
|
||||
|
||||
use GenderCache;
|
||||
use InvalidArgumentException;
|
||||
use Language;
|
||||
use LogicException;
|
||||
use MediaWiki\Cache\GenderCache;
|
||||
use MediaWiki\Interwiki\InterwikiLookup;
|
||||
use MediaWiki\Linker\LinkTarget;
|
||||
use MediaWiki\Message\Message;
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ use IDBAccessObject;
|
|||
use ILanguageConverter;
|
||||
use InvalidArgumentException;
|
||||
use Language;
|
||||
use LinkCache;
|
||||
use MapCacheLRU;
|
||||
use MediaWiki\Cache\LinkCache;
|
||||
use MediaWiki\Context\RequestContext;
|
||||
use MediaWiki\DAO\WikiAwareEntityTrait;
|
||||
use MediaWiki\Deferred\AtomicSectionUpdate;
|
||||
|
|
@ -2951,7 +2951,7 @@ class Title implements LinkTarget, PageIdentity {
|
|||
/**
|
||||
* Get a list of URLs to purge from the CDN cache when this page changes.
|
||||
*
|
||||
* @deprecated since 1.35 Use HtmlCacheUpdater; hard-deprecated in 1.42
|
||||
* @deprecated since 1.35 Use HTMLCacheUpdater; hard-deprecated in 1.42
|
||||
* @return string[]
|
||||
*/
|
||||
public function getCdnUrls() {
|
||||
|
|
@ -2962,7 +2962,7 @@ class Title implements LinkTarget, PageIdentity {
|
|||
|
||||
/**
|
||||
* Purge all applicable CDN URLs
|
||||
* @deprecated since 1.35 Use HtmlCacheUpdater; hard-deprecated in 1.42
|
||||
* @deprecated since 1.35 Use HTMLCacheUpdater; hard-deprecated in 1.42
|
||||
*/
|
||||
public function purgeSquid() {
|
||||
wfDeprecated( __METHOD__, '1.35' );
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ use MediaWiki\Auth\AuthManager;
|
|||
use MediaWiki\Block\AbstractBlock;
|
||||
use MediaWiki\Block\Block;
|
||||
use MediaWiki\Block\SystemBlock;
|
||||
use MediaWiki\Cache\UserCache;
|
||||
use MediaWiki\Context\RequestContext;
|
||||
use MediaWiki\DAO\WikiAwareEntityTrait;
|
||||
use MediaWiki\HookContainer\ProtectedHookAccessorTrait;
|
||||
|
|
@ -59,7 +60,6 @@ use PasswordFactory;
|
|||
use RuntimeException;
|
||||
use stdClass;
|
||||
use UnexpectedValueException;
|
||||
use UserCache;
|
||||
use UserPasswordPolicy;
|
||||
use WANObjectCache;
|
||||
use Wikimedia\Assert\Assert;
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
require_once __DIR__ . '/../Maintenance.php';
|
||||
|
||||
use MediaWiki\Cache\LinkCache;
|
||||
use MediaWiki\Linker\LinkTarget;
|
||||
use MediaWiki\Revision\RevisionRecord;
|
||||
use MediaWiki\Revision\SlotRecord;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
use MediaWiki\Cache\GenderCache;
|
||||
|
||||
/**
|
||||
* @group Database
|
||||
* @group Cache
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
<?php
|
||||
|
||||
use MediaWiki\Cache\CacheKeyHelper;
|
||||
use MediaWiki\Cache\GenderCache;
|
||||
use MediaWiki\Cache\LinkBatch;
|
||||
use MediaWiki\Cache\LinkCache;
|
||||
use MediaWiki\Linker\LinksMigration;
|
||||
use MediaWiki\Linker\LinkTarget;
|
||||
use MediaWiki\Logger\LoggerFactory;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
|
||||
use MediaWiki\Cache\LinkCache;
|
||||
use MediaWiki\Page\PageReference;
|
||||
use MediaWiki\Page\PageReferenceValue;
|
||||
use MediaWiki\Title\Title;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
|
||||
use MediaWiki\Cache\LinkCache;
|
||||
use MediaWiki\Config\ServiceOptions;
|
||||
use MediaWiki\Linker\LinkRenderer;
|
||||
use MediaWiki\Linker\LinkRendererFactory;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
use MediaWiki\Cache\GenderCache;
|
||||
use MediaWiki\Cache\LinkCache;
|
||||
use MediaWiki\Config\ServiceOptions;
|
||||
use MediaWiki\Context\RequestContext;
|
||||
use MediaWiki\Linker\LinkRenderer;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
* @author Daniel Kinzler
|
||||
*/
|
||||
|
||||
use MediaWiki\Cache\GenderCache;
|
||||
use MediaWiki\Interwiki\InterwikiLookup;
|
||||
use MediaWiki\MainConfigNames;
|
||||
use MediaWiki\Page\PageIdentity;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
|
||||
use MediaWiki\Cache\BacklinkCache;
|
||||
use MediaWiki\Language\RawMessage;
|
||||
use MediaWiki\Linker\LinkTarget;
|
||||
use MediaWiki\MainConfigNames;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
<?php
|
||||
|
||||
use MediaWiki\Cache\GenderCache;
|
||||
use MediaWiki\Cache\LinkBatchFactory;
|
||||
use MediaWiki\Cache\LinkCache;
|
||||
use MediaWiki\Config\ServiceOptions;
|
||||
use MediaWiki\Deferred\DeferredUpdates;
|
||||
use MediaWiki\Linker\LinksMigration;
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
namespace MediaWiki\Tests\Integration\Permissions;
|
||||
|
||||
use IDBAccessObject;
|
||||
use LinkCache;
|
||||
use MediaWiki\Cache\CacheKeyHelper;
|
||||
use MediaWiki\Cache\LinkCache;
|
||||
use MediaWiki\CommentStore\CommentStore;
|
||||
use MediaWiki\Config\ServiceOptions;
|
||||
use MediaWiki\HookContainer\HookContainer;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
|
||||
use MediaWiki\Cache\HTMLCacheUpdater;
|
||||
use MediaWiki\HookContainer\HookContainer;
|
||||
use MediaWiki\HookContainer\StaticHookRegistry;
|
||||
use MediaWiki\Page\PageReference;
|
||||
|
|
@ -16,11 +17,11 @@ use Wikimedia\Rdbms\FakeResultWrapper;
|
|||
class HtmlCacheUpdaterIntegrationTest extends MediaWikiIntegrationTestCase {
|
||||
|
||||
/**
|
||||
* @return HtmlCacheUpdater
|
||||
* @return HTMLCacheUpdater
|
||||
* @throws Exception
|
||||
*/
|
||||
private function newHtmlCacheUpdater(): HtmlCacheUpdater {
|
||||
$updater = new HtmlCacheUpdater(
|
||||
private function newHtmlCacheUpdater(): HTMLCacheUpdater {
|
||||
$updater = new HTMLCacheUpdater(
|
||||
new HookContainer(
|
||||
new StaticHookRegistry(),
|
||||
$this->getServiceContainer()->getObjectFactory()
|
||||
|
|
@ -97,7 +98,7 @@ class HtmlCacheUpdaterIntegrationTest extends MediaWikiIntegrationTestCase {
|
|||
|
||||
/**
|
||||
* @dataProvider providePurgeTitleUrls
|
||||
* @covers \HtmlCacheUpdater::purgeTitleUrls
|
||||
* @covers \MediaWiki\Cache\HTMLCacheUpdater::purgeTitleUrls
|
||||
*/
|
||||
public function testPurgeTitleUrls( $pages, $expected ) {
|
||||
$this->setService( 'EventRelayerGroup', $this->getEventRelayGroup( $expected ) );
|
||||
|
|
@ -107,7 +108,7 @@ class HtmlCacheUpdaterIntegrationTest extends MediaWikiIntegrationTestCase {
|
|||
}
|
||||
|
||||
/**
|
||||
* @covers \HtmlCacheUpdater::purgeUrls
|
||||
* @covers \MediaWiki\Cache\HTMLCacheUpdater::purgeUrls
|
||||
*/
|
||||
public function testPurgeUrls() {
|
||||
$urls = [ 'https://acme.test/wiki/Foo', 'https://acme.test/wiki/Bar', ];
|
||||
|
|
|
|||
|
|
@ -21,11 +21,11 @@
|
|||
|
||||
namespace MediaWiki\Tests\Unit;
|
||||
|
||||
use GenderCache;
|
||||
use Interwiki;
|
||||
use InvalidArgumentException;
|
||||
use Language;
|
||||
use MediaWiki\Cache\CacheKeyHelper;
|
||||
use MediaWiki\Cache\GenderCache;
|
||||
use MediaWiki\CommentFormatter\CommentParser;
|
||||
use MediaWiki\CommentFormatter\CommentParserFactory;
|
||||
use MediaWiki\CommentStore\CommentStore;
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@
|
|||
namespace MediaWiki\Tests\Unit\CommentFormatter;
|
||||
|
||||
use Language;
|
||||
use LinkCache;
|
||||
use MediaWiki\Cache\LinkBatchFactory;
|
||||
use MediaWiki\Cache\LinkCache;
|
||||
use MediaWiki\CommentFormatter\CommentParser;
|
||||
use MediaWiki\CommentFormatter\CommentParserFactory;
|
||||
use MediaWiki\HookContainer\HookContainer;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ namespace MediaWiki\Tests\Unit\Permissions;
|
|||
use MediaWiki\Actions\ActionFactory;
|
||||
use MediaWiki\Block\BlockErrorFormatter;
|
||||
use MediaWiki\Block\BlockManager;
|
||||
use MediaWiki\Cache\UserCache;
|
||||
use MediaWiki\Config\ServiceOptions;
|
||||
use MediaWiki\HookContainer\HookContainer;
|
||||
use MediaWiki\MainConfigNames;
|
||||
|
|
@ -21,7 +22,6 @@ use MediaWiki\User\User;
|
|||
use MediaWiki\User\UserFactory;
|
||||
use MediaWiki\User\UserGroupManager;
|
||||
use MediaWikiUnitTestCase;
|
||||
use UserCache;
|
||||
use Wikimedia\TestingAccessWrapper;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
namespace MediaWiki\Tests\Unit\Permissions;
|
||||
|
||||
use DatabaseTestHelper;
|
||||
use LinkCache;
|
||||
use MediaWiki\Cache\LinkCache;
|
||||
use MediaWiki\Config\ServiceOptions;
|
||||
use MediaWiki\Linker\LinksMigration;
|
||||
use MediaWiki\MainConfigNames;
|
||||
|
|
|
|||
|
|
@ -1,17 +1,18 @@
|
|||
<?php
|
||||
|
||||
use MediaWiki\Cache\HTMLCacheUpdater;
|
||||
use MediaWiki\Title\Title;
|
||||
use MediaWiki\Title\TitleFactory;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
|
||||
/**
|
||||
* @group Cache
|
||||
* @covers \HtmlCacheUpdater
|
||||
* @covers \MediaWiki\Cache\HTMLCacheUpdater
|
||||
*/
|
||||
class HtmlCacheUpdaterTest extends MediaWikiUnitTestCase {
|
||||
class HTMLCacheUpdaterTest extends MediaWikiUnitTestCase {
|
||||
|
||||
public function testGetCdnUrls() {
|
||||
$htmlCache = new HtmlCacheUpdater(
|
||||
$htmlCache = new HTMLCacheUpdater(
|
||||
$this->createHookContainer(),
|
||||
$this->createTitleFactory(),
|
||||
0, false, 86400 );
|
||||
|
|
@ -1,6 +1,9 @@
|
|||
<?php
|
||||
|
||||
use MediaWiki\Cache\GenderCache;
|
||||
use MediaWiki\Cache\LinkBatch;
|
||||
use MediaWiki\Cache\LinkBatchFactory;
|
||||
use MediaWiki\Cache\LinkCache;
|
||||
use MediaWiki\Linker\LinksMigration;
|
||||
use MediaWiki\Logger\LoggerFactory;
|
||||
use MediaWiki\Page\PageReference;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
|
||||
use MediaWiki\Cache\LinkCache;
|
||||
use MediaWiki\HookContainer\HookContainer;
|
||||
use MediaWiki\Linker\LinkRenderer;
|
||||
use MediaWiki\Linker\LinkRendererFactory;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
namespace MediaWiki\Tests\Page;
|
||||
|
||||
use LinkCache;
|
||||
use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
|
||||
use MediaWiki\Cache\LinkCache;
|
||||
use MediaWiki\Config\ServiceOptions;
|
||||
use MediaWiki\MainConfigNames;
|
||||
use MediaWiki\Page\PageStore;
|
||||
|
|
|
|||
Loading…
Reference in a new issue