PHPackages                             mwstake/mediawiki-component-dynamicconfig - 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-dynamicconfig

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

mwstake/mediawiki-component-dynamicconfig
=========================================

Dynamic config manager

2.0.2(10mo ago)22.2k[1 issues](https://github.com/hallowelt/mwstake-mediawiki-component-dynamicconfig/issues)GPL-3.0-onlyPHPCI passing

Since May 23Pushed 5mo ago3 watchersCompare

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

READMEChangelog (8)Dependencies (7)Versions (20)Used By (0)

Dynamic config
==============

[](#dynamic-config)

This component is designed to store configuration variables in Database and load (and apply) them from there. It is primarely meant to replace `config` directory in BlueSpiceFoundation and configs stored in actual static PHP files. It can be used to store any number of configurations, basically everything that goes into `LocalSettings.php`, except for core configs, like DB connection and similar.

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

[](#compatibility)

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

Registering configs
-------------------

[](#registering-configs)

- Implement a class that implements `MWStake\MediaWiki\Component\DynamicConfig\IDynamicConfig` interface.
- Use `MWStakeDynamicConfigRegisterConfigs` Hook to register your configs.

In case your config sets/reads MW globals (`$GLOBALS`), make it implement `MWStake\MediaWiki\Component\DynamicConfig\GlobalsAwareDynamicConfig` interface as well.

Using configs
-------------

[](#using-configs)

To store config to DB, use

```
    $manager = \MediaWiki\MediaWikiServices::getInstance()->getService( 'MWStakeDynamicConfigManager' );
    $manager->storeConfig( $config, $dataToBePassedToTheConfig );
```

This will call `serialize` method on the `IDynamicConfig` object with `$dataToBePassedToTheConfig` as an argument. This method must return a string to be stored to the Database.

If your config's `shouldAutoApply` method returns `true`, the config will be auto-applied on `SetupAfterCache` hook. Otherwise, you can apply it manually by calling

```
    $manager = \MediaWiki\MediaWikiServices::getInstance()->getService( 'MWStakeDynamicConfigManager' );
    $manager->applyConfig( $config );
```

When applying, method `apply` will be called on the `IDynamicConfig` object with the data from the Database as an argument. Config itself is responsible for parsing the data and applying it.

Backups
-------

[](#backups)

On every change of a config value, a backup will be made. System will create up to 5 backups, after which it will rotate, deleting the oldest one.

### Restoring backups

[](#restoring-backups)

#### From code

[](#from-code)

```
    $manager = \MediaWiki\MediaWikiServices::getInstance()->getService( 'MWStakeDynamicConfigManager' );
    $manager->restoreBackup( $config, $dataTime ); // DateTime object matching the timestamp of available backup
```

#### From CLI

[](#from-cli)

```
  # List available config types
  php vendor/mwstake/mediawiki-component-dynamicconfig/maintenance/restoreFromBackup.php --list-types

  # List avilable backups for a type
  php vendor/mwstake/mediawiki-component-dynamicconfig/maintenance/restoreFromBackup.php --list-backups --config={key}

  # Restore a backup (timestamp in YmdHis format)
  php vendor/mwstake/mediawiki-component-dynamicconfig/maintenance/restoreFromBackup.php --backup-timestamp=20230523104627 --config={key}
```

Note: This will assume component is installed in the root `vendor` directory. If its not, specify path to `Maintenance.php`, as the first argument of the script.

```
  # List available config types
  php vendor/mwstake/mediawiki-component-dynamicconfig/maintenance/restoreFromBackup.php some/path/Maintenance.php --list-types
```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance54

Moderate activity, may be stable

Popularity22

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 51.3% 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 ~43 days

Recently: every ~25 days

Total

19

Last Release

312d ago

Major Versions

1.0.13 → 2.0.02025-03-24

### 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)")[![it-spiderman](https://avatars.githubusercontent.com/u/13665198?v=4)](https://github.com/it-spiderman "it-spiderman (14 commits)")[![osnard](https://avatars.githubusercontent.com/u/1201528?v=4)](https://github.com/osnard "osnard (5 commits)")

### Embed Badge

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

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

###  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)
