var $_action = NULL;
var $_output = FALSE;
var $_joblog = FALSE;
+ var $_semicolon = FALSE;
var $_config;
// optional arguments
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.");
}
}
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) {
$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;
}
parent::initialize();
}
+ /**
+ * Run the script.
+ */
public function run() {
+ if ($this->_semicolon) {
+ $this->separator = ';';
+ }
+
$out = fopen("php://output", 'w');
fputcsv($out, $this->columns, $this->separator, '"');