Skip to content

Allow defining the env-like vars for inside the PHAR #890

@dkarlovi

Description

@dkarlovi

Feature Request

(we wrote about this in detail on Symfony Slack yesterday)

The idea is to provide a way for the user to define some vars in box.json which would then be available in the env for the PHAR when running it.

One example is needing to define APP_ENV to the read-only Symfony environment, which I solved in the autoload template which is currently required (I don't use DotEnv).

Another example would be APP_RUNTIME, enabling the PHAR runtime.

Dockerfile has a similar idea with the ENV instruction.

Example usage

{
    "env": {
        "APP_ENV": "my-custom-prod-env",
        "APP_RUNTIME": "Runtime\\PHAR\\Runtime"
    }
}

When the PHAR runs, it should see these values defined in the env as if they're real env vars.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions