projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #8163 from jitendrapurohit/nav-menu-fix
[civicrm-core.git]
/
bin
/
cli.class.php
diff --git
a/bin/cli.class.php
b/bin/cli.class.php
index 5340869a1cae97b5884b674c25b97c59cc3648fa..dbcc5e9caf01268e28dc77b6e38b980b31863dbb 100644
(file)
--- 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 $_action = NULL;
var $_output = FALSE;
var $_joblog = FALSE;
+ var $_semicolon = FALSE;
var $_config;
// optional arguments
var $_config;
// optional arguments
@@
-88,7
+89,7
@@
class civicrm_cli {
return TRUE;
}
else {
return TRUE;
}
else {
-
trigger_error("cli.php can only be run from command line.", E_USER_ERROR
);
+
die("cli.php can only be run from command line."
);
}
}
}
}
@@
-185,6
+186,9
@@
class civicrm_cli {
elseif ($arg == '-j' || $arg == '--joblog') {
$this->_joblog = TRUE;
}
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) {
else {
foreach ($this->_additional_arguments as $short => $long) {
if ($arg == '-' . $short || $arg == '--' . $long) {
@@
-265,7
+269,7
@@
class civicrm_cli {
$this->_log(ts("Failed to login as %1. Wrong username or password.", array('1' => $this->_user)));
return FALSE;
}
$this->_log(ts("Failed to login as %1. Wrong username or password.", array('1' => $this->_user)));
return FALSE;
}
- if (!$cms->loadUser($this->_user)) {
+ if (
($this->_config->userFramework == 'Joomla' && !$cms->loadUser($this->_user, $this->_password)) ||
!$cms->loadUser($this->_user)) {
$this->_log(ts("Failed to login as %1", array('1' => $this->_user)));
return FALSE;
}
$this->_log(ts("Failed to login as %1", array('1' => $this->_user)));
return FALSE;
}
@@
-342,7
+346,14
@@
class civicrm_cli_csv_exporter extends civicrm_cli {
parent::initialize();
}
parent::initialize();
}
+ /**
+ * Run the script.
+ */
public function run() {
public function run() {
+ if ($this->_semicolon) {
+ $this->separator = ';';
+ }
+
$out = fopen("php://output", 'w');
fputcsv($out, $this->columns, $this->separator, '"');
$out = fopen("php://output", 'w');
fputcsv($out, $this->columns, $this->separator, '"');