MediaWiki REL1_40
MediaWiki\Settings\Source\PhpSettingsSource Class Reference

Settings loaded from a PHP file path as an array structure. More...

Inherits MediaWiki\Settings\Source\SettingsSource, and MediaWiki\Settings\Source\SettingsIncludeLocator.

Collaboration diagram for MediaWiki\Settings\Source\PhpSettingsSource:

Public Member Functions

 __construct (string $path)
 
 __toString ()
 Returns this file source as a string.
 
 load ()
 Loads an array structure from a PHP file and return for using with merge strategies to apply on configs.
 
 locateInclude (string $location)
 This method defines how a relative reference to the location of another settings source is interpreted.
 

Detailed Description

Settings loaded from a PHP file path as an array structure.

Since
1.38

Definition at line 13 of file PhpSettingsSource.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Settings\Source\PhpSettingsSource::__construct ( string $path)
Parameters
string$path

Definition at line 23 of file PhpSettingsSource.php.

References $path.

Member Function Documentation

◆ __toString()

MediaWiki\Settings\Source\PhpSettingsSource::__toString ( )

Returns this file source as a string.

Returns
string

Definition at line 81 of file PhpSettingsSource.php.

◆ load()

MediaWiki\Settings\Source\PhpSettingsSource::load ( )

Loads an array structure from a PHP file and return for using with merge strategies to apply on configs.

Exceptions
SettingsBuilderException
Returns
array

Implements MediaWiki\Settings\Source\SettingsSource.

Definition at line 34 of file PhpSettingsSource.php.

References $path.

◆ locateInclude()

MediaWiki\Settings\Source\PhpSettingsSource::locateInclude ( string $location)

This method defines how a relative reference to the location of another settings source is interpreted.

It tries to make $location absolute by interpreting it as relative to the location of the SettingsSource it originates from.

Implementation are "best effort". If a location cannot be made absolute, it may be returned as-is. Implementations are also free to throw a SettingsBuilderException to indicate that the given include location is not supported in this context.

Parameters
string$location
Returns
string
Exceptions
SettingsBuilderExceptionif the given location cannot be used as an include by the current source.

Implements MediaWiki\Settings\Source\SettingsIncludeLocator.

Definition at line 85 of file PhpSettingsSource.php.


The documentation for this class was generated from the following file: