$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->separator = ";";
rewind($handle);
$header = fgetcsv($handle, 0, $this->separator);
- if (count($header) == 1) {
- die("Invalid file format for " . $this->_file . ". It must be a valid csv with separator ',' or ';'\n");
- }
}
$this->header = $header;
continue;
}
$this->row++;
+ if ($this->row % 1000 == 0) {
+ // Reset PEAR_DB_DATAOBJECT cache to prevent memory leak
+ CRM_Core_DAO::freeResult();
+ }
$params = $this->convertLine($data);
$this->processLine($params);
}