mezzio / mezzio-skeleton

Laminas mezzio skeleton. Begin developing PSR-15 middleware applications in seconds!
https://docs.mezzio.dev/mezzio/
BSD 3-Clause "New" or "Revised" License
120 stars 31 forks source link

Error on clean skeleton installation with PHP 8.1 and elie29/zend-phpdi-config #71

Closed kirkmadera closed 1 year ago

kirkmadera commented 2 years ago

Bug Report

I encountered an error on a clean skeleton installation. I am testing with PHP 8.1 and Composer 2.3.7

image

Q A
Version(s) x.y.z
PHP 8.1
Composer 2.3.7

Summary

I installed Mezzio Skeleton from composer create-project and encountered an error that elie29/zend-phpdi-config was locked at 6.0 and, thus locked into PHP ^7.1. This is not even a module I requested. I requested to use the laminas-servicemanager strategy.

Current behavior

Skeleton not installed. Composer shows an error with an unrequested package. I was able to push through this by manually editing composer.lock and removing the elie29/zend-phpdi-config package entirely.

How to reproduce

  1. Run composer create-project mezzio/mezzio-skeleton mezzio
  2. Select the following: 3 (Modular), 2 (laminas-servicemanager), 1 (FastRoute), n (None of the above), 1 (Whoops)

This is also reproduced with the Minimal installation.

Expected behavior

Skeleton installed.

samsonasik commented 2 years ago

Yes, I think PHPDI support should be dropped. Could you create PR to remove it? Thank you.

Ocramius commented 2 years ago

@samsonasik it's a quite stable DIC - do we really want to kill it? :thinking:

samsonasik commented 2 years ago

Not the PHPDI package itself, but the bridge, as far as I remember, elie29/zend-phpdi-config have different signature configuring service since 5.0, I removed its support from my module as well: ErrorHeroModule since 2021 https://github.com/samsonasik/ErrorHeroModule/releases/tag/4.0.0

Ocramius commented 2 years ago

Ah, totally agree on the bridge.

Yes, we cannot keep it in there, if it's not maintained.

elie29 commented 2 years ago

@Ocramius the bridge is maintained, I need more info about the error. For PHP 8+, we need the v8 for the bridge

Ocramius commented 2 years ago

Hey @elie29, thanks for the feedback: I think you are already discussing this with @samsonasik in #72, sorry for the duplicate noise.

someson commented 2 years ago

The issue is still open, does anyone work on it?

froschdesign commented 2 years ago

@someson It would be nice if the support for PHP-DI would remain. So it would be great if you can help here. Thanks in advance! 👍🏻

elie29 commented 2 years ago

@froschdesign the bridge needs an update to be compatible with php8.1. I am working on it

elie29 commented 2 years ago

I created the issue : https://github.com/elie29/zend-di-config/issues/55

elie29 commented 2 years ago

@froschdesign @Ocramius elie29/zend-di-config is compatible with PHP 8.1. All tests passed. you can checkout version 9.0.0

Ocramius commented 2 years ago

See #82

marian-lippold-C commented 1 year ago

Is this issue resolved? Fresh installed php 8.1.12 and Composer 2.4.4 still produce error about the elie29/zend-phpdi-config being locked to 6.0.0. I do not know enough about this technology to fix it myself, so i kindly ask for support.

froschdesign commented 1 year ago

Looks like the configuration for the installer is wrong:

https://github.com/mezzio/mezzio-skeleton/blob/3b02a412cc904908fea44fd410996322d7be2c7f/src/MezzioInstaller/config.php#L11-L13

It must be the same as in the Composer configuration:

https://github.com/mezzio/mezzio-skeleton/blob/3b02a412cc904908fea44fd410996322d7be2c7f/composer.json#L56

froschdesign commented 1 year ago

@marian-lippold-C

I do not know enough about this technology to fix it myself, so i kindly ask for support.

Edit the composer.json of your new project and change the version constraint for elie29/zend-phpdi-config and then run the update or install command of Composer.

elie29 commented 1 year ago

@froschdesign should I create a PR to correct the config of the installer?

froschdesign commented 1 year ago

@elie29 Go for it. Thanks in advance! 👍🏻

elie29 commented 1 year ago

@froschdesign you can find here #99

Ocramius commented 1 year ago

Handled in #99