From: TeNNoX Date: Thu, 4 Sep 2014 09:25:00 +0000 (+0100) Subject: CRM-15238 Add option to use semicolon as separator for the X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=4dbe068410e69045369c13094beacf66aee2cb35;p=civicrm-core.git CRM-15238 Add option to use semicolon as separator for the bin/csv/export.php Conflicts: bin/cli.class.php --- diff --git a/bin/cli.class.php b/bin/cli.class.php index 1a2b8cab6c..a051135620 100644 --- a/bin/cli.class.php +++ b/bin/cli.class.php @@ -46,6 +46,7 @@ class civicrm_cli { var $_action = NULL; var $_output = FALSE; var $_joblog = FALSE; + var $_semicolon = FALSE; var $_config; // optional arguments @@ -185,6 +186,9 @@ class civicrm_cli { elseif ($arg == '-j' || $arg == '--joblog') { $this->_joblog = TRUE; } + elseif ($arg == '-sem' || $arg == '--semicolon') { + $this->_semicolon = TRUE; + } else { foreach ($this->_additional_arguments as $short => $long) { if ($arg == '-' . $short || $arg == '--' . $long) { @@ -342,7 +346,14 @@ class civicrm_cli_csv_exporter extends civicrm_cli { parent::initialize(); } + /** + * Run the script. + */ public function run() { + if ($this->_semicolon) { + $this->separator = ';'; + } + $out = fopen("php://output", 'w'); fputcsv($out, $this->columns, $this->separator, '"');