After trying to update to the most stable dev, I am getting the following error with composer:

chillerlan/php-qrcode dev-master requires php >=7.0.3 -> your PHP version (7.1.11) overridden by "config.platform.php" version (5.6) does not satisfy that requirement.

It sounds like the most current version of GA Login requires PHP 7.0.3 because of the QRCod library. See: https://github.com/codemasher/php-qrcode/blob/master/composer.json#L21

This should be addressed and corrected so that systems running PHP 5.6.x can still use TFA / GA Login.

PHP 5.6 was dropped in Feb 2017 -- https://github.com/codemasher/php-qrcode/commit/16e889d0ca28748c87eabccf...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikemadison created an issue. See original summary.

mikemadison’s picture

Issue summary: View changes
mikemadison’s picture

Issue summary: View changes
daggerhart’s picture

Thanks for the report, I agree we should support 5.6 since core does.

We could move to the php5 branch of the qr code library. It was updated 2 months ago and supports PHP 5.6+.

daggerhart’s picture

Title: QRcode PHP 7 Errors with Composer » QRcode library should support PHP 5.6 since Drupal core does

I've reached out to the library maintainer and they appear to be very helpful in supporting php 5.6. I'll have more details as the next steps become more clear.

In the meantime I'm changing the title of this issue to reflect the request of supporting 5.6, and relating it to some other issues.

mikemadison’s picture

In the meantime, I am using the following work around with composer. This allows for a version of GA Login that allows for PHP 5.6 and it gets the validator plugins working with the most recent version of TFA.

"require": {
  "drupal/tfa": "1.0-alpha3",
  "drupal/ga_login": "1.0-alpha2",
},
"patches": {
  drupal/ga_login": {
    "validation": "https://www.drupal.org/files/issues/2928722-19.patch"
  }
}
codemasher’s picture

hello hi, i couldn't sleep last night so i did this https://github.com/codemasher/php-qrcode/tree/v2.0.x-php5 - please note that this php5 branch will be unsupported by me (i will gladly accept pull requests however). Also, i don't plan any further changes on the API of the main branch, so that you can use the php5 branch as polyfill until drupal supports php7+ and then just switch back to release.

daggerhart’s picture

@codemasher, thanks! This is great and much appreciated!

I'm attempting to add this branch as the required version in composer.json file using this format I found on a blog post:

{
  "name": "drupal/ga_login",
  "type": "drupal-module",
  "description": "TFA plugins for Hmac-Based One Time Passwords & Time Based One Time Password with recovery codes as fallback.",
  "license": "GPL-2.0+",
  "minimum-stability": "dev",
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/codemasher/php-qrcode"
    }
  ],
  "require": {
    "chillerlan/php-qrcode": "v2.0.x-php5"
  }
}

It's failing with the error:

UnexpectedValueException]
Could not parse version constraint v2.0.x-php5: Invalid version string "v2.0.x-php5"

Is this something I can fix within the composer file, or is the branch name actually the problem? I'm no composer expert, so any help would be excellent.

Thanks again

Edit: I may have resolved the issue by prefixing the branch name with "dev-". Testing now and will submit a patch if it all works out. Sorry for the quick question before I experimented more. Still welcoming feedback if either of you have it. :D

codemasher’s picture

You're welcome! As for the installation, try "chillerlan/php-qrcode": "dev-v2.0.x-php5" - i'm currently trying to find out how i can get this into a stable release tag that does not interfere with master - any help is appreciated!

daggerhart’s picture

Attached is a patch that puts us on the new branch that supports php5

daggerhart’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 10: 2937404-10-qrcode-php5.patch, failed testing. View results

daggerhart’s picture

Status: Needs work » Postponed
FileSize
291 bytes

@codemasher was able to get the PHP 5.6+ version on the stable tag 1.0.8.

This patch uses the 1.0.8 version, but I'm postponing the issue until we resolve #2937043: Add test_dependencies: to ga_login.info.yml because we can't get any of the tests that involve composer changes to pass atm.

daggerhart’s picture

Status: Postponed » Needs review

Changing back to needs review to get this series of issues going again.

Status: Needs review » Needs work

The last submitted patch, 13: 2937404-13-qrcode-php5.patch, failed testing. View results

nerdstein’s picture

Re-queued the tests

daggerhart’s picture

Status: Needs work » Needs review

Re-queueing test.

nerdstein’s picture

I reviewed the patch in #13 and I support the approach of pinning the version of the dependent library. This will help reduce surprises across releases. Tests are now passing as well.

Awaiting a formal test to confirm.

  • nerdstein committed ef962ab on 8.x-1.x authored by daggerhart
    Issue #2937404 by daggerhart, codemasher, nerdstein: QRcode library...
nerdstein’s picture

Status: Needs review » Fixed

13 passed, merging. Thanks to all who helped and contributed!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.