Skip to content

Possibility to autoinstall pie extensions (extend composer.json with pie extensions meta) #506

Description

@Ninos

Currently it's not possible to autoinstall pie just using composer.json/composer.lock file.

Current behavior

Create a composer.json file, e.g. with following content:

{
    "name": "1m9/php-build",
    "type": "example",
    "require": {
        "php": ">=8.0",
        "ext-apcu": "*",
        "ext-redis": "*"
    }
}

After that run composer install --ignore-platform-reqs to generate composer.lock file.

To install pie extensions, you need to run pie install in same folder. Pie is now (happily for security reasons) asking, which extension we want to install, e.g. apcu/apcu for ext-apcu.

Because of those user input requirements it's not possible to autoinstall pie extensions, e.g. in container environment.

Solution

Add an additional section, e.g. extensions, which is loading all relevant meta data for required extensions (not just the package & version, but also the additional pie flags (--with-xyz, ...).

Example

{
    "name": "1m9/php-build",
    "type": "example",
    "extensions": {
        "apcu/apcu": "*",
        "phpredis/phpredis": {
            "version": "*",
            "flags": ["--with-xyz", "--without-xyz", "--enable-xyz", "--whatever..."]
        }
    },
    "require": {
        "php": ">=8.0",
        "ext-apcu": "*",
        "ext-redis": "*"
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions