From 4dbe068410e69045369c13094beacf66aee2cb35 Mon Sep 17 00:00:00 2001 From: TeNNoX Date: Thu, 4 Sep 2014 10:25:00 +0100 Subject: [PATCH] CRM-15238 Add option to use semicolon as separator for the bin/csv/export.php Conflicts: bin/cli.class.php --- bin/cli.class.php | 11 +++++++++++ 1 file changed, 11 insertions(+) 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, '"'); -- 2.25.1