Configuration variables
<?php
$this->taskConfiguration()
->initConfig(
'config_key' => [
'question' => 'question ?',
'default' => 'ddd',
'choices' => ['choice'],
]
])
->initSettings([
'config_key' => 'value'
]),
->initLocal([
'config_key' => [
'question' => 'question ?',
'empty' => true,
],
'config_key_2' => [
'question' => 'question ?',
'formatter' => function ($value) {
$formatValue = trim($value);
return $formatValue;
},
],
'config_key_3' => [
'question' => 'question ?',
'if' => function (array $currentConfig) {
return $currentConfig['config_key_2'] === 'toto';
},
'formatter' => function ($value) {
$formatValue = trim($value);
return $formatValue;
},
],
'config_key_4' => [
'question' => 'password ?',
'hidden' => true,
],
])
->localFilePath($localFilePath)
->configFilePath($configFilePath)
->force()
->emptyPattern('empty')
->run();
?>
initConfig(array $config)
Init config variablesinitSettings(array $config)
Init settings variablesinitLocal(array $config)
Init settings variableslocalFilePath($filePath)
Set local file path, Default User HomeconfigFilePath($filePath)
Set config file path, default Project Dir / .my_configforce($bool = null)
Force questionemptyPattern($emptyPattern)
Empty patterncurrentState()
restoreState($input = null, $output = null, $io = null)