Skip to content
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

Ensure extension is installable on detected PHP version #102

Open
asgrim opened this issue Jan 10, 2022 · 0 comments
Open

Ensure extension is installable on detected PHP version #102

asgrim opened this issue Jan 10, 2022 · 0 comments
Labels
enhancement New feature or request nice to have

Comments

@asgrim
Copy link
Collaborator

asgrim commented Jan 10, 2022

https://github.com/scoutapp/scout-apm-php/pull/235/files#r769592589 :

Noticed a bug in the CI pipeline, the shivammathur/setup-php action is installing scoutapm even though it should NOT on PHP 8.1, since we don't support it yet. Reported shivammathur/setup-php#542

I think the reasonable approach suggested in the above issue to take here is to check we are installing on a supported PHP version:

or you can add a check for PHP version in your config.m4 similar to how Xdebug does it and hard-fail to compile when not supported.

https://github.com/xdebug/xdebug/blob/e8088b2d301a825d23ad325f3a61b78db9375e25/config.m4#L16-L27

  AC_MSG_CHECKING([Check for supported PHP versions])
  PHP_XDEBUG_FOUND_VERSION=`${PHP_CONFIG} --version`
  PHP_XDEBUG_FOUND_VERNUM=`echo "${PHP_XDEBUG_FOUND_VERSION}" | $AWK 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 100 + [$]2) * 100 + [$]3;}'`
  if test "$PHP_XDEBUG_FOUND_VERNUM" -lt "70300"; then
    AC_MSG_ERROR([not supported. Need a PHP version >= 7.3.0 and < 8.3.0 (found $PHP_XDEBUG_FOUND_VERSION)])
  else
    if test "$PHP_XDEBUG_FOUND_VERNUM" -ge "80300"; then
      AC_MSG_ERROR([not supported. Need a PHP version >= 7.3.0 and < 8.3.0 (found $PHP_XDEBUG_FOUND_VERSION)])
    else
      AC_MSG_RESULT([supported ($PHP_XDEBUG_FOUND_VERSION)])
    fi
  fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request nice to have
Projects
None yet
Development

No branches or pull requests

1 participant