spatie / wordpress-ray

Debug with Ray to fix problems faster in WordPress apps
https://myray.app
MIT License
73 stars 14 forks source link

Using PHP Scoper instead of Imposter #39

Closed jeffreyvr closed 3 years ago

jeffreyvr commented 3 years ago

This PR uses PHP Scoper for dependency prefixing, instead of Imposter.

Imposter works pretty good, but has a couple of issues. It doesn't support traits. It also appears to cause conflicts with Tinkerwell, but I'm not sure if that is really caused by Imposter.

With PHP Scoper a build version of the plugin is created (in a temporary build folder). The necessary parts are extracted and minor tweaks are applied. This is done in the build.sh script.

The end result being a new vendor folder with dev dependencies only, and a slightly tweaked autoloader file.

I've tested most of Ray's functions and they all work. The issue with Tinkerwell is resolved as well.

The build script is tested on MacOS only and requires PHP and Composer to be installed.

freekmurze commented 3 years ago

Thank you, I highly appreciate this 👍

freekmurze commented 3 years ago

@jeffreyvr I've now published a first release that was built using the changes in this PR.

Can you confirm that it's all working as expected?

jeffreyvr commented 3 years ago

@freekmurze The release seems to have failed:

Parse error: syntax error, unexpected '|', expecting variable (T_VARIABLE) in Standard input code on line 12
1952
Errors parsing Standard input code

When I installed manually, I got the following error:

Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.0". You are running 7.4.13. in /Users/jeffreyvanrossum/Documents/Sites/wordpress/wp-content/plugins/wordpress-ray/vendor/composer/platform_check.php on line 24

That error is unexpected as I believe composer does not specifically require PHP 8. No issues with PHP 8.

Will look into it.

freekmurze commented 3 years ago

Thanks for looking into it! If there something on my end that I should try, let me know!