Skip to content

Symfony yaml parser not working #7365

@AndiLeni

Description

@AndiLeni

Hello,

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

Instead a Class 'Spyc' not found error is thrown.
Any ideas what might be wrong with this approach?

Thanks and kind regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions