/** * @param OutputInterface $output */ public function listAll(OutputInterface $output) { $settings = Setting::select()->orderAsc('key')->all(); foreach ($settings as $setting) { $output->writeln($setting->key . ' ' . $setting->value); } }
/** * Shows support info for all or specified setting(s) * * @param null|string $key Key/name of a specific setting. Leave empty for * all settings. */ public function showSupportedSettings($key = null) { $settings = array(); if ($key !== null && isset($this->supportedSettings[$key])) { $settings[$key] = $this->supportedSettings[$key]; } else { $settings = $this->supportedSettings; } $currentSettings = Setting::select()->in('key', array_keys($settings))->all(); $out = $this->client->getOutput(); $out->section('Supported settings [default]'); foreach ($settings as $key => $info) { $out->write($key); if (isset($currentSettings[$key])) { $out->write(' = ' . $currentSettings[$key]->value); } if (isset($info['default'])) { $out->write(' [' . $info['default'] . ']'); } $out->newLine(); $out->writeln($info['desc']); $out->newLine(); } }