3 namespace Drupal\Core\Extension;
6 * Interface for classes that parses Drupal's info.yml files.
8 interface InfoParserInterface {
11 * Parses Drupal module, theme and profile .info.yml files.
13 * Info files are NOT for placing arbitrary theme and module-specific
14 * settings. Use Config::get() and Config::set()->save() for that. Info files
15 * are formatted as YAML. If the 'version' key is set to 'VERSION' in any info
16 * file, then the value will be substituted with the current version of Drupal
19 * Information stored in all .info.yml files:
20 * - name: The real name of the module for display purposes. (Required)
21 * - description: A brief description of the module.
22 * - type: whether it is for a module or theme. (Required)
24 * Information stored in a module .info.yml file:
25 * - dependencies: An array of dependency strings. Each is in the form
26 * 'project:module (versions)'; with the following meanings:
27 * - project: (optional) Project shortname, recommended to ensure
28 * uniqueness, if the module is part of a project hosted on drupal.org.
29 * If omitted, also omit the : that follows. The project name is currently
30 * ignored by Drupal core but is used for automated testing.
31 * - module: (required) Module shortname within the project.
32 * - (versions): Version information, consisting of one or more
33 * comma-separated operator/value pairs or simply version numbers, which
34 * can contain "x" as a wildcard. Examples: (>=8.22, <8.28), (8.x-3.x).
35 * - package: The name of the package of modules this module belongs to.
37 * See forum.info.yml for an example of a module .info.yml file.
39 * Information stored in a theme .info.yml file:
40 * - screenshot: Path to screenshot relative to the theme's .info.yml file.
41 * - engine: Theme engine; typically twig.
42 * - base theme: Name of a base theme, if applicable.
43 * - regions: Listed regions.
44 * - features: Features available.
45 * - stylesheets: Theme stylesheets.
46 * - scripts: Theme scripts.
48 * See bartik.info.yml for an example of a theme .info.yml file.
50 * For information stored in a profile .info.yml file see
51 * install_profile_info().
53 * @param string $filename
54 * The file we are parsing. Accepts file with relative or absolute path.
59 * @throws \Drupal\Core\Extension\InfoParserException
60 * Exception thrown if there is a parsing error or the .info.yml file does
61 * not contain a required key.
63 * @see install_profile_info()
65 public function parse($filename);