Skip to content

[Runtime] Composer node extra.runtime.options is incorrect #15319

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

Merged
merged 1 commit into from
May 8, 2021
Merged

[Runtime] Composer node extra.runtime.options is incorrect #15319

merged 1 commit into from
May 8, 2021

Conversation

kieljohn
Copy link
Contributor

@kieljohn kieljohn commented May 8, 2021

Wanted to make a change to the dotenv_path so set composer.json (as per previous docs) to:

    "runtime": {
      "options": {
        "dotenv_path": "environments/.env"
      }
    }

resulted in autoload_runtime.php of:

$runtime = new $runtime(($_SERVER['APP_RUNTIME_OPTIONS'] ?? []) + [
  'options' => 
  array (
    'dotenv_path' => 'environments/.env',
  ),
  'project_dir' => dirname(__DIR__, 1),
]);

Which obviously didn't work

so I propose the options node is removed from the docs and then composer.json:

    "runtime": {
      "dotenv_path": "environments/.env"
    }

resulted in autoload_runtime.php

$runtime = new $runtime(($_SERVER['APP_RUNTIME_OPTIONS'] ?? []) + [
  'dotenv_path' => 'environments/.env',
  'project_dir' => dirname(__DIR__, 1),
]);

Worked for me.

The array is passed directly into the Runtime $options so it's already available as $options['project_dir']
@javiereguiluz
Copy link
Member

@kieljohn thanks for fixing these docs and for the fantastic and detailed explanation! Congrats also on your first Symfony Docs contribution! 🎉

@javiereguiluz javiereguiluz merged commit b3690c8 into symfony:5.x May 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants