| Status: | effective |
| Progress: | 100% |
| Version: | 7.3.0+ |
Help:Configuration preloading
| Table of Contents | |
|---|---|
Configuration preloading was added in Semantic MediaWiki 3.2.0Released on 7 September 2020 and compatible with MW 1.31.0 - 1.35.x.1 as a way to preload reusable configuration profiles, reducing manual setup when creating new wiki instances.
$smwgConfigProfilesApplies configuration profiles shipped with Semantic MediaWiki.2 The require statements this page recommended for Semantic MediaWiki 7.0.0Released on 4 June 2026 and compatible with MW 1.43.x - 1.46.x. do not apply a default profile's settings, and fail with an error for media.php.
Profiles
Default profiles
The following configuration profiles are provided by default and demonstrate the expected file format:
Profile "media.php" – Defines common configuration settings relating to media file usage
Profile "elastic-fileingest.php" – Defines common configuration settings in connection with the SMWElasticStorequery backend and file ingestion
Profile "db-primary-keys.php" – Adds primary keys to Semantic MediaWiki owned tables to help specialized relational datastore environments like "Percona XtraDB Cluster"
Profile "developer.php" – Defines common configuration settings mostly relevant when developing in connection with Semantic MediaWiki
Custom profiles
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
Default profiles
As of Semantic MediaWiki 7.3.0Released on 16 September 2026 and compatible with MW 1.43.x - 1.46.x., list the profiles by name in configuration parameter $smwgConfigProfilesApplies configuration profiles shipped with Semantic MediaWiki:
$smwgConfigProfiles = [ 'developer', 'media' ];
Profiles are applied after the "LocalSettings.php" file, so their settings take precedence over the same settings there. Run maintenance script "update.php" (MediaWiki.org) after enabling or removing db-primary-keys, elastic-fileingest or media. The wiki does not start when a default profile is also loaded with require, so remove such lines.
From Semantic MediaWiki 7.0.0Released on 4 June 2026 and compatible with MW 1.43.x - 1.46.x. to 7.2.x there is no supported way to apply a default profile.
Custom profiles
As of Semantic MediaWiki 7.0.0Released on 4 June 2026 and compatible with MW 1.43.x - 1.46.x., load a custom profile with require. The file must assign complete values, such as $smwgPageSpecialProperties = [ '_MDAT', '_MIME' ];, instead of returning them:
require __DIR__ . '/path/to/file/myCustomConfiguration.php';
Usage (prior to 7.0.0)
Default profiles
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
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'
);
See also
- Help page on configuration parameter
$smwgConfigProfilesApplies configuration profiles shipped with Semantic MediaWiki - Help page on the
enableSemanticsfunction - Help page with an overview of available configuration parameters
References
- ^ Semantic MediaWiki: GitHub pull request gh:smw:4684
- ^ | Semantic MediaWiki: GitHub pull request gh:smw:7118