|
MediaWiki master
|
Aggregates multiple config schemas. More...
Inherits MediaWiki\Settings\Config\ConfigSchema.

Public Member Functions | |
| addDefaults (array $defaults, string $sourceName='unknown') | |
| Declare default values. | |
| addDynamicDefaults (array $dynamicDefaults, string $sourceName='unknown') | |
| Declare dynamic defaults. | |
| addMergeStrategies (array $mergeStrategies, string $sourceName='unknown') | |
| Declare merge strategies. | |
| addSchema (string $key, array $schema, string $sourceName='unknown') | |
| Add a config schema to the aggregator. | |
| addSchemaMulti (array $schemas) | |
| Add multiple schema definitions. | |
| addTypes (array $types, string $sourceName='unknown') | |
| Declare types. | |
| getDefaultFor (string $key) | |
| Get default value for the $key. | |
| getDefaults () | |
| Get all defined default values. | |
| getDefinedKeys () | |
| Get a list of all defined keys. | |
| getDynamicDefaultDeclarationFor (string $key) | |
| Get a dynamic default declaration for $key. | |
| getDynamicDefaults () | |
| Get all dynamic default declarations. | |
| getMergeStrategies () | |
| Get all merge strategies indexed by config key. | |
| getMergeStrategyFor (string $key) | |
| Get the merge strategy defined for the $key, or null if none defined. | |
| getMergeStrategyNames () | |
| Get the names of all known merge strategies. | |
| getSchemaFor (string $key) | |
| Get the schema for the given key. | |
| getTypeFor (string $key) | |
| Get type for the $key, or null if the type is not known. | |
| getTypes () | |
| Get all known types. | |
| hasDefaultFor (string $key) | |
| Check if the $key has a default values set in the schema. | |
| hasSchemaFor (string $key) | |
| Check whether schema for $key is defined. | |
| validateConfig (Config $config) | |
| Check if the given config conforms to the schema. | |
| validateValue (string $key, $value) | |
| Check if the given value conforms to the relevant schema. | |
Aggregates multiple config schemas.
Some aspects of the schema are maintained separately, to optimized for settings defaults, types and merge strategies in bulk, and later accessing them independently of each other, for each config key.
Definition at line 21 of file ConfigSchemaAggregator.php.
| MediaWiki\Settings\Config\ConfigSchemaAggregator::addDefaults | ( | array | $defaults, |
| string | $sourceName = 'unknown' ) |
Declare default values.
| array | $defaults | |
| string | $sourceName |
Definition at line 144 of file ConfigSchemaAggregator.php.
| MediaWiki\Settings\Config\ConfigSchemaAggregator::addDynamicDefaults | ( | array | $dynamicDefaults, |
| string | $sourceName = 'unknown' ) |
Declare dynamic defaults.
| array | $dynamicDefaults | |
| string | $sourceName |
Definition at line 184 of file ConfigSchemaAggregator.php.
References $dynamicDefaults.
| MediaWiki\Settings\Config\ConfigSchemaAggregator::addMergeStrategies | ( | array | $mergeStrategies, |
| string | $sourceName = 'unknown' ) |
Declare merge strategies.
| array | $mergeStrategies | |
| string | $sourceName |
Definition at line 164 of file ConfigSchemaAggregator.php.
| MediaWiki\Settings\Config\ConfigSchemaAggregator::addSchema | ( | string | $key, |
| array | $schema, | ||
| string | $sourceName = 'unknown' ) |
Add a config schema to the aggregator.
| string | $key | |
| array | $schema | |
| string | $sourceName |
Definition at line 52 of file ConfigSchemaAggregator.php.
Referenced by MediaWiki\Settings\Config\ConfigSchemaAggregator\addSchemaMulti(), and GenerateConfigSchema\generateSchemaArray().
| MediaWiki\Settings\Config\ConfigSchemaAggregator::addSchemaMulti | ( | array | $schemas | ) |
Add multiple schema definitions.
| array[] | $schemas | An associative array mapping config variable names to their respective schemas. |
Definition at line 106 of file ConfigSchemaAggregator.php.
References MediaWiki\Settings\Config\ConfigSchemaAggregator\addSchema().
| MediaWiki\Settings\Config\ConfigSchemaAggregator::addTypes | ( | array | $types, |
| string | $sourceName = 'unknown' ) |
Declare types.
| array | $types | |
| string | $sourceName |
Definition at line 154 of file ConfigSchemaAggregator.php.
| MediaWiki\Settings\Config\ConfigSchemaAggregator::getDefaultFor | ( | string | $key | ) |
Get default value for the $key.
If no default value was declared, this returns null.
| string | $key |
Implements MediaWiki\Settings\Config\ConfigSchema.
Definition at line 305 of file ConfigSchemaAggregator.php.
| MediaWiki\Settings\Config\ConfigSchemaAggregator::getDefaults | ( | ) |
Get all defined default values.
Implements MediaWiki\Settings\Config\ConfigSchema.
Definition at line 256 of file ConfigSchemaAggregator.php.
| MediaWiki\Settings\Config\ConfigSchemaAggregator::getDefinedKeys | ( | ) |
Get a list of all defined keys.
Implements MediaWiki\Settings\Config\ConfigSchema.
Definition at line 198 of file ConfigSchemaAggregator.php.
| MediaWiki\Settings\Config\ConfigSchemaAggregator::getDynamicDefaultDeclarationFor | ( | string | $key | ) |
Get a dynamic default declaration for $key.
If no dynamic default is declared, this returns null.
| string | $key |
Definition at line 326 of file ConfigSchemaAggregator.php.
| MediaWiki\Settings\Config\ConfigSchemaAggregator::getDynamicDefaults | ( | ) |
Get all dynamic default declarations.
Implements MediaWiki\Settings\Config\ConfigSchema.
Definition at line 284 of file ConfigSchemaAggregator.php.
| MediaWiki\Settings\Config\ConfigSchemaAggregator::getMergeStrategies | ( | ) |
Get all merge strategies indexed by config key.
If there is no merge strategy for a given key, the element will be absent.
Definition at line 350 of file ConfigSchemaAggregator.php.
| MediaWiki\Settings\Config\ConfigSchemaAggregator::getMergeStrategyFor | ( | string | $key | ) |
Get the merge strategy defined for the $key, or null if none defined.
| string | $key |
| SettingsBuilderException | if merge strategy name is invalid. |
Implements MediaWiki\Settings\Config\ConfigSchema.
Definition at line 337 of file ConfigSchemaAggregator.php.
| MediaWiki\Settings\Config\ConfigSchemaAggregator::getMergeStrategyNames | ( | ) |
Get the names of all known merge strategies.
Definition at line 274 of file ConfigSchemaAggregator.php.
| MediaWiki\Settings\Config\ConfigSchemaAggregator::getSchemaFor | ( | string | $key | ) |
Get the schema for the given key.
| string | $key |
Definition at line 217 of file ConfigSchemaAggregator.php.
| MediaWiki\Settings\Config\ConfigSchemaAggregator::getTypeFor | ( | string | $key | ) |
Get type for the $key, or null if the type is not known.
| string | $key |
Definition at line 315 of file ConfigSchemaAggregator.php.
| MediaWiki\Settings\Config\ConfigSchemaAggregator::getTypes | ( | ) |
Get all known types.
Definition at line 265 of file ConfigSchemaAggregator.php.
| MediaWiki\Settings\Config\ConfigSchemaAggregator::hasDefaultFor | ( | string | $key | ) |
Check if the $key has a default values set in the schema.
| string | $key |
Implements MediaWiki\Settings\Config\ConfigSchema.
Definition at line 294 of file ConfigSchemaAggregator.php.
| MediaWiki\Settings\Config\ConfigSchemaAggregator::hasSchemaFor | ( | string | $key | ) |
Check whether schema for $key is defined.
| string | $key |
Implements MediaWiki\Settings\Config\ConfigSchema.
Definition at line 245 of file ConfigSchemaAggregator.php.
| MediaWiki\Settings\Config\ConfigSchemaAggregator::validateConfig | ( | Config | $config | ) |
Check if the given config conforms to the schema.
Note that all keys for which a schema was defined are required to be present in $config.
| Config | $config |
Definition at line 427 of file ConfigSchemaAggregator.php.
References StatusValue\fatal(), MediaWiki\Config\Config\get(), and MediaWiki\Config\Config\has().
| MediaWiki\Settings\Config\ConfigSchemaAggregator::validateValue | ( | string | $key, |
| $value ) |
Check if the given value conforms to the relevant schema.
| string | $key | |
| mixed | $value |
Definition at line 451 of file ConfigSchemaAggregator.php.