Skip to content

Commit

Permalink
Drop conflict with symfony/cache >=6
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominic Tubach committed Jun 27, 2024
1 parent f6e9c70 commit 139ba4a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
18 changes: 18 additions & 0 deletions composer-deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh

# This script has to be used when installing dependencies for deployment.
# It makes that symfony/cache is not installed as dependency. symfony/cache is
# already installed with CiviCRM. Depending on the CiviCRM version it results in
# this error when symfony/cache 6 and psr/cache 3 are installed:
# PHP Fatal error: Declaration of Symfony\Component\Cache\CacheItem::expiresAt(?DateTimeInterface $expiration): Symfony\Component\ErrorHandler\DebugClassLoader
# must be compatible with Psr\Cache\CacheItemInterface::expiresAt($expiration)

# In case this extension is actually installed as composer dependency it must
# not replace symfony/cache because it would prevent its installation.

sed -e 's#^\}#,"replace":{"symfony/cache":"*"}}#' -i composer.json
composer "$@"
code=$?
sed -e 's#,"replace":.*#}#' -i composer.json

exit $code
4 changes: 1 addition & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@
]
},
"require-dev": {
"psr/simple-cache": "^1 || ^2 || ^3",
"symfony/event-dispatcher-contracts": "^1 || ^2 || ^3"
},
"conflict": {
"symfony/cache": ">=6"
}
}
10 changes: 0 additions & 10 deletions composer.json.md

This file was deleted.

2 changes: 1 addition & 1 deletion tests/docker-prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ else
fi

cd "$EXT_DIR"
composer update --no-progress --prefer-dist --optimize-autoloader --no-dev
./composer-deploy.sh update --no-progress --prefer-dist --optimize-autoloader --no-dev
composer composer-phpunit -- update --no-progress --prefer-dist

0 comments on commit 139ba4a

Please sign in to comment.