dreadnaut / PHPloy

PHPloy - Incremental Git (S)FTP deployment tool that supports multiple servers, submodules and rollbacks.
http://wplancer.com/phploy/
12 stars 1 forks source link

PHP 8.3 warnings #3

Open tomasr1981 opened 2 months ago

tomasr1981 commented 2 months ago

Hi, PHP 8.3 has some warnings:

PHP Warning:  compact(): Undefined variable $visibility in /home/user/.composer/vendor/league/flysystem-sftp/src/SftpAdapter.php on line 366
PHP Stack trace:
PHP   1. {main}() /home/user/.composer/vendor/banago/phploy/bin/phploy:0
PHP   2. Banago\PHPloy\PHPloy->__construct($opt = *uninitialized*) /home/user/.composer/vendor/banago/phploy/bin/phploy:14
PHP   3. Banago\PHPloy\PHPloy->deploy() /home/user/.composer/vendor/banago/phploy/src/PHPloy.php:331
PHP   8. compact($var_name = 'contents', ...$var_names = variadic('path')) /home/user/.composer/vendor/league/flysystem-sftp/src/SftpAdapter.php:366
dreadnaut commented 2 months ago
PHP   1. {main}() /home/user/.composer/vendor/banago/phploy/bin/phploy:0

You seem to be running banago/phploy, the original version, instead of dreadnaut/phploy. The version in this repository uses newer code, and does not raise that warning.

OhMyLuDoo commented 2 months ago

Hi i'm verry sorry i'm a big newby... I want to use PHPloy and after struggling a lot i finally found your fork. I don't know how to use composer, i don't know how to tell him to use your phploy instead of banago. Cuz like tomsr1981, i am currently using banago...

dreadnaut commented 2 months ago

If you have previously installed banago/phploy, you can remove it by running

composer global remove banago/phploy

After that, you should be able to this version using

composer global require dreadnaut/phploy:dev-master

(edit, fixed command 👆)

tomasr1981 commented 2 months ago

Hi, sorry for the late reply. If I do what you write, I get an error.

composer global remove banago/phploy
Changed current directory to /home/user/.config/composer
banago/phploy is not required in your composer.json and has not been removed
./composer.json has been updated
Running composer update banago/phploy
Loading composer repositories with package information
Package "banago/phploy" listed for update is not locked.
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating autoload files
2 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
No security vulnerability advisories found.
user@computer:~$ composer global install dreadnaut/phploy:dev-master
Changed current directory to /home/user/.config/composer
Invalid argument dreadnaut/phploy:dev-master. Use "composer require dreadnaut/phploy:dev-master" instead to add packages to your composer.json.
composer fund
Composer could not find a composer.json file in /home/user
To initialize a project, please create a composer.json file. See https://getcomposer.org/basic-usage

It seems, that remove banago corrupted some paths or files?

dreadnaut commented 1 month ago

Sorry, I gave you the wrong suggestion: composer global install <package> is not a valid command, that should have been require:

composer global require dreadnaut/phploy:dev-master
tomasr1981 commented 1 month ago

Now is installed:

Changed current directory to /home/user/.config/composer
./composer.json has been updated
Running composer update dreadnaut/phploy
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 1 update, 0 removals
  - Upgrading dreadnaut/phploy (dev-master fd15572 => dev-master e2c3858)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
  - Downloading dreadnaut/phploy (dev-master e2c3858)
  - Upgrading dreadnaut/phploy (dev-master fd15572 => dev-master e2c3858): Extracting archive
Generating autoload files
2 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
No security vulnerability advisories found.

However, the error from the beginning applies. Before use:

composer global remove banago/phploy

Banago cannot be removed and apparently it is being used, hence the errors. Don't know what it could be?

dreadnaut commented 1 month ago

Alas, I'm not sure how to help you, my experience doesn't get this far. My remaining suggestion would be to empty the .config/composer directory and start from scratch. You can see which packages you have installed using the show command, to make sure you're not forgetting to reinstall anything important:

composer global show
tomasr1981 commented 1 month ago

I understand, I'm a little worried about starting over so I don't mess something up. It's strange that the show command doesn't show banago at all, only your fork is there.

composer global show
Changed current directory to /home/user/.config/composer
dreadnaut/phploy                 dev-master e2c3858 PHPloy - Incremental Gi...
league/climate                   3.8.2              PHP's best friend for t...
league/flysystem                 3.28.0             File storage abstractio...
league/flysystem-ftp             3.28.0             FTP filesystem adapter ...
league/flysystem-local           3.28.0             Local filesystem adapte...
league/flysystem-sftp-v3         3.28.0             SFTP filesystem adapter...
league/mime-type-detection       1.15.0             Mime-type detection for...
paragonie/constant_time_encoding v3.0.0             Constant-time Implement...
paragonie/random_compat          v9.99.100          PHP 5.x polyfill for ra...
phpseclib/phpseclib              3.0.39             PHP Secure Communicatio...
psr/log                          3.0.0              Common interface for lo...
seld/cli-prompt
dreadnaut commented 1 month ago

That list only shows pieces of PHPloy, so you should be OK removing the directory and restarting 👍

tomasr1981 commented 1 month ago

Hi, if i delete /home/user/.config/composer folder and run composer global require dreadnaut/phploy:dev-master i get error:

"./composer.json" does not contain valid JSON                     
  Parse error on line 3:                                            
  ...hploy": "^4.9",    }}                                          
  ---------------------^                                            
  Expected: 'STRING' - It appears you have an extra trailing comma

I did not find any such content.

If I just delete the /home/user/.config/composer/vendor folder and run the same command, everything installs, but the error is still the same. Is there anything else I should check?