Version 1
[yaffs-website] / web / core / lib / Drupal / Core / Extension / InfoParser.php
diff --git a/web/core/lib/Drupal/Core/Extension/InfoParser.php b/web/core/lib/Drupal/Core/Extension/InfoParser.php
new file mode 100644 (file)
index 0000000..594a83e
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+
+namespace Drupal\Core\Extension;
+
+/**
+ * Parses extension .info.yml files.
+ */
+class InfoParser extends InfoParserDynamic {
+
+  /**
+   * Array of all info keyed by filename.
+   *
+   * @var array
+   */
+  protected static $parsedInfos = [];
+
+  /**
+   * {@inheritdoc}
+   */
+  public function parse($filename) {
+    if (!isset(static::$parsedInfos[$filename])) {
+      static::$parsedInfos[$filename] = parent::parse($filename);
+    }
+    return static::$parsedInfos[$filename];
+  }
+
+}