Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use include path when importing YAML files #3376

Closed
schmengler opened this issue Nov 7, 2022 · 2 comments
Closed

Use include path when importing YAML files #3376

schmengler opened this issue Nov 7, 2022 · 2 comments

Comments

@schmengler
Copy link
Contributor

import() with PHP files uses the include path because require is used. It would be logical to also use the include path when importing YAML files.

It can be achieved with the use_include_path argument of file_get_contents():

--- a/src/Importer/Importer.php
+++ b/src/Importer/Importer.php
@@ -71,7 +71,7 @@ class Importer
                 });
             } else if (preg_match('/\.ya?ml$/i', $path)) {
                 self::$recipeFilename = basename($path);
-                self::$recipeSource = file_get_contents($path);
+                self::$recipeSource = file_get_contents($path, true);
                 $root = array_filter(Yaml::parse(self::$recipeSource), static function (string $key) {
                     return substr($key, 0, 1) !== '.';
                 }, ARRAY_FILTER_USE_KEY);
@schmengler
Copy link
Contributor Author

PR: #3377

@antonmedv
Copy link
Member

Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants