symfony / flex

Composer plugin for Symfony
MIT License
4.17k stars 183 forks source link

Support for local stored recipe files #997

Closed mickaelblondeau closed 1 year ago

mickaelblondeau commented 1 year ago

Hello,

I noticed that it could be possible to use local files (file://) as recipe endpoint instead of remote URL but it's currently locked by Downloader.php#361

if (200 === $response->getStatusCode()) {

Do you think it could be a good idea to allow it by adding a "0" check for those files ?

if (in_array($response->getStatusCode(), [0, 200], true)) {

This way we could use stuff like that:

    "extra": {
        "symfony": {
            "endpoint": [
                "flex://defaults",
                "file:///path/to/index.json"
            ]
        }
    }

In docker environnement it's possible to guarantee the file location so it's rather easy to use, but I'm not really sure it's a good idea to use that The idea behind it is to use flex in a private environnement (private bundles) without using authentication for all developers using the project