GoogleCloudPlatform / functions-framework-php

FaaS (Function as a service) framework for writing portable PHP functions
Apache License 2.0
212 stars 37 forks source link

fix: use full import paths from vendor for new composer #163

Closed josephlewis42 closed 1 year ago

josephlewis42 commented 1 year ago

Replace vendor/bin/router.php paths with the full router.php path in vendor/. Starting with composer 2.2, which is in package repos, composer changed the way it was handling the bin directive by creating wrapper files with shebangs in vendor/bin rather than symlinks. This caused our (incorrect) use of these bin/ files to break when they're used as a script from php because php expects the first entry in the file to be <?php when passed a script.

The composer in the FF buildpacks is old enough that it doesn't introduce the shebang which is why it still works.

I'm introducing tests to ensure we don't break that until we're safely upgraded the FF buildpack to use the correct router.

Fixes #130