Skip to content

Commit e4c2bf1

Browse files
committed
Fix process commands to encode files
1 parent 611b7d5 commit e4c2bf1

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎Helper/ExportHelper.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function getValueFromCode($attributeKey, $attributeValue, $locale)
6969
$option[0]->setLocale($locale)->getTranslation();
7070
$labelAsArray[] = $option[0]->getOptionValue()->getLabel();
7171
}
72-
72+
7373
return implode(self::MULTI_SELECT_SEPARATOR, $labelAsArray);
7474
}
7575

@@ -90,7 +90,7 @@ public function encodeFile($filePath, $encoding)
9090
$filePath,
9191
$tempFilePath
9292
);
93-
$encodeFileProcess = new Process([$encodeFileCommand]);
93+
$encodeFileProcess = Process::fromShellCommandline($encodeFileCommand);
9494
$encodeFileProcess->mustRun();
9595

9696
if (file_exists($tempFilePath)) {

‎Helper/ImportHelper.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ protected function encodeToUtf8($filePath, $fromEncoding)
313313
try {
314314
if (empty($fromEncoding)) {
315315
$checkEncodingCommand = sprintf('file -i %s | cut -f 2 -d";" | cut -f 2 -d=', $filePath);
316-
$checkEncodingProcess = new Process([$checkEncodingCommand]);
316+
$checkEncodingProcess = Process::fromShellCommandline($checkEncodingCommand);
317317
$checkEncodingProcess->mustRun();
318318
$currentEncoding = $checkEncodingProcess->getOutput();
319319
$currentEncoding = str_replace("\n", "", $currentEncoding);
@@ -330,7 +330,7 @@ protected function encodeToUtf8($filePath, $fromEncoding)
330330
$filePath,
331331
$newFilePath
332332
);
333-
$encodeFileProcess = new Process([$encodeFileCommand]);
333+
$encodeFileProcess = Process::fromShellCommandline($encodeFileCommand);
334334
$encodeFileProcess->mustRun();
335335

336336
// Replace bad encoding file with correct one

0 commit comments

Comments
 (0)