protected function execute(InputInterface $input, OutputInterface $output) { $name = $input->getArgument('name'); $extensions = $this->app['extensions']->getInfo(); $enabled = array(); $lines = array(); $update = false; foreach ($extensions as $key => $extension) { if ($extension['enabled']) { if (strtolower($key) == strtolower($name)) { $lines[] = "<info>Disabling <options=bold>{$key}</options=bold>.</info>"; $update = true; } else { $enabled[] = $key; } } } if ($update) { $key = "enabled_extensions"; $file = BOLT_CONFIG_DIR . "/config.yml"; $yaml = new \Bolt\YamlUpdater($file); $result = $yaml->change($key, $enabled); if ($result) { $lines[] = sprintf("New value for <info>%s</info> was succesful. File updated.", $key); } else { $lines[] = sprintf("<error>%s not found, or file not writable.</error>", $key); } } else { $lines[] = "<info><options=bold>{$name}</options=bold> is already disabled.</info>"; } $output->writeln(implode("\n", $lines)); }
protected function execute(InputInterface $input, OutputInterface $output) { $key = $input->getArgument('key'); $value = $input->getArgument('value'); $file = BOLT_CONFIG_DIR . "/config.yml"; $yaml = new \Bolt\YamlUpdater($file); $result = $yaml->change($key, $value); if ($result) { $result = sprintf("New value for <info>%s: %s</info> was succesful. File updated.", $key, $value); } else { $result = sprintf("<error>%s not found, or file not writable.</error>", $key); } $output->writeln($result); }