2023-01-01 20:23:53 +00:00
|
|
|
<?php
|
|
|
|
namespace Misuzu\Config;
|
|
|
|
|
2023-01-05 03:20:31 +00:00
|
|
|
// getValue (and hasValue?) should probably be replaced with something that allows grouped loading
|
|
|
|
// that way the entire config doesn't have to be kept in memory on every request
|
|
|
|
// this probably has to be delayed until the backwards compat static Config object isn't needed anymore
|
|
|
|
// otherwise there'd be increased overhead
|
|
|
|
// bulk operations for setValue and removeValue would also be cool
|
|
|
|
|
2023-01-01 20:23:53 +00:00
|
|
|
interface IConfig {
|
|
|
|
function scopeTo(string $prefix): IConfig;
|
|
|
|
function getNames(): array;
|
|
|
|
function getValue(string $name, string $type = CfgType::T_ANY, $default = null): mixed;
|
|
|
|
function hasValue(string $name): bool;
|
|
|
|
function setValue(string $name, $value, bool $save = true): void;
|
|
|
|
function removeValue(string $name, bool $save = true): void;
|
|
|
|
}
|