I have problems with spyc in my CMS which uses its own autoloader.
That’s why I wanted to switch to the Symfony Yaml Parser.
I installed device detector via composer and deleted the mustangostang/spyc folder in /vendor.
I then tried to switch to Symfony like this:
use DeviceDetector\ClientHints; use DeviceDetector\DeviceDetector; use DeviceDetector\Yaml\Symfony as DeviceDetectorSymfonyYamlParser; ... $this->DeviceDetector = new DeviceDetector($this->userAgent, $clientHints); $this->DeviceDetector->setYamlParser(new DeviceDetectorSymfonyYamlParser()); echo $this->DeviceDetector->getYamlParser()) # prints DeviceDetector\Yaml\Symfony echo 'A'; # is printed $this->DeviceDetector->parse(); echo 'B'; # is NOT printed
Class 'Spyc' not found error is thrown.
Any ideas what might be wrong with this approach?
Thanks and kind regards