migrations icon indicating copy to clipboard operation
migrations copied to clipboard

The PHAR is broken

Open antoineB opened this issue 5 years ago • 0 comments

Summary

When building the PHAR from the script build-phar.sh the file doctrine-migrations.php is missing.

Current behavior

./bin/doctrine-migration.phar

PHP Warning:  require(phar:///home/antoineb/src/migrations-2.2.0/bin/doctrine-migrations.phar/bin/../lib/doctrine-migrations.php): failed to open stream: phar error: "lib/doctrine-migrations.php" is not a file in phar "/home/antoineb/src/migrations-2.2.0/bin/doctrine-migrations.phar" in phar:///home/antoineb/src/migrations-2.2.0/bin/doctrine-migrations.phar/bin/doctrine-migrations on line 7
PHP Fatal error:  require(): Failed opening required 'phar:///home/antoineb/src/migrations-2.2.0/bin/doctrine-migrations.phar/bin/../lib/doctrine-migrations.php' (include_path='.:/usr/share/php') in phar:///home/antoineb/src/migrations-2.2.0/bin/doctrine-migrations.phar/bin/doctrine-migrations on line 7

How to reproduce

Run the script build-phar.sh

One way to fix it

before running the command build-phar.sh rename doctrine-migrations.php to doctrine-migration and add #!/usr/bin/env php line at the beginning of the file.

antoineB avatar Jan 06 '20 09:01 antoineB