cakephp / phinx

PHP Database Migrations for Everyone
https://phinx.org
MIT License
4.45k stars 895 forks source link

phar version doesn't work #2274

Closed xylle closed 3 months ago

xylle commented 3 months ago

Helo,

I have downloaded phinx phar version 0.16 and doesn't work. The folder is empty, there are no other folders or files except phinx.phar

OS Version : Debian 12 bookworm php version : 8.2.18

If I try phinx.phar version 0.13.4, its work. version after 0.13.4 doesnt work

If i install phinx with composer in empty project, i have 0.16 version and its works

error message :

./phinx.phar 
PHP Fatal error:  Uncaught UnexpectedValueException: DirectoryIterator::__construct(phar:///tmp/phinx/phinx.phar/vendor/symfony/console/Command/../Resources/): Failed to open directory: operation failed in phar:///tmp/phinx/phinx.phar/vendor/symfony/console/Command/DumpCompletionCommand.php:152
Stack trace:
#0 phar:///tmp/phinx/phinx.phar/vendor/symfony/console/Command/DumpCompletionCommand.php(152): DirectoryIterator->__construct()
#1 phar:///tmp/phinx/phinx.phar/vendor/symfony/console/Command/DumpCompletionCommand.php(55): Symfony\Component\Console\Command\DumpCompletionCommand->getSupportedShells()
#2 phar:///tmp/phinx/phinx.phar/vendor/symfony/console/Command/Command.php(137): Symfony\Component\Console\Command\DumpCompletionCommand->configure()
#3 phar:///tmp/phinx/phinx.phar/vendor/symfony/console/Application.php(1151): Symfony\Component\Console\Command\Command->__construct()
#4 phar:///tmp/phinx/phinx.phar/vendor/symfony/console/Application.php(1327): Symfony\Component\Console\Application->getDefaultCommands()
#5 phar:///tmp/phinx/phinx.phar/vendor/symfony/console/Application.php(548): Symfony\Component\Console\Application->init()
#6 phar:///tmp/phinx/phinx.phar/vendor/symfony/console/Application.php(534): Symfony\Component\Console\Application->add()
#7 phar:///tmp/phinx/phinx.phar/src/Phinx/Console/PhinxApplication.php(37): Symfony\Component\Console\Application->addCommands()
#8 phar:///tmp/phinx/phinx.phar/app/phinx.php(36): Phinx\Console\PhinxApplication->__construct()
#9 phar:///tmp/phinx/phinx.phar/bin/phinx(26): require('...')
#10 /tmp/phinx/phinx.phar(14): require('...')
#11 {main}
  thrown in phar:///tmp/phinx/phinx.phar/vendor/symfony/console/Command/DumpCompletionCommand.php on line 152
MasterOdin commented 3 months ago

The change here is that (I think) we need to modify the box.json file to include "vendor/symfony/console/Resources" in the directories field, as by default box doesn't include it since it doesn't include any PHP files. This was probably caused by an upgrade to symfony/console:5.4+ I think between 0.13.4 and later versions of phinx.

xylle commented 3 months ago

version 0.14 doesn't work, 0.13.4 is the last working.

MasterOdin commented 3 months ago

Would you be alright with just having the 0.16.0 phar working, or do you need older versions fixed?

xylle commented 3 months ago

If the latest version works, it's perfect for me.

ajibarra commented 3 months ago

Fixed on #2280