5 Commits
0.1.0 ... 0.2.1

Author SHA1 Message Date
Aerex
67e34e52b8 refactor(lib): Fixed API change for process symfony 2022-06-19 12:44:50 -05:00
Aerex
dc96556b5a chore: Updated to sabre to version 4.3 2022-06-19 11:25:30 -05:00
Aerex
31822ab7e7 fix: Updated TreeBuilder contructor arguments 2022-02-23 20:59:44 -06:00
Aerex
50e9a4c621 chore: Updated dependencies 2022-02-23 20:54:07 -06:00
Aerex
0710ef474f fix(console): Fixed the questions asked in console not working correctly 2021-10-14 08:45:11 -05:00
5 changed files with 37 additions and 23 deletions

View File

@@ -19,14 +19,14 @@
"bin/baikalstorage" "bin/baikalstorage"
], ],
"require": { "require": {
"php": ">=5.5", "php" : "^7.2 || ^8.0",
"sabre/dav" : "~4.1.0", "sabre/dav" : "~4.3.0",
"sabre/vobject": "^4.0", "sabre/vobject": "^4.2.1",
"nesbot/carbon": "^2.0.0", "nesbot/carbon": "^2.0.0",
"laminas/laminas-validator": "^2.13", "laminas/laminas-validator": "^2.13",
"laminas/laminas-stdlib": "^3.2", "laminas/laminas-stdlib": "^3.2",
"psr/container": "^1.0", "psr/container": "^1.0",
"symfony/config": "3.4", "symfony/config": "3.4|^4.0|^5.0",
"symfony/process": "^3.4|^4.0|^5.0", "symfony/process": "^3.4|^4.0|^5.0",
"monolog/monolog": "^2.0", "monolog/monolog": "^2.0",
"symfony/yaml": "~3.0|~4.0", "symfony/yaml": "~3.0|~4.0",

View File

@@ -22,7 +22,12 @@ class CreateConfigFileCommand extends Command {
public function addtaskwarriorConfig() { public function addtaskwarriorConfig() {
$configs = []; $configs = [];
$filePath = $this->io->askQuestion(new Question('Where is the location for the taskrc file?')); $taskrcQuestion = new Question('Where is the location for the taskrc file?');
$self = $this;
$taskrcQuestion->setAutocompleterCallback(function(string $input) use ($self) {
return $self->autocompleteFilePathCallback($input);
});
$filePath = $this->io->askQuestion($taskrcQuestion);
$taskrcFilePath = $filePath . '/.taskrc'; $taskrcFilePath = $filePath . '/.taskrc';
if (!file_exists($taskrcFilePath)) { if (!file_exists($taskrcFilePath)) {
throw new \RuntimeException("The taskrc file at $taskrcFilePath does not exist"); throw new \RuntimeException("The taskrc file at $taskrcFilePath does not exist");
@@ -70,7 +75,10 @@ class CreateConfigFileCommand extends Command {
// TODO: move create config file code block to function // TODO: move create config file code block to function
$question = new Question('Where to create `config.yaml` configuration file?'); $question = new Question('Where to create `config.yaml` configuration file?');
$question->setAutocompleterCallback($this->autocompleteFilePathCallback); $self = $this;
$question->setAutocompleterCallback(function(string $input) use ($self) {
return $self->autocompleteFilePathCallback($input);
});
$filePath = $this->io->askQuestion($question); $filePath = $this->io->askQuestion($question);
try { try {
@@ -125,7 +133,14 @@ class CreateConfigFileCommand extends Command {
$this->configs['general'] = []; $this->configs['general'] = [];
if ($this->io->confirm('Enable logging?')) { if ($this->io->confirm('Enable logging?')) {
$this->configs['general']['logger'] = []; $this->configs['general']['logger'] = [];
$logFilePath = $this->io->askQuestion(new Question('Where to create log file?'));
$logFileQuestion = new Question('Where to create log file?');
$self = $this;
$logFileQuestion->setAutocompleterCallback(function(string $input) use ($self) {
return $self->autocompleteFilePathCallback($input);
});
$logFilePath = $this->io->askQuestion($logFileQuestion);
$this->configs['general']['logger']['file'] = $this->verifyAndCreateFile($logFilePath, CreateConfigFileCommand::$LOGGER_FILE_NAME); $this->configs['general']['logger']['file'] = $this->verifyAndCreateFile($logFilePath, CreateConfigFileCommand::$LOGGER_FILE_NAME);
$logLevelChoiceQuestion = new ChoiceQuestion('Log level (defaults to ERROR)', array_keys(Monolog::getLevels()), 4); $logLevelChoiceQuestion = new ChoiceQuestion('Log level (defaults to ERROR)', array_keys(Monolog::getLevels()), 4);

View File

@@ -21,9 +21,9 @@ class ConfigBuilder implements ConfigurationInterface {
} }
public function getConfigTreeBuilder() { public function getConfigTreeBuilder() {
$treeBuilder = new TreeBuilder(); $treeBuilder = new TreeBuilder('configs', 'array');
$rootNode = $treeBuilder->root('configs'); $rootNode = $treeBuilder->getRootNode();
$ref = $rootNode->children() $ref = $rootNode->children()
->arrayNode('general') ->arrayNode('general')
->children() ->children()
->arrayNode('logger') ->arrayNode('logger')

View File

@@ -26,8 +26,7 @@ class Console extends AbstractConsole {
if (isset($input)) { if (isset($input)) {
$input = $this->convertToString($input); $input = $this->convertToString($input);
} }
$process = new Process(implode(' ', $stdin), null, $envs, $input); $process = new Process($stdin, null, $envs, $input);
$process->inheritEnvironmentVariables();
try { try {
$process->mustRun(); $process->mustRun();