Skip to content

Commit

Permalink
Moved ignore platform requirements from build script to composer file.
Browse files Browse the repository at this point in the history
* introduced option to keep lock file (to satify IDE's during development)
  • Loading branch information
intuibase committed Dec 18, 2024
1 parent c3d82ac commit 5c6c170
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
7 changes: 7 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@
"dealerdirect/phpcodesniffer-composer-installer": true,
"php-http/discovery": true,
"tbachert/spi": true
},
"platform": {
"ext-mysqli": "8.1",
"ext-curl": "8.1",
"ext-pdo": "8.1",
"ext-opentelemetry": "0",
"ext-otel_instrumentation": "0"
}
},
"scripts": {
Expand Down
13 changes: 11 additions & 2 deletions tools/build/build_php_deps.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#!/bin/bash

SKIP_NOTICE=false
KEEP_COMPOSER=false

show_help() {
echo "Usage: $0 --php_versions <versions>"
echo
echo "Arguments:"
echo " --php_versions Required. List of PHP versions separated by spaces (e.g., '81 82 83 84')."
echo " --skip_notice Optional. Skip notice file generator."
echo " --keep_composer Optional. Keep composer.lock file."
echo
echo "Example:"
echo " $0 --php_versions '81 82 83 84' --skip_notice"
Expand All @@ -24,6 +26,9 @@ parse_args() {
--skip_notice)
SKIP_NOTICE=true
;;
--keep_composer)
KEEP_COMPOSER=true
;;
--help)
show_help
exit 0
Expand Down Expand Up @@ -73,10 +78,14 @@ do
apt-get update && apt-get install -y unzip git \
&& git config --global --add safe.directory /sources \
&& curl -sS https://getcomposer.org/installer | php -- --filename=composer --install-dir=/usr/local/bin \
&& composer --ignore-platform-req=ext-opentelemetry --ignore-platform-req=ext-otel_instrumentation --ignore-platform-req=php --no-dev install \
&& composer --ignore-platform-req=php --no-dev install \
${GEN_NOTICE} \
&& chmod 666 /sources/composer.lock"

rm -f composer.lock
if [ "$KEEP_COMPOSER" = true ]; then
echo "Keeping composer.lock file"
else
rm -f composer.lock
fi

done

0 comments on commit 5c6c170

Please sign in to comment.