Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / drush / drush / src / Config / Loader / YamlConfigLoader.php
diff --git a/vendor/drush/drush/src/Config/Loader/YamlConfigLoader.php b/vendor/drush/drush/src/Config/Loader/YamlConfigLoader.php
new file mode 100644 (file)
index 0000000..4a5d7bb
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+
+namespace Drush\Config\Loader;
+
+use Drush\Internal\Config\Yaml\Yaml;
+use Consolidation\Config\Loader\ConfigLoader;
+
+/**
+ * Load configuration files, and fill in any property values that
+ * need to be expanded.
+ */
+class YamlConfigLoader extends ConfigLoader
+{
+    public function load($path)
+    {
+        $this->setSourceName($path);
+
+        // We silently skip any nonexistent config files, so that
+        // clients may simply `load` all of their candidates.
+        if (!file_exists($path)) {
+            $this->config = [];
+            return $this;
+        }
+        $this->config = (array) Yaml::parse(file_get_contents($path));
+        return $this;
+    }
+}