PHPackages                             mwstake/mediawiki-component-contentprovisioner - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mwstake/mediawiki-component-contentprovisioner

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mwstake/mediawiki-component-contentprovisioner
==============================================

Provides classes and services to import content into MediaWiki

3.0.2(10mo ago)123.4k—5.2%GPL-3.0-onlyPHPCI passing

Since Oct 14Pushed 5mo ago3 watchersCompare

[ Source](https://github.com/hallowelt/mwstake-mediawiki-component-contentprovisioner)[ Packagist](https://packagist.org/packages/mwstake/mediawiki-component-contentprovisioner)[ RSS](/packages/mwstake-mediawiki-component-contentprovisioner/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (27)Used By (0)

MediaWiki Stakeholders Group - Components
=========================================

[](#mediawiki-stakeholders-group---components)

ContentProvisioner for MediaWiki
================================

[](#contentprovisioner-for-mediawiki)

Provides a mechanism which allows to import some arbitrary information during "maintenance/update.php".

**This code is meant to be executed within the MediaWiki application context. No standalone usage is intended.**

Compatibility
-------------

[](#compatibility)

- `3.0.x` -&gt; MediaWiki 1.43
- `2.0.x` -&gt; MediaWiki 1.39
- `1.0.x` -&gt; MediaWiki 1.35

Usage in MediaWiki extension
----------------------------

[](#usage-in-mediawiki-extension)

Require this component in the `composer.json` of your extension:

```
{
	"require": {
		"mwstake/mediawiki-component-contentprovisioner": "~3"
	}
}
```

Explicit initialization is required. This can be achieved by

- either adding `"callback": "mwsInitComponents"` to your `extension.json`/`skin.json`
- or calling `mwsInitComponents();` within you extensions/skins custom `callback` method

See also [`mwstake/mediawiki-componentloader`](https://github.com/hallowelt/mwstake-mediawiki-componentloader).

### Register content to provision

[](#register-content-to-provision)

Initially, content provisioner needs "manifest" file to get data to import from. JSON file with such structure is needed:

```
{
	"Some_page": {
		"lang": "de",
		"target_title": "Some_page",
		"content_path": "/pages/Main/Some_page.wiki",
		"sha1": "",
		"old_sha1": []
	},
	"Template:Some_template": {
		"lang": "en",
		"target_title": "Template:Some_template",
		"content_path": "/pages/Template/Some_template.wiki",
		"sha1": "",
		"old_sha1": []
	}
}
```

Here, "old\_sha1" key contains hashes for previous content versions. It is needed for cases with already existing wiki pages, to identify if they are just outdated or were added/changed by user.

Such files should be registered in "extension.json" of particular extension that way:

```
{
	"attributes": {
		"MWStakeContentProvisioner": {
			"ContentManifests": {
				"DefaultContentProvisioner": [
					"extensions/SomeExtension/path/to/manifest.json"
				]
			}
		}
	}
}
```

Manifests added to "DefaultContentProvisioner" key will be processed by default content provisioner. That content provisioner just imports corresponding wiki pages which are provided by manifest.

All registered files will be processed during next update with "maintenance/update.php".

Custom content provisioners
---------------------------

[](#custom-content-provisioners)

Extensions may implement their own import logic within their own content provisioners. To do so, it is needed to have a class, implementing "\\MWStake\\MediaWiki\\Component\\ContentProvisioner\\IContentProvisioner" interface.

### Register custom content provisioner

[](#register-custom-content-provisioner)

To be executed during "update.php", custom content provisioner must be registered in such way (ObjectFactory specification):

```
{
	"attributes": {
		"MWStakeContentProvisioner": {
			"ContentProvisioners": {
				"ArbitraryContentProvisionerKey": {
					"class": "\\MediaWiki\\Path\\To\\ArbitraryProvisioner",
					"args": [
						"ManifestsKey"
					],
					"services": [
						"ArbitraryService",
						"SomeOtherService"
					]
				}
			}
		}
	}
}
```

Here "ArbitraryContentProvisionerKey" is a key, which is used just to identify content provisioner. It is used mostly for logging. "ManifestsKey" is a key which will help to recognize manifests which should be processed by this specific content provisioner.

### Register custom content to import

[](#register-custom-content-to-import)

By default, custom manifest file, which will be processed by custom content provisioner, must be registered such way:

```
{
	"attributes": {
		"MWStakeContentProvisioner": {
			"ContentManifests": {
				"ManifestsKey": [
					"extensions/SomeExtension/path1/to/manifest1.json",
					"extensions/SomeExtension/path2/to/manifest2.json"
				]
			}
		}
	}
}
```

Here "ManifestsKey" must be the same value which was passed to that content provisioner as first argument.

Skip content provisioners
-------------------------

[](#skip-content-provisioners)

If some of content provisioners needs to be disabled, it can be done with `$mwsgContentProvisionerSkip` global. Let's assume that there is some custom content provisioner which is registered that way:

```
{
	"attributes": {
		"MWStakeContentProvisioner": {
			"ContentProvisioners": {
				"ArbitraryContentProvisionerKey": {
					"class": "\\MediaWiki\\Path\\To\\ArbitraryProvisioner",
					"args": [
						"ManifestsKey"
					],
					"services": [
						"ArbitraryService",
						"SomeOtherService"
					]
				}
			}
		}
	}
}
```

Then it can be disabled in that way:

```
$mwsgContentProvisionerSkip[] = 'ArbitraryContentProvisionerKey';
```

If there is a need to disable default content provisioner, it looks similar:

```
$mwsgContentProvisionerSkip[] = 'DefaultContentProvisioner';
```

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance63

Regular maintenance activity

Popularity29

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 51.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~40 days

Recently: every ~7 days

Total

26

Last Release

292d ago

Major Versions

1.0.x-dev → 2.0.02023-04-11

2.1.6 → 3.0.02025-04-01

2.1.7 → 3.0.22025-07-23

### Community

Maintainers

![](https://www.gravatar.com/avatar/e39dfe9d3120de240053c4283e905254e8774d3278da25ad79974a8742c55192?d=identicon)[osnard](/maintainers/osnard)

---

Top Contributors

[![HamishSlater](https://avatars.githubusercontent.com/u/26261210?v=4)](https://github.com/HamishSlater "HamishSlater (19 commits)")[![osnard](https://avatars.githubusercontent.com/u/1201528?v=4)](https://github.com/osnard "osnard (16 commits)")[![it-spiderman](https://avatars.githubusercontent.com/u/13665198?v=4)](https://github.com/it-spiderman "it-spiderman (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mwstake-mediawiki-component-contentprovisioner/health.svg)

```
[![Health](https://phpackages.com/badges/mwstake-mediawiki-component-contentprovisioner/health.svg)](https://phpackages.com/packages/mwstake-mediawiki-component-contentprovisioner)
```

###  Alternatives

[rainlab/blog-plugin

Blog plugin for October CMS

17257.7k](/packages/rainlab-blog-plugin)[rainlab/builder-plugin

Builder plugin for October CMS

17147.2k1](/packages/rainlab-builder-plugin)[pfefferle/wordpress-activitypub

The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.

5671.4k1](/packages/pfefferle-wordpress-activitypub)[civicrm/civicrm-drupal-8

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

18238.1k2](/packages/civicrm-civicrm-drupal-8)[mediawiki/semantic-glossary

A terminology markup extension with a Semantic MediaWiki back-end

1352.4k](/packages/mediawiki-semantic-glossary)[humanmade/lottie-lite

A lightweight Lottie Animations Extension for WordPress

374.3k](/packages/humanmade-lottie-lite)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
