예제 #1
0
 public function actionExport($args)
 {
     $opt = \Gini\Util::getOpt($args, 'h', ['help', 'json', 'yaml']);
     if (isset($opt['h']) || isset($opt['help'])) {
         echo "Usage: gini config export [-h|--help] [--json|--yaml]\n";
         return;
     }
     \Gini\Config::setup();
     $items = \Gini\Config::export();
     if (isset($opt['json'])) {
         echo J($items, JSON_PRETTY_PRINT) . "\n";
     } else {
         echo yaml_emit($items, YAML_UTF8_ENCODING);
     }
 }