Problem/Motivation
Drupal has two Yaml serialization classes, which is confusing.
- Drupal\Component\Serialization\Yaml
- Drupal\Core\Serialization\Yaml
The difference is the latter allows overriding the serializer through Drupal's setting management.
Proposed resolution
Drupal\Component\Serialization\Yaml
should have a setSerializer
method. DrupalKernel as part of bootEnvironment
process could call the method to set the serializer.
Drupal\Component\Serialization\Yaml::setSerializer(Settings::get('yaml_parser_class'))
Remaining tasks
API changes
Adds Drupal\Component\Serialization\Yaml::setSerializer
Deprecates Drupal\Core\Serialization\Yaml