Skip to content

ConfigManager

Defined in: packages/engine/src/constants/Configuration.ts:351

Configuration manager for engine settings

const configManager = new ConfigManager();
configManager.set('performance.defaultCacheSize', 2000);
const cacheSize = configManager.get('performance.defaultCacheSize');
new ConfigManager(config?): ConfigManager;

Defined in: packages/engine/src/constants/Configuration.ts:354

ParameterType
configPartial<EngineConfig>

ConfigManager

get<T>(path): T;

Defined in: packages/engine/src/constants/Configuration.ts:364

Get configuration value by path

Type Parameter
T
ParameterTypeDescription
pathstringDot-notation path to config value

T

Configuration value


getConfig(): EngineConfig;

Defined in: packages/engine/src/constants/Configuration.ts:430

Get complete configuration.

A detached copy, section objects included. A top-level spread would hand the caller this manager’s own section objects, so getConfig().vm.x = 1 would be an undeclared back door into set, bypassing its path validation and reaching every later get.

EngineConfig


reset(): void;

Defined in: packages/engine/src/constants/Configuration.ts:453

Reset to default configuration.

Goes through mergeEngineConfig for the same reason the constructor does. A top-level { ...DEFAULT_CONFIG } copies the six section references, not the sections, so after a reset this manager’s performance object WAS DEFAULT_CONFIG.performance and the next set('performance.x', ...) wrote into the module constant. That constant is what every ExpressionEngine is built from, so one manager’s reset could change the cache size, instruction ceiling or allocation budget of every engine constructed later in the process.

void


set<T>(path, value): void;

Defined in: packages/engine/src/constants/Configuration.ts:389

Set configuration value by path

Type Parameter
T
ParameterTypeDescription
pathstringDot-notation path to config value
valueTNew value

void


update(config): void;

Defined in: packages/engine/src/constants/Configuration.ts:437

Update multiple configuration values

ParameterType
configPartial<EngineConfig>

void


validate(): ValidationResult;

Defined in: packages/engine/src/constants/Configuration.ts:460

Validate configuration values

ValidationResult