diff --git a/core/lib/Drupal/Component/Yaml/Yaml.php b/core/lib/Drupal/Component/Yaml/Yaml.php index c016f69..ee759b2 100644 --- a/core/lib/Drupal/Component/Yaml/Yaml.php +++ b/core/lib/Drupal/Component/Yaml/Yaml.php @@ -6,6 +6,7 @@ */ namespace Drupal\Component\Yaml; +use Drupal\Component\Utility\Settings; /** * Factory class for YAML parsing. @@ -65,8 +66,12 @@ protected function determineImplementation() { return static::$implementationClass; } + // If there's a settings.php override, use that. + if ($class = Settings::getSingleton()->get('yaml_parser_class')) { + static::$implementationClass = $class; + } // If the PECL YAML extension installed, use that. - if (function_exists('yaml_emit')) { + elseif (function_exists('yaml_emit')) { static::$implementationClass = 'Drupal\Component\Yaml\Pecl'; } else {