added php-composer to install setup script

This commit is contained in:
2025-05-15 08:46:34 -04:00
parent 002b1ec0d8
commit 384c151435
2 changed files with 56 additions and 11 deletions
+22
View File
@@ -0,0 +1,22 @@
#!/bin/sh
# offical code snipet to get composer for unix:
# https://getcomposer.org/doc/faqs/how-to-install-composer-programmatically.md
# ----------------------------------------------------------
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
then
>&2 echo 'ERROR: Invalid installer checksum'
rm composer-setup.php
exit 1
fi
php composer-setup.php --quiet
RESULT=$?
rm composer-setup.php
exit $RESULT
+34 -11
View File
@@ -72,6 +72,27 @@ install_collection 'extra utilities: (ncdu, zip, php, rclone, etc.)' ncdu zip un
# ----------------------------------------------------------
if [[ -n $(command -v "php") ]]; then
read -p 'Install PHP Composer? [y/N]: ' response
case "${response}" in
[Yy]* )
return_dir=$(pwd)
cd "${package_dir}"
"${package_dir}/composer-install/composer-install.sh"
if [[ -f "composer.phar" ]]; then
sudo mv composer.phar /usr/bin/composer
fi
cd "${return_dir}"
;;
* )
echo 'Skipping'
;;
esac
echo ''
fi
# ----------------------------------------------------------
read -p 'Install Docker? [y/N]: ' response
case "${response}" in
[Yy]* )
@@ -106,11 +127,12 @@ install_collection 'Ruby: (ruby, build-essential)' ruby-full build-essential zli
# ----------------------------------------------------------
read -p 'Configure GEM_HOME and PATH for Ruby support? [y/N]: ' response
case "${response}" in
[Yy]* )
make_bashrc_backup
( cat << 'BASHRC'
if [[ -n $(command -v "ruby") ]]; then
read -p 'Configure GEM_HOME and PATH for Ruby support? [y/N]: ' response
case "${response}" in
[Yy]* )
make_bashrc_backup
( cat << 'BASHRC'
# ABS configure ruby gems
export GEM_HOME="$HOME/gems"
@@ -118,12 +140,13 @@ export PATH="$HOME/gems/bin:$PATH"
BASHRC
) >> "${HOME}/.bashrc"
;;
* )
echo 'Skipping'
;;
esac
echo ''
;;
* )
echo 'Skipping'
;;
esac
echo ''
fi
# ----------------------------------------------------------