Bump imapengine from 1.25.4 to 1.25.6 and dependencies

This commit is contained in:
johnnyq
2026-08-26 13:02:29 -04:00
parent 71cfdf5e39
commit 3d9a41bec4
54 changed files with 978 additions and 543 deletions

View File

@@ -31,23 +31,19 @@ class CsvFileLoader extends FileLoader
{
$messages = [];
try {
$file = new \SplFileObject($resource, 'rb');
} catch (\RuntimeException $e) {
throw new NotFoundResourceException(\sprintf('Error opening file "%s".', $resource), 0, $e);
if (!$file = @fopen($resource, 'r')) {
throw new NotFoundResourceException(\sprintf('Error opening file "%s".', $resource));
}
$file->setFlags(\SplFileObject::READ_CSV | \SplFileObject::SKIP_EMPTY | \SplFileObject::DROP_NEW_LINE);
$file->setCsvControl($this->delimiter, $this->enclosure, $this->escape);
foreach ($file as $data) {
if (false === $data) {
continue;
}
if (!str_starts_with($data[0], '#') && isset($data[1]) && 2 === \count($data)) {
$messages[$data[0]] = $data[1];
try {
while (false !== $data = fgetcsv($file, null, $this->delimiter, $this->enclosure, $this->escape)) {
// empty lines are read as [null]
if (isset($data[1]) && 2 === \count($data) && !str_starts_with($data[0], '#')) {
$messages[$data[0]] = $data[1];
}
}
} finally {
fclose($file);
}
return $messages;