Config values can be set in three ways:
private static variables on any class within a SilverStripe projectConfig::inst()->update('Director', 'environment_type', 'dev')Generally it's best to set config values via the first 2 methods as these are statically cached when flushing the cache.
class MyDataObject extends DataObject {
private static $db = array(
'Title' => 'Varchar',
);
}
All
private staticclass variables in a SilverStripe project's code (including modules, but not packages in thevendor/directory) will be loaded into theConfig.
You can add this to mysite/_config/config.yml (or any other YAML file in that path).
Director: environment_type: dev
Using YAML files is a great way to override default
Configvalues for core classes or modules
This would typically be done in mysite/_config.php
Config::inst()->update('Director', 'environment_type', 'dev');
Updating the
Configin PHP should be avoided where possible as it's slower than using the cached values