Help:Configuration preloading

From semantic-mediawiki.org
Table of Contents

Configuration preloading was added in Semantic MediaWiki 3.2.0Released on an unknown date and compatible with unknown versions of MediaWiki.1 as mechanism to preload a set of configurations that would otherwise have to be added manually each time a wiki is created.

The objective of the preloading is to allow users to prepare profiles that are reusable and minimize the effort to customize a Semantic MediaWiki instance for a specific use case.

Profiles[edit]

Default profiles[edit]

The following configuration profiles are provided by default and demonstrate the expected file format:

In future it should be easily possible to provide other profiles to help users more quickly to adapt their installation without having to identify each single configuration necessary to enable a certain aspect of the software.

Custom profiles[edit]

In case a wiki environment has common configuration settings that need to be preserved and reused then it is possible to store those in a separate ".php"-file.

Usage[edit]

Default profiles[edit]

In case a wiki environment wants to make use of default configuration profiles they can be preloaded like, e.g.:

enableSemantics( 'example.org' )->loadDefaultConfigFrom(
    'developer.php',
    'media.php'
);

Custom profiles[edit]

In case a wiki environment wants to make use of customized configuration profiles they can be preloaded like, e.g.:

enableSemantics( 'example.org' )->loadConfigFrom(
    __DIR__ . '/path/to/file/myCustomConfiguration.php'
);

Note[edit]

As with any configuration that is added to the "LocalSettings.php" file, the loading sequence is important. Adding something before or after a certain will have an effect of how the configuration is treated. This means that a configuration added via a configuration profile will be overridden by any configuration of the same name that is added after loadDefaultConfigFrom or loadConfigFrom, i.e. after including these configuration.

See also[edit]

References

  1. ^  Semantic MediaWiki: GitHub pull request gh:smw:4684