Skip to content

Fix Composer version issues #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

philipdowner
Copy link

Fixes #15

The current version of the plugin (correctly) generates Composer version conflicts when installed in a PHP 8.x environment.

  Problem 1
    - Root composer.json requires rarst/wps * -> satisfiable by rarst/wps[dev-master, 1.0, 1.1, 1.2, 9999999-dev].
    - rarst/wps[1.0, ..., 1.1] require composer/installers ~1.0 -> found composer/installers[v1.0.0, ..., 1.x-dev] but it conflicts with your root composer.json require (^2.3).
    - rarst/wps[dev-master, 1.2] require composer/installers ~1.6 -> found composer/installers[v1.6.0, ..., 1.x-dev] but it conflicts with your root composer.json require (^2.3).

This PR updates the composer-installers package to ^2.3, which requires PHP v7.2 OR 8.0+.

I've also added a short bit of documentation to the README that may help some developers in manually triggering an error state for testing purposes.

.gitignore Outdated
vendor
/.idea
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change not relevant.

README.md Outdated
@@ -52,7 +52,28 @@ $wps['run']->silenceErrorsInPaths( '~^((?!/my-plugin/).)*$~', E_NOTICE | E_WARNI
// Silence for plugins _except_ specific plugin.
$wps['run']->silenceErrorsInPaths( '~/wp-content/plugins/(?!my-plugin)~', E_NOTICE | E_WARNING );
```
### Testing a fatal error state
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm. I don't think this warrants readme space. WordPress installs are... rarely in a state when getting an error is a problem. :)

"php" : ">=5.5.9",
"composer/installers": "~1.6",
"php": "^7.2 || ^8.0",
"composer/installers": "^v2.3.0",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been thinking about just bumping this... But also pondering is there any downside to keeping v1 installers allowed (as OR)?

I mean if I could work on it right now, I'd review a whole plugin and bring it up to date. But since I don't/can't I don't really want to raise floor on PHP version without due diligence.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think my recommendation here is that if someone needs the older version of the installers, they can easily do so by limiting the version of the package that is installed. Bump this version as a breaking change, and tag it as such?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automattic/WP.org is pushing PHP v7.4 as the minimum required version. It's certainly possible to run it in older environments... To me version bumping, tagging and releasing under 2.x would both make sense and align with WP overall. 🤷‍♂️

@philipdowner philipdowner requested a review from Rarst March 21, 2025 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can not install because of version conflict with composer/installers
2 participants