Yourls: Install with composer & php 8.0.3

Created on 7 May 2021  路  12Comments  路  Source: YOURLS/YOURLS

Summary

I be glad if YOURLS work with php 8
Motivation

To work fine with php 8
Is your feature request related to a problem? Please describe.

When I try install it on GNU/Linux Ubuntu 20.04, Apache 2.4.41, Mariadb 10.5 and PHP 8.3 (with _composer version 2.0.12_) I get the following error:

Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - spatie/array-to-xml is locked to version 2.15.0 and an update of this package was not requested.
    - spatie/array-to-xml 2.15.0 requires php ^7.2 -> your php version (8.0.3) does not satisfy that requirement.

Describe the solution you'd like

I remove the composer.lock and after composer install works fine.
Describe alternatives you've considered

updating spatie/array-to-xml for php8
Additional context

thanks for your application :)

bug

Most helpful comment

Now that some libs have versions only available to PHP 8 I don't think we can still commit composer.lock as suggested by the official doc.

Example with spatie/array-to-xml :

  • 2.14 & 2.15 are for 7.2-7.4
  • 2.15.1 & 2.16 are for ^7.4|^8.0

    1. is for ^8.0

The correct version constraint in the composer.json should be ^2.14|^3.0.0 but then the composer.lock will lock it to a version that will run either on 7.x or 8.x.

So: I think we should remove composer.lock. I'll summon @LeoColomb 's advice because @LeoColomb is my Composer master :^P

All 12 comments

Now that some libs have versions only available to PHP 8 I don't think we can still commit composer.lock as suggested by the official doc.

Example with spatie/array-to-xml :

  • 2.14 & 2.15 are for 7.2-7.4
  • 2.15.1 & 2.16 are for ^7.4|^8.0

    1. is for ^8.0

The correct version constraint in the composer.json should be ^2.14|^3.0.0 but then the composer.lock will lock it to a version that will run either on 7.x or 8.x.

So: I think we should remove composer.lock. I'll summon @LeoColomb 's advice because @LeoColomb is my Composer master :^P

Well, is there a specific reason you run composer install @mehdiMj-ir?

I guess he tried to install YOURLS with composer create-project yourls/yourls some_dir. This generates the error mentioned

Well, is there a specific reason you run composer install @mehdiMj-ir?

I saw composer.json and composer.lock and I thought might needed something to be installed

Now that some libs have versions only available to PHP 8 I don't think we can still commit composer.lock as suggested by the official doc.

Example with spatie/array-to-xml :

  • 2.14 & 2.15 are for 7.2-7.4
  • 2.15.1 & 2.16 are for ^7.4|^8.0

    1. is for ^8.0

The correct version constraint in the composer.json should be ^2.14|^3.0.0 but then the composer.lock will lock it to a version that will run either on 7.x or 8.x.

So: I think we should remove composer.lock. I'll summon @LeoColomb 's advice because @LeoColomb is my Composer master :^P

Thanks for your respond. I think removing composer.lock will be ok, but PHP programs should always test with different versions of PHP. for example polr have same problem with PHP 8, but yours was fine.
Thank you for your time and your great app :1st_place_medal:

@mehdiMj-ir this is another kind of issues. YOURLS runs fine with PHP 7.2 to 8.0, we have unit tests to make sure of this, see latest commit for instance

Let keep it focused on new installation composer usage.

  1. composer create-project yourls/yourls . is not something I would recommend for YOURLS, at least as it current state.
    I see this is on the README, but not sure worth it. create-project is used to boilerplate a new project from a template, YOURLS is not a template but a project already.
  2. I saw composer.json and composer.lock

    This is not the case for all projects (always a good idea to see if it's mentioned in Usage part of their README) 馃槈
    For instance on YOURLS, dependencies are already shipped with it and you don't need to run any install command with composer.

My guess is YOURLS is working perfectly on PHP8, and you don't need to worry about dependencies. 馃殌


X-Refs for myself

So - removing composer.lock from tracked files, final word :)

@ozh No, why so? 馃槺

Well, for my comment above that you 馃憤'd ? :)

Oh no, 馃憤 is more an acknowledge for the ping 馃槈
@mehdiMj-ir Do you confirm no issue out the box if you don't run composer install?

Oh no, is more an acknowledge for the ping
@mehdiMj-ir Do you confirm no issue out the bow if you don't run composer install?

yah man, works just fine :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sshcli picture sshcli  路  3Comments

LeoColomb picture LeoColomb  路  3Comments

LaughterOnWater picture LaughterOnWater  路  5Comments

Alan-Liang picture Alan-Liang  路  6Comments

ozh picture ozh  路  3Comments