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.3(2mo ago)128.5k↑52.3%GPL-3.0-onlyPHPCI passing

Since Oct 14Pushed 2mo ago2 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 2d ago

READMEChangelog (10)Dependencies (15)Versions (28)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

48

—

FairBetter than 93% of packages

Maintenance83

Actively maintained with recent releases

Popularity29

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 52.6% 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 ~49 days

Recently: every ~70 days

Total

27

Last Release

87d 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

2.1.8 → 3.0.32026-04-07

### 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 (20 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

[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.5k10](/packages/helsingborg-stad-municipio)[mediawiki/maps

Adds various mapping features to MediaWiki

84152.3k3](/packages/mediawiki-maps)[starcitizentools/citizen-skin

A beautiful, usable, responsive MediaWiki skin with in-depth extension support. Originally developed for the Star Citizen Wiki.

3376.6k](/packages/starcitizentools-citizen-skin)[civicrm/civicrm-drupal-8

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

19251.4k3](/packages/civicrm-civicrm-drupal-8)[altis/core

Core module for Altis

19228.0k3](/packages/altis-core)[pfefferle/wordpress-activitypub

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

5721.7k4](/packages/pfefferle-wordpress-activitypub)

PHPackages © 2026

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