feat: integrate with flysystem for xml data

This commit is contained in:
Björn Fromme committed 2025-03-26 16:07:37 +01:00
1 parent 036734eadf
commit e4e03a848b
12 files changed
+617 -24

No files matched your search

+8 -1
View File
@@ -16,7 +16,7 @@ class PickupLoader extends AbstractLoader
return $this->cache->get('bpn_pickups', function (ItemInterface $item) use ($filename) {
$item->expiresAfter(3 * 60 * 60);
$crawler = new Crawler(file_get_contents($this->xmlPath . '/' . $filename));
$crawler = $this->loadXml($filename);
$pickupNodes = $crawler->filterXPath('//zustiege/zustieg');
$pickups = [];
@@ -40,6 +40,13 @@ class PickupLoader extends AbstractLoader
return $pickups[$id] ?? null;
}
private function loadXml(?string $filename = 'zustiege.xml'): Crawler
{
$xml = $this->xmlExport->read($filename);
return new Crawler($xml);
}
public function parseXml(Crawler $node): Pickup
{
$pickup = new Pickup();