wirecli / wire-cli

🌀 An extendable CLI tool for ProcessWire developers. Automate common tasks and manage your ProcessWire projects effortlessly.
MIT License
14 stars 0 forks source link

PHP 8.2 warning #8

Open eydun opened 8 months ago

eydun commented 8 months ago

For your info:

When running wirecli serve on PHP 8.2:

Starting PHP server at http://localhost:8080 ...
PHP Deprecated:  Creation of dynamic property Wirecli\Commands\Common\ServeCommand::$helper is deprecated in ..\vendor\wirecli\wire-cli\src\Commands\Common\ServeCommand.php on line 47

Deprecated: Creation of dynamic property Wirecli\Commands\Common\ServeCommand::$helper is deprecated in ..\vendor\wirecli\wire-cli\src\Commands\Common\ServeCommand.php on line 47
flydev-fr commented 8 months ago

Thanks, just created a new branch which will hold port to php >=8.2

ivangretsky commented 2 months ago

Not sure if this should go here as well, but seems to be also php 8.2 related.

I need to have php cli version 8.2 for some of my PW modules, which I also run from cli. But wire-cli doesn't seem to work with PHP 8.2. When I run wirecli new I get this:

изображение

When running under php 8.1 the process goes as expected.

I've upgraged to composer global require wirecli/wire-cli:php-8.2 with no luck.

@flydev-fr , could you look into this s'il vous plaît)

ivangretsky commented 2 months ago

@flydev-fr , is there a way I can help you with this problem? I do not quite understand how to debug a cli tool installed globally with composer. Maybe I should install it some other way?

flydev-fr commented 2 months ago

Hi @ivangretsky,

I can't put my hands on it right now, my setup is not ready as I am waiting to receive new hard-drives replacement, it's a matter of days.

About debugging the tool, you just have to clone the repo and you can then call php .\wirecli from the cloned directory (adjusting relative path when calling the tool from another dir). It's easier to open the whole folder in VSCode.

For example:

  1. clone the repo git clone --branch dev https://github.com/wirecli/wire-cli.git
  2. get into the cloned dir cd wire-cli
  3. update vendors composer update
  4. check if the tool is working php .\wirecli -V
  5. make a small test by creating a new pw setup in a "dev" folder
    mkdir dev
    cd dev
    php ..\wirecli new .

edit: a small note, there are two handy tools available that could be used, squizlabs/php_codesniffer for coding standards and rectorphp/rector for upgrading php code.

ivangretsky commented 1 month ago

Thanks @flydev-fr . I've setup everything as you said. The error seems to be that the downloaded archive doesn't get extracted. I've tracked down the error to this line. The issue is that I had proc_exec disabled in my env. Same issue as this one, but with a different function.

I would hope that this error would be seen, at least with -vvv argument. But it wasn't.

Thanks for your help!