Skip to content

Commit

Permalink
Remove symfony/http-client dependency to be compatible with PHP 8.0 (#91
Browse files Browse the repository at this point in the history
)

* Fixed version to 0.1.0
* Enabled PDO from PHP 8.0
* Prevented installation of slim
* Added option to skip NOTICE file generation to speed up deps installation locally
  • Loading branch information
intuibase authored Sep 13, 2024
1 parent 6f3c56d commit 994c1ae
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
10 changes: 4 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,17 @@
],
"require": {
"php": "8.0.*||8.1.*||8.2.*||8.3.*",
"nyholm/psr7": "^1.8",
"open-telemetry/exporter-otlp": "1.0.4",
"open-telemetry/opentelemetry-auto-http-async": "1.0.1",
"open-telemetry/opentelemetry-auto-laravel": "0.0.25",
"open-telemetry/opentelemetry-auto-pdo": "0.0.15",
"open-telemetry/opentelemetry-auto-slim": "1.0.6",
"open-telemetry/sdk": "1.0.8",
"php-http/guzzle7-adapter": "^1.0",
"symfony/http-client": "6.*||7.*"
"php-http/guzzle7-adapter": "^1.0"
},
"provide": {
"laravel/framework": "*"
"laravel/framework": "*",
"slim/slim": "*"
},
"require-dev": {
"php-parallel-lint/php-console-highlighter": "^1.0",
Expand All @@ -46,8 +45,7 @@
"process-timeout": 0,
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"php-http/discovery": false
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion elastic-otel-php.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=0.1
version=0.1.0
24 changes: 20 additions & 4 deletions tools/build/build_php_deps.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
#!/bin/bash

SKIP_NOTICE=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., '80 81 82 83')."
echo " --skip_notice Optional. Skip notice file generator."
echo
echo "Example:"
echo " $0 --php_versions '80 81 82 83'"
echo " $0 --php_versions '80 81 82 83' --skip_notice"
}

# Function to parse arguments
Expand All @@ -18,6 +21,9 @@ parse_args() {
PHP_VERSIONS=($2)
shift
;;
--skip_notice)
SKIP_NOTICE=true
;;
--help)
show_help
exit 0
Expand All @@ -42,11 +48,21 @@ if [[ -z "$PHP_VERSIONS" ]]; then
exit 1
fi

GEN_NOTICE=""
if [ "$SKIP_NOTICE" = true ]; then
echo "Skipping notice file generation..."
else
GEN_NOTICE="&& echo 'Generating NOTICE file. This may take some time...' && php /sources/packaging/notice_generator.php >>/sources/NOTICE"
fi


for PHP_VERSION in "${PHP_VERSIONS[@]}"
do
mkdir -p "prod/php/vendor_${PHP_VERSION}"

echo "This project depends on following packages for PHP ${PHP_VERSION:0:1}.${PHP_VERSION:1:1}" >>NOTICE
if [ "$SKIP_NOTICE" = false ]; then
echo "This project depends on following packages for PHP ${PHP_VERSION:0:1}.${PHP_VERSION:1:1}" >>NOTICE
fi

docker run --rm \
-v ${PWD}:/sources \
Expand All @@ -57,8 +73,8 @@ 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 --no-dev install \
&& php /sources/packaging/notice_generator.php >>/sources/NOTICE \
&& composer --ignore-platform-req=ext-opentelemetry --ignore-platform-req=ext-otel_instrumentation --ignore-platform-req=php --no-dev install \
${GEN_NOTICE} \
&& chmod 666 /sources/composer.lock"

rm -f composer.lock
Expand Down

0 comments on commit 994c1ae

Please sign in to comment.