wardenenv / warden

Warden is a CLI utility for orchestrating Docker based developer environments
https://warden.dev
MIT License
411 stars 169 forks source link

n98mage-run deprecated error on PHP 8.1 #519

Closed hanhpv closed 2 years ago

hanhpv commented 2 years ago

I'm installing Magento 2.4.4, using image wardenenv/php-fpm:8.1-magento2. When running n98mage-run command, I got this error message:

www-data@magento244-php-fpm:/var/www/html$ n98-magerun admin:user:list

In ErrorHandler.php line 61:

  Deprecated Functionality: Method ReflectionParameter::getClass() is deprecated in phar:///usr/local/bin/n98-magerun/src/N98/Util/Console/Helper/InjectionHelper.php on line 91

admin:user:list [--format [FORMAT]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [--root-dir [ROOT-DIR]] [--skip-config] [--skip-root-check] [--skip-core-commands [SKIP-CORE-COMMANDS]] [--skip-magento-compatibility-check] [--] <command>

Not every command failed, but most of them.

hanhpv commented 2 years ago

I temporarily download the latest version to root directory:

wget https://files.magerun.net/n98-magerun2.phar
chmod +x n98-magerun2.phar

and it works well.

www-data@magento244-php-fpm:/var/www/html$ ./n98-magerun2.phar admin:user:list
+----+----------+-------+--------+
| id | username | email | status |
+----+----------+-------+--------+
MagePsycho commented 2 years ago

@hanhpv Warden comes with the shorthand for MageRun as mr What if you run as mr admin:user:list?

hanhpv commented 2 years ago

Hi @MagePsycho same error

www-data@magento244-php-fpm:/var/www/html$ mr admin:user:list

In ErrorHandler.php line 61:

  Deprecated Functionality: Method ReflectionParameter::getClass() is deprecated in phar:///usr/local/bin/n98-magerun
  /src/N98/Util/Console/Helper/InjectionHelper.php on line 91

admin:user:list [--format [FORMAT]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [--root-dir [ROOT-DIR]] [--skip-config] [--skip-root-check] [--skip-core-commands [SKIP-CORE-COMMANDS]] [--skip-magento-compatibility-check] [--] <command>
sprankhub commented 2 years ago

What does n98-magerun --version give you? Anything lower than 5.0.0 is not compatible with PHP 8.1.

The version of n98-magerun is tied to the respective Docker image. To update all your env images, run warden env pull && warden env up --force-recreate. If this does not update n98-magerun to the latest version yet, you probably have to wait a bit more (I think the Docker images are built only monthly if no changes are made).

hanhpv commented 2 years ago

Hi @sprankhub thanks for the input. n98-magerun is 4.9.1, seems to be the case.

I just pulled the 8.1 image first time yesterday, means n98-magerun is not upgraded to the latest version yet. It seems I have to stay with the manual downloaded tool until the image is upgraded.

hanhpv commented 2 years ago

Just realized that n98-magerun has been upgraded in latest 8.1 image and working well now. Thank for looking into this!