Conversation
|
@ernilambar FWIW the issue is that the latest PHP-Scoper requires PHP 8.2. This could be mitigated by installing that dependency with PHP 8.2 separate from the others, run the prefixing, then downgrade again. |
|
@ernilambar I think it's very close now, after having fixed most of the namespace/autoloader issues. The last one seems to be specifically Don't yet know why because it doesn't really happen to me locally. |
All the production dependencies required by Plugin Check are prefixed and stored in
vendor-prefixed. This includes:afragen/wordpress-plugin-readme-parserplugin-check/phpcs-sniffssquizlabs/php_codesnifferThis avoids any autoloading conflicts in case another plugin uses the same dependencies.
The plugin's own classes are autoloaded with a new slim autoloader in
includes/vendor. No actual dependencies are in there, it's just a classmap.For
afragen/wordpress-plugin-readme-parserthere is a special case: if the plugin is running on WordPress.org, the original and unprefixedWordPressdotorg\Plugin_Directory\Readme\Parseris available, so there is aclass_existscheck to use that one if available.Unfortunately right now requires dependencies to be prefixed manually by installing PHP-Scoper in that other directory & running
composer prefix-dependenciesFixes #328