comparison core/lib/Drupal/Core/Serialization/Yaml.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 <?php
2
3 namespace Drupal\Core\Serialization;
4
5 use Drupal\Core\Site\Settings;
6 use Drupal\Component\Serialization\Yaml as ComponentYaml;
7
8 /**
9 * Provides a YAML serialization implementation.
10 *
11 * Allow settings to override the YAML implementation resolution.
12 */
13 class Yaml extends ComponentYaml {
14
15 /**
16 * {@inheritdoc}
17 */
18 protected static function getSerializer() {
19 // Allow settings.php to override the YAML serializer.
20 if (!isset(static::$serializer) &&
21 $class = Settings::get('yaml_parser_class')) {
22
23 static::$serializer = $class;
24 }
25 return parent::getSerializer();
26 }
27
28 }