Jump to content

手册:$wgJobClasses

From mediawiki.org
This page is a translated version of the page Manual:$wgJobClasses and the translation is 40% complete.
扩展: $wgJobClasses
Maps jobs to their handling classes.
引进版本:1.11.0 (r23173)
移除版本:仍在使用
允许的值:(数组)
默认值:参见下方

细节

Maps jobs to their handling classes. Extensions can add to this to provide custom jobs. See Manual:Job queue/For developers for more information.

Since MediaWiki 1.30, it may now specify callback functions as an alternative to plain class names. This is intended for extensions that want control over the instantiation of their jobs, to allow for proper dependency injection.

扩展

Extensions can add to this via the JobClasses object in extension.json :

"JobClasses": {
    "myExtDoSomething": "MediaWiki\\Extension\\MyExt\\Job\\DoSomethingJob"
},

The key must be unique and match what's specified in the job's constructor, and the value is the job class.

默认值

MediaWiki版本:
1.43
$wgJobClasses = [
	'deletePage' => DeletePageJob::class, // 1.32
	'refreshLinks' => RefreshLinksJob::class, // 1.11
	'deleteLinks' => DeleteLinksJob::class, // 1.27
	'htmlCacheUpdate' => HTMLCacheUpdateJob::class, // 1.11
	'sendMail' => [
		'class' => EmaillingJob::class,
		'services' => [
			'Emailer',
		],
	],
	'enotifNotify' => EnotifNotifyJob::class, // 1.11
	'fixDoubleRedirect' => [
		'class' => DoubleRedirectJob::class,
		'services' => [
			'RevisionLookup',
			'MagicWordFactory',
			'WikiPageFactory',
		],
		// This job requires a title
		'needsPage' => true,
	],
	'AssembleUploadChunks' => AssembleUploadChunksJob::class,
	'PublishStashedFile' => PublishStashedFileJob::class,
	'ThumbnailRender' => ThumbnailRenderJob::class,
    'UploadFromUrl' => UploadFromUrlJob::class, // 1.42
	'recentChangesUpdate' => RecentChangesUpdateJob::class,
	'refreshLinksPrioritized' => RefreshLinksJob::class,
	'refreshLinksDynamic' => RefreshLinksJob::class, // 1.27
	'activityUpdateJob' => ActivityUpdateJob::class, // 1.26
	'categoryMembershipChange' => CategoryMembershipChangeJob::class, // 1.35
	'clearUserWatchlist' => ClearUserWatchlistJob::class, // 1.31
	'watchlistExpiry' => WatchlistExpiryJob::class, // 1.35
	'cdnPurge' => CdnPurgeJob::class, // 1.27
	'userGroupExpiry' => UserGroupExpiryJob::class, // 1.31
	'clearWatchlistNotifications' => ClearWatchlistNotificationsJob::class, // 1.31
	'userOptionsUpdate' => UserOptionsUpdateJob::class, // 1.34
	'revertedTagUpdate' => RevertedTagUpdateJob::class, // 1.36
	'null' => NullJob::class,
	'userEditCountInit' => UserEditCountInitJob::class, // 1.36
	'parsoidCachePrewarm' => [ // 1.40
		'class' => ParsoidCachePrewarmJob::class,
		'services' => [
			'ParserOutputAccess',
			'PageStore',
			'RevisionLookup',
			'ParsoidSiteConfig', // 1.43
		],
		// tell the JobFactory not to include the $page parameter in the constructor call
		'needsPage' => false,
	],
	'renameUser' => [ // 1.40
		'class' => RenameUserJob::class,
		'services' => [
			'MainConfig',
			'DBLoadBalancerFactory',
		],
	],
];
MediaWiki版本:
1.42
$wgJobClasses = [
	'deletePage' => DeletePageJob::class, // 1.32
	'refreshLinks' => RefreshLinksJob::class, // 1.11
	'deleteLinks' => DeleteLinksJob::class, // 1.27
	'htmlCacheUpdate' => HTMLCacheUpdateJob::class, // 1.11
	'sendMail' => [
		'class' => EmaillingJob::class,
		'services' => [
			'Emailer',
		],
	],
	'enotifNotify' => EnotifNotifyJob::class, // 1.11
	'fixDoubleRedirect' => [
		'class' => DoubleRedirectJob::class,
		'services' => [
			'RevisionLookup',
			'MagicWordFactory',
			'WikiPageFactory',
		],
		// This job requires a title
		'needsPage' => true,
	],
	'AssembleUploadChunks' => AssembleUploadChunksJob::class,
	'PublishStashedFile' => PublishStashedFileJob::class,
	'ThumbnailRender' => ThumbnailRenderJob::class,
    'UploadFromUrl' => UploadFromUrlJob::class, // 1.42
	'recentChangesUpdate' => RecentChangesUpdateJob::class,
	'refreshLinksPrioritized' => RefreshLinksJob::class,
	'refreshLinksDynamic' => RefreshLinksJob::class, // 1.27
	'activityUpdateJob' => ActivityUpdateJob::class, // 1.26
	'categoryMembershipChange' => CategoryMembershipChangeJob::class, // 1.35
	'clearUserWatchlist' => ClearUserWatchlistJob::class, // 1.31
	'watchlistExpiry' => WatchlistExpiryJob::class, // 1.35
	'cdnPurge' => CdnPurgeJob::class, // 1.27
	'userGroupExpiry' => UserGroupExpiryJob::class, // 1.31
	'clearWatchlistNotifications' => ClearWatchlistNotificationsJob::class, // 1.31
	'userOptionsUpdate' => UserOptionsUpdateJob::class, // 1.34
	'revertedTagUpdate' => RevertedTagUpdateJob::class, // 1.36
	'null' => NullJob::class,
	'userEditCountInit' => UserEditCountInitJob::class, // 1.36
	'parsoidCachePrewarm' => [ // 1.40
		'class' => ParsoidCachePrewarmJob::class,
		'services' => [
			'ParsoidOutputAccess',
			'PageStore',
			'RevisionLookup',
		],
		// tell the JobFactory not to include the $page parameter in the constructor call
		'needsPage' => false,
	],
	'renameUser' => [ // 1.40
		'class' => RenameUserJob::class,
		'services' => [
			'MainConfig',
			'DBLoadBalancerFactory',
		],
	],
];
MediaWiki版本:
1.41
$wgJobClasses = [
	'deletePage' => DeletePageJob::class, // 1.32
	'refreshLinks' => RefreshLinksJob::class, // 1.11
	'deleteLinks' => DeleteLinksJob::class, // 1.27
	'htmlCacheUpdate' => HTMLCacheUpdateJob::class, // 1.11
	'sendMail' => EmaillingJob::class, // 1.11
	'enotifNotify' => EnotifNotifyJob::class, // 1.11
	'fixDoubleRedirect' => [
		'class' => DoubleRedirectJob::class,
		'services' => [
			'RevisionLookup',
			'MagicWordFactory',
			'WikiPageFactory',
		],
		// This job requires a title
		'needsPage' => true,
	],
	'AssembleUploadChunks' => AssembleUploadChunksJob::class,
	'PublishStashedFile' => PublishStashedFileJob::class,
	'ThumbnailRender' => ThumbnailRenderJob::class,
	'recentChangesUpdate' => RecentChangesUpdateJob::class,
	'refreshLinksPrioritized' => RefreshLinksJob::class,
	'refreshLinksDynamic' => RefreshLinksJob::class, // 1.27
	'activityUpdateJob' => ActivityUpdateJob::class, // 1.26
	'categoryMembershipChange' => CategoryMembershipChangeJob::class, // 1.35
	'clearUserWatchlist' => ClearUserWatchlistJob::class, // 1.31
	'watchlistExpiry' => WatchlistExpiryJob::class, // 1.35
	'cdnPurge' => CdnPurgeJob::class, // 1.27
	'userGroupExpiry' => UserGroupExpiryJob::class, // 1.31
	'clearWatchlistNotifications' => ClearWatchlistNotificationsJob::class, // 1.31
	'userOptionsUpdate' => UserOptionsUpdateJob::class, // 1.34
	'revertedTagUpdate' => RevertedTagUpdateJob::class, // 1.36
	'null' => NullJob::class,
	'userEditCountInit' => UserEditCountInitJob::class, // 1.36
	'parsoidCachePrewarm' => [ // 1.40
		'class' => ParsoidCachePrewarmJob::class,
		'services' => [
			'ParsoidOutputAccess',
			'PageStore',
			'RevisionLookup',
		],
		// tell the JobFactory not to include the $page parameter in the constructor call
		'needsPage' => false,
	],
	'renameUser' => [ // 1.40
		'class' => RenameUserJob::class,
		'services' => [
			'MainConfig',
			'DBLoadBalancerFactory',
		],
	],
];
MediaWiki版本:
1.40
$wgJobClasses = [
	'deletePage' => DeletePageJob::class, // 1.32
	'refreshLinks' => RefreshLinksJob::class, // 1.11
	'deleteLinks' => DeleteLinksJob::class, // 1.27
	'htmlCacheUpdate' => HTMLCacheUpdateJob::class, // 1.11
	'sendMail' => EmaillingJob::class, // 1.11
	'enotifNotify' => EnotifNotifyJob::class, // 1.11
	'fixDoubleRedirect' => DoubleRedirectJob::class,
	'AssembleUploadChunks' => AssembleUploadChunksJob::class,
	'PublishStashedFile' => PublishStashedFileJob::class,
	'ThumbnailRender' => ThumbnailRenderJob::class,
	'recentChangesUpdate' => RecentChangesUpdateJob::class,
	'refreshLinksPrioritized' => RefreshLinksJob::class,
	'refreshLinksDynamic' => RefreshLinksJob::class, // 1.27
	'activityUpdateJob' => ActivityUpdateJob::class, // 1.26
	'categoryMembershipChange' => CategoryMembershipChangeJob::class, // 1.35
	'clearUserWatchlist' => ClearUserWatchlistJob::class, // 1.31
	'watchlistExpiry' => WatchlistExpiryJob::class, // 1.35
	'cdnPurge' => CdnPurgeJob::class, // 1.27
	'userGroupExpiry' => UserGroupExpiryJob::class, // 1.31
	'clearWatchlistNotifications' => ClearWatchlistNotificationsJob::class, // 1.31
	'userOptionsUpdate' => UserOptionsUpdateJob::class, // 1.34
	'revertedTagUpdate' => RevertedTagUpdateJob::class, // 1.36
	'null' => NullJob::class,
	'userEditCountInit' => UserEditCountInitJob::class, // 1.36
	'parsoidCachePrewarm' => [ // 1.40
		'class' => ParsoidCachePrewarmJob::class,
		'services' => [
			'ParsoidOutputAccess',
			'PageStore',
			'RevisionLookup',
		],
		// tell the JobFactory not to include the $page parameter in the constructor call
		'needsPage' => false,
	],
	'renameUser' => [ // 1.40
		'class' => RenameUserJob::class,
		'services' => [
			'MainConfig',
			'DBLoadBalancerFactory',
		],
	],
];
MediaWiki版本:
1.36 – 1.39
$wgJobClasses = [
	'deletePage' => DeletePageJob::class, // 1.32
	'refreshLinks' => RefreshLinksJob::class, // 1.11
	'deleteLinks' => DeleteLinksJob::class, // 1.27
	'htmlCacheUpdate' => HTMLCacheUpdateJob::class, // 1.11
	'sendMail' => EmaillingJob::class, // 1.11
	'enotifNotify' => EnotifNotifyJob::class, // 1.11
	'fixDoubleRedirect' => DoubleRedirectJob::class,
	'AssembleUploadChunks' => AssembleUploadChunksJob::class,
	'PublishStashedFile' => PublishStashedFileJob::class,
	'ThumbnailRender' => ThumbnailRenderJob::class,
	'recentChangesUpdate' => RecentChangesUpdateJob::class,
	'refreshLinksPrioritized' => RefreshLinksJob::class,
	'refreshLinksDynamic' => RefreshLinksJob::class, // 1.27
	'activityUpdateJob' => ActivityUpdateJob::class, // 1.26
	'categoryMembershipChange' => CategoryMembershipChangeJob::class, // 1.35
	'clearUserWatchlist' => ClearUserWatchlistJob::class, // 1.31
	'watchlistExpiry' => WatchlistExpiryJob::class, // 1.35
	'cdnPurge' => CdnPurgeJob::class, // 1.27
	'userGroupExpiry' => UserGroupExpiryJob::class, // 1.31
	'clearWatchlistNotifications' => ClearWatchlistNotificationsJob::class, // 1.31
	'userOptionsUpdate' => UserOptionsUpdateJob::class, // 1.34
	'revertedTagUpdate' => RevertedTagUpdateJob::class, // 1.36
	'enqueue' => EnqueueJob::class, // local queue for multi-DC setups
	'null' => NullJob::class,
	'userEditCountInit' => UserEditCountInitJob::class, // 1.36
];
MediaWiki版本:
1.35
$wgJobClasses = [
	'deletePage' => DeletePageJob::class, // 1.32
	'refreshLinks' => RefreshLinksJob::class, // 1.11
	'deleteLinks' => DeleteLinksJob::class, // 1.27
	'htmlCacheUpdate' => HTMLCacheUpdateJob::class, // 1.11
	'sendMail' => EmaillingJob::class, // 1.11
	'enotifNotify' => EnotifNotifyJob::class, // 1.11
	'fixDoubleRedirect' => DoubleRedirectJob::class,
	'AssembleUploadChunks' => AssembleUploadChunksJob::class,
	'PublishStashedFile' => PublishStashedFileJob::class,
	'ThumbnailRender' => ThumbnailRenderJob::class,
	'recentChangesUpdate' => RecentChangesUpdateJob::class,
	'refreshLinksPrioritized' => RefreshLinksJob::class,
	'refreshLinksDynamic' => RefreshLinksJob::class, // 1.27
	'activityUpdateJob' => ActivityUpdateJob::class, // 1.26
	'categoryMembershipChange' => CategoryMembershipChangeJob::class, // 1.35
	'clearUserWatchlist' => ClearUserWatchlistJob::class, // 1.31
	'watchlistExpiry' => WatchlistExpiryJob::class, // 1.35
	'cdnPurge' => CdnPurgeJob::class, // 1.27
	'userGroupExpiry' => UserGroupExpiryJob::class, // 1.31
	'clearWatchlistNotifications' => ClearWatchlistNotificationsJob::class, // 1.31
	'userOptionsUpdate' => UserOptionsUpdateJob::class, // 1.34
	'enqueue' => EnqueueJob::class, // local queue for multi-DC setups
	'null' => NullJob::class,
];
MediaWiki版本:
1.34
$wgJobClasses = [
	'deletePage' => DeletePageJob::class, // 1.32
	'refreshLinks' => RefreshLinksJob::class, // 1.11
	'deleteLinks' => DeleteLinksJob::class, // 1.27
	'htmlCacheUpdate' => HTMLCacheUpdateJob::class, // 1.11
	'sendMail' => EmaillingJob::class, // 1.11
	'enotifNotify' => EnotifNotifyJob::class, // 1.11
	'fixDoubleRedirect' => DoubleRedirectJob::class,
	'AssembleUploadChunks' => AssembleUploadChunksJob::class,
	'PublishStashedFile' => PublishStashedFileJob::class,
	'ThumbnailRender' => ThumbnailRenderJob::class,
	'recentChangesUpdate' => RecentChangesUpdateJob::class,
	'refreshLinksPrioritized' => RefreshLinksJob::class,
	'refreshLinksDynamic' => RefreshLinksJob::class, // 1.27
	'activityUpdateJob' => ActivityUpdateJob::class, // 1.26
	'categoryMembershipChange' => function ( Title $title, $params = [] ) { // 1.33
		$pc = MediaWikiServices::getInstance()->getParserCache();
		return new CategoryMembershipChangeJob( $pc, $title, $params );
	},
	'clearUserWatchlist' => ClearUserWatchlistJob::class, // 1.31
	'cdnPurge' => CdnPurgeJob::class, // 1.27
	'userGroupExpiry' => UserGroupExpiryJob::class, // 1.31
	'clearWatchlistNotifications' => ClearWatchlistNotificationsJob::class, // 1.31
	'userOptionsUpdate' => UserOptionsUpdateJob::class, // 1.34
	'enqueue' => EnqueueJob::class, // local queue for multi-DC setups
	'null' => NullJob::class,
];
MediaWiki版本:
1.33
$wgJobClasses = [
	'deletePage' => DeletePageJob::class, // 1.32
	'refreshLinks' => RefreshLinksJob::class, // 1.11
	'deleteLinks' => DeleteLinksJob::class, // 1.27
	'htmlCacheUpdate' => HTMLCacheUpdateJob::class, // 1.11
	'sendMail' => EmaillingJob::class, // 1.11
	'enotifNotify' => EnotifNotifyJob::class, // 1.11
	'fixDoubleRedirect' => DoubleRedirectJob::class,
	'AssembleUploadChunks' => AssembleUploadChunksJob::class,
	'PublishStashedFile' => PublishStashedFileJob::class,
	'ThumbnailRender' => ThumbnailRenderJob::class,
	'recentChangesUpdate' => RecentChangesUpdateJob::class,
	'refreshLinksPrioritized' => RefreshLinksJob::class,
	'refreshLinksDynamic' => RefreshLinksJob::class, // 1.27
	'activityUpdateJob' => ActivityUpdateJob::class, // 1.26
	'categoryMembershipChange' => function ( Title $title, $params = [] ) { // 1.33
		$pc = MediaWikiServices::getInstance()->getParserCache();
		return new CategoryMembershipChangeJob( $pc, $title, $params );
	},
	'clearUserWatchlist' => ClearUserWatchlistJob::class, // 1.31
	'cdnPurge' => CdnPurgeJob::class, // 1.27
	'userGroupExpiry' => UserGroupExpiryJob::class, // 1.31
	'clearWatchlistNotifications' => ClearWatchlistNotificationsJob::class, // 1.31
	'enqueue' => EnqueueJob::class, // local queue for multi-DC setups
	'null' => NullJob::class,
];
MediaWiki版本:
1.32
$wgJobClasses = [
	'deletePage' => DeletePageJob::class, // 1.32
	'refreshLinks' => RefreshLinksJob::class, // 1.11
	'deleteLinks' => DeleteLinksJob::class, // 1.27
	'htmlCacheUpdate' => HTMLCacheUpdateJob::class, // 1.11
	'sendMail' => EmaillingJob::class, // 1.11
	'enotifNotify' => EnotifNotifyJob::class, // 1.11
	'fixDoubleRedirect' => DoubleRedirectJob::class,
	'AssembleUploadChunks' => AssembleUploadChunksJob::class,
	'PublishStashedFile' => PublishStashedFileJob::class,
	'ThumbnailRender' => ThumbnailRenderJob::class,
	'recentChangesUpdate' => RecentChangesUpdateJob::class,
	'refreshLinksPrioritized' => RefreshLinksJob::class,
	'refreshLinksDynamic' => RefreshLinksJob::class, // 1.27
	'activityUpdateJob' => ActivityUpdateJob::class, // 1.26
	'categoryMembershipChange' => CategoryMembershipChangeJob::class, // 1.27
	'clearUserWatchlist' => ClearUserWatchlistJob::class, // 1.31
	'cdnPurge' => CdnPurgeJob::class, // 1.27
	'userGroupExpiry' => UserGroupExpiryJob::class, // 1.31
	'clearWatchlistNotifications' => ClearWatchlistNotificationsJob::class, // 1.31
	'enqueue' => EnqueueJob::class, // local queue for multi-DC setups
	'null' => NullJob::class,
];
MediaWiki版本:
1.31
$wgJobClasses = [
	'refreshLinks' => RefreshLinksJob::class, // 1.11
	'deleteLinks' => DeleteLinksJob::class, // 1.27
	'htmlCacheUpdate' => HTMLCacheUpdateJob::class, // 1.11
	'sendMail' => EmaillingJob::class, // 1.11
	'enotifNotify' => EnotifNotifyJob::class, // 1.11
	'fixDoubleRedirect' => DoubleRedirectJob::class,
	'AssembleUploadChunks' => AssembleUploadChunksJob::class,
	'PublishStashedFile' => PublishStashedFileJob::class,
	'ThumbnailRender' => ThumbnailRenderJob::class,
	'recentChangesUpdate' => RecentChangesUpdateJob::class,
	'refreshLinksPrioritized' => RefreshLinksJob::class,
	'refreshLinksDynamic' => RefreshLinksJob::class, // 1.27
	'activityUpdateJob' => ActivityUpdateJob::class, // 1.26
	'categoryMembershipChange' => CategoryMembershipChangeJob::class, // 1.27
	'clearUserWatchlist' => ClearUserWatchlistJob::class, // 1.31
	'cdnPurge' => CdnPurgeJob::class, // 1.27
	'userGroupExpiry' => UserGroupExpiryJob::class, // 1.31
	'clearWatchlistNotifications' => ClearWatchlistNotificationsJob::class, // 1.31
	'enqueue' => EnqueueJob::class, // local queue for multi-DC setups
	'null' => NullJob::class,
];
MediaWiki版本:
1.27 – 1.30
$wgJobClasses = [
	'refreshLinks' => 'RefreshLinksJob', // 1.11
	'deleteLinks' => 'DeleteLinksJob', // 1.27
	'htmlCacheUpdate' => 'HTMLCacheUpdateJob', // 1.11
	'sendMail' => 'EmaillingJob', // 1.11
	'enotifNotify' => 'EnotifNotifyJob', // 1.11
	'fixDoubleRedirect' => 'DoubleRedirectJob',
	'AssembleUploadChunks' => 'AssembleUploadChunksJob',
	'PublishStashedFile' => 'PublishStashedFileJob',
	'ThumbnailRender' => 'ThumbnailRenderJob',
	'recentChangesUpdate' => 'RecentChangesUpdateJob',
	'refreshLinksPrioritized' => 'RefreshLinksJob',
	'refreshLinksDynamic' => 'RefreshLinksJob', // 1.27
	'activityUpdateJob' => 'ActivityUpdateJob', // 1.26
	'categoryMembershipChange' => 'CategoryMembershipChangeJob', // 1.27
	'cdnPurge' => 'CdnPurgeJob', // 1.27
	'enqueue' => 'EnqueueJob', // local queue for multi-DC setups
	'null' => 'NullJob'
];
MediaWiki版本:
1.26
$wgJobClasses = array(
	'refreshLinks' => 'RefreshLinksJob', // 1.11
	'htmlCacheUpdate' => 'HTMLCacheUpdateJob', // 1.11
	'sendMail' => 'EmaillingJob', // 1.11
	'enotifNotify' => 'EnotifNotifyJob', // 1.11
	'fixDoubleRedirect' => 'DoubleRedirectJob',
	'uploadFromUrl' => 'UploadFromUrlJob',
	'AssembleUploadChunks' => 'AssembleUploadChunksJob',
	'PublishStashedFile' => 'PublishStashedFileJob',
	'ThumbnailRender' => 'ThumbnailRenderJob',
	'recentChangesUpdate' => 'RecentChangesUpdateJob',
	'refreshLinksPrioritized' => 'RefreshLinksJob', // for cascading protection
	'activityUpdateJob' => 'ActivityUpdateJob', // 1.26
	'enqueue' => 'EnqueueJob', // local queue for multi-DC setups
	'null' => 'NullJob'
);
MediaWiki版本:
1.11 – 1.12
$wgJobClasses = array(
	'refreshLinks' => 'RefreshLinksJob', // 1.11
	'htmlCacheUpdate' => 'HTMLCacheUpdateJob', // 1.11
	'html_cache_update' => 'HTMLCacheUpdateJob', // backwards-compatible
	'sendMail' => 'EmaillingJob', // 1.11
	'enotifNotify' => 'EnotifNotifyJob', // 1.11
);