protected static Yaml::getSerializer()
Determines which implementation to use for parsing YAML.
File
- core/lib/Drupal/Component/Serialization/Yaml.php, line 48
Class
- Yaml
- Provides a YAML serialization implementation.
Namespace
Drupal\Component\Serialization
Code
protected static function getSerializer() { if (!isset(static::$serializer)) { // Use the PECL YAML extension if it is available. It has better // performance for file reads and is YAML compliant. if (extension_loaded('yaml')) { static::$serializer = YamlPecl::class; } else { // Otherwise, fallback to the Symfony implementation. static::$serializer = YamlSymfony::class; } } return static::$serializer; }
Please login to continue.