yiisoft / config

Configuration management
https://www.yiiframework.com/
BSD 3-Clause "New" or "Revised" License
31 stars 11 forks source link

Meta-value for parameters that need user's configuration #138

Open BoShurik opened 1 year ago

BoShurik commented 1 year ago

For example: https://github.com/yiisoft/yii-cycle/blob/master/config/params.php#L35 'connections' => [] needs to be configured

'connections' => [
    // Example SQLite connection:
    'sqlite' => new \Cycle\Database\Config\SQLiteDriverConfig(
        connection: new \Cycle\Database\Config\SQLite\DsnConnectionConfig(
            // see https://www.php.net/manual/pdo.construct.php, DSN for connection syntax
            dsn: 'sqlite:runtime/database.db'
        )
    ),
],

Nice to have meta-value like

'connections' => new ConfigurationNeeded([
    'sqlite' => '...'
])

When config-plugin meets this value it may throw error that application is not configured properly. Additionally it may prompt values during composer install phase