Manual:$wgJobClasses/pl

From Linux Web Expert

Revision as of 00:05, 30 March 2024 by imported>FuzzyBot (Updating to match new version of source page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<translate> Extensions</translate>: $wgJobClasses
Maps jobs to their handling classes.
<translate> Introduced in version:</translate>1.11.0 (r23173)
<translate> Removed in version:</translate><translate> still in use</translate>
<translate> Allowed values:</translate>(array)
<translate> Default value:</translate>patrz poniżej

Szczegóły

Maps jobs to their handling classes. Extensions can add to this to provide custom jobs. Zobacz Manual:Job queue/For developers , aby uzyskać więcej informacji.

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.

Rozszerzenia

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.

Default value

<td class="mw-version-versionbox" title="<translate nowrap> The latest stable version is <tvar name=1>1.41</tvar></translate>">
<translate> ≥</translate> 1.42
<translate> MediaWiki version:</translate>
$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',
		],
	],
];
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.41</tvar> is stable version</translate>">
1.41
<translate> MediaWiki version:</translate>
$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',
		],
	],
];
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.40</tvar> is legacy version</translate>">
1.40
<translate> MediaWiki version:</translate>
$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',
		],
	],
];
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.39</tvar> is legacy version</translate>">
1.36 – 1.39
<translate> MediaWiki versions:</translate>
$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
];
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.35</tvar> is unsupported version</translate>">
1.35
<translate> MediaWiki version:</translate>
$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,
];
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.34</tvar> is unsupported version</translate>">
1.34
<translate> MediaWiki version:</translate>
$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,
];
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.33</tvar> is unsupported version</translate>">
1.33
<translate> MediaWiki version:</translate>
$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,
];
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.32</tvar> is unsupported version</translate>">
1.32
<translate> MediaWiki version:</translate>
$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,
];
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.31</tvar> is unsupported version</translate>">
1.31
<translate> MediaWiki version:</translate>
$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,
];
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.30</tvar> is unsupported version</translate>">
1.27 – 1.30
<translate> MediaWiki versions:</translate>
$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'
];
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.26</tvar> is unsupported version</translate>">
1.26
Wersja MediaWiki:
$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'
);
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.12</tvar> is unsupported version</translate>">
1.11 – 1.12
<translate> MediaWiki versions:</translate>
$wgJobClasses = array(
	'refreshLinks' => 'RefreshLinksJob', // 1.11
	'htmlCacheUpdate' => 'HTMLCacheUpdateJob', // 1.11
	'html_cache_update' => 'HTMLCacheUpdateJob', // backwards-compatible
	'sendMail' => 'EmaillingJob', // 1.11
	'enotifNotify' => 'EnotifNotifyJob', // 1.11
);