Skip to content

Switch to Symfony PHAR Runtime #892

@dkarlovi

Description

@dkarlovi

Feature Request

needs #890, #891, php-runtime/runtime#135

Assuming we can now pass env vars in box.json (#890), can find the project root in the PHAR at compile time (#891) and there exists the PHAR runtime for Symfony Runtime (#135), the workflow is like this:

  1. user defines the desired runtime in box.json:
{
    "env": {
        "APP_RUNTIME": "Runtime\\PHAR\\Runtime"
    }
}
  1. Box copies the runtime and kernel classes and the runtime template from the runtime into the PHAR
  2. Box updates composer.json to use the runtime template as so: composer validate (check current lock file is correct), set extra.runtime.autoload_template, composer update --lock (to update the lock file hash) - the template will now be used
  3. Box figures out the project root and passes it to the runtime
  4. The runtime decorates the kernel with the runtime one, passing it the project root

This should allow the Symfony app to work within the PHAR without any changes required by the user. In the future even setting the runtime could be made not required.

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