Skip to content

Commit

Permalink
Bake version data into PHAR file
Browse files Browse the repository at this point in the history
Compatibility between `ocramius/package-versions`,
`composer/package-versions-deprecated`, `composer-runtime-api` and
`humbug/box` (with `humbug/scoper` further complicating things)has been
always a problematic area. So instead of trying to keep up with all the
changes in all of those packages, we will now bake the version data (for
the packages we need) into the PHAR file itself.

Fixes #7606
Fixes #5399
  • Loading branch information
weirdan committed Nov 26, 2022
1 parent 369ba06 commit 683fe2f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions bin/build-phar.sh
Expand Up @@ -8,6 +8,12 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

php $DIR/improve_class_alias.php

php -r 'require "vendor/autoload.php"; Psalm\Internal\VersionUtils::dump();'
if [[ ! -f build/phar-versions.php ]] ; then
echo "failed to dump versions";
exit;
fi

vendor/bin/box compile

if [[ "$GPG_SIGNING" != '' ]] ; then
Expand Down
6 changes: 5 additions & 1 deletion box.json.dist
@@ -1,7 +1,11 @@
{
"output" : "build/psalm.phar",
"files": [
"psalm"
"psalm",
"build/phar-versions.php"
],
"map": [
{"build/phar-versions.php" : "phar-versions.php"}
],
"files-bin": ["config.xsd"],
"directories-bin" : [
Expand Down

0 comments on commit 683fe2f

Please sign in to comment.