9 $usage->setDefinitionText(
"Import accounts definition");
15 if (is_file($values) && !is_readable($values)) {
16 $apiusage->
exitError(sprintf(
"Error: file output \"%s\" not readable.", $values));
20 $outfile =
$usage->addOptionalParameter(
"report-file",
"the output report file",
function ($values, $argName,
ApiUsage $apiusage)
25 if ($values !==
"-" && is_file($values) && !is_writable($values)) {
26 $apiusage->
exitError(sprintf(
"Error: file output \"%s\" not writable.", $values));
30 $dry =
$usage->addEmptyParameter(
"dry-run",
"Analyse file only - no import is proceed");
66 fputcsv($csvFile, array(
74 fputcsv($csvFile, array(
88 $format =
"| %20s | %20s | %30s | %20s |\n";
89 $out = sprintf($format,
"login",
"action",
"error",
"message");
90 $spaces = sprintf(
"%80s",
" ");
91 $out.=
"---------------------------------------------------------------------------------------------------\n";
94 $out.= chr(0x1b) .
"[1;31m";
97 $out.= sprintf($format, $row[
"login"], $row[
"action"], $row[
"error"], str_replace(
"\n",
", ", $row[
"message"]));
99 $out.= chr(0x1b) .
"[0;39m";
if($outfile) printCsv($report, $outfile)
printText($report, $outfile)
Verify arguments for wsh programs.