Page MenuHomePhabricator

Settings: create a SettingsSource for loading settings from a PHP file.
Closed, ResolvedPublic

Description

We need an implementation of SettingsSource that reads a PHP file using an include statement. The included PHP file is expected to return a nested array that has the same structure as a JSON or YAML based settings file would have. This SettingsSource should be non-cacheable.

Loading PHP files is the fastest way to ingest data. Since it uses PHP's opcode cache, it's even faster than APCu, especially since reading nested arrays from APCu involves copying them recursively.

We will likely want to make use of this by pre-generating settings files as PHP data structures in a build step prior to deployment, for things that will not change more quickly than the code. Combining extension.json files into such a structure is a prime target.

Event Timeline

Change 745318 had a related patch set uploaded (by D3r1ck01; author: Derick Alangi):

[mediawiki/core@master] [WIP] Settings: Introduce PhpSettingsSource for provisioning settings

https://gerrit.wikimedia.org/r/745318

DAlangi_WMF changed the task status from Open to In Progress.Dec 9 2021, 8:35 AM
DAlangi_WMF claimed this task.

Change 745318 merged by jenkins-bot:

[mediawiki/core@master] Settings: Introduce PhpSettingsSource for provisioning settings

https://gerrit.wikimedia.org/r/745318