guzzle / psr7

PSR-7 HTTP message library
MIT License
7.88k stars 3 forks source link

Remove ralouphie/getallheaders dependency ? #572

Closed alamirault closed 1 year ago

alamirault commented 1 year ago

Hello,

On https://github.com/ralouphie/getallheaders description it's wrote

PHP getallheaders() polyfill. Compatible with PHP >= 5.3.

As this package require 7.2.5 || ^8.0, this package shouldn't be removed in require section ?

I'm not 100% due to this comment on original PR

It does a few extra things like Authorization headers. https://github.com/guzzle/psr7/pull/162#issuecomment-349832006

Can you clarify this part ?

GrahamCampbell commented 1 year ago

I don't understand what you are objecting to? That package works fine with all PHP versions we support.

alamirault commented 1 year ago

My objective ? Minimize my vendor size if some package are not really needed

GrahamCampbell commented 1 year ago

If you want to force it not to be included in your app vendor, you can mark your app as "replacing" the package. I do this all the time with the symfony pollyfills.

    "replace": {
        "paragonie/random_compat": "*",
        "paragonie/sodium_compat": "*",
        "symfony/polyfill-ctype": "*",
        "symfony/polyfill-iconv": "*",
        "symfony/polyfill-intl-grapheme": "*",
        "symfony/polyfill-intl-icu": "*",
        "symfony/polyfill-intl-idn": "*",
        "symfony/polyfill-intl-normalizer": "*",
        "symfony/polyfill-mbstring": "*",
        "symfony/polyfill-php56": "*",
        "symfony/polyfill-php70": "*",
        "symfony/polyfill-php71": "*",
        "symfony/polyfill-php72": "*",
        "symfony/polyfill-php73": "*",
        "symfony/polyfill-php74": "*",
        "symfony/polyfill-php80": "*",
        "symfony/polyfill-php81": "*",
        "symfony/polyfill-php82": "*"
    },

etc.

GrahamCampbell commented 1 year ago

Though if you do this and there is code that is used that calls it, you will run into problems.

alamirault commented 1 year ago

Thanks, not the best but it will be enough for my case