Skip to content

Commit 80c756a

Browse files
authored
Updates
1 parent 6e50bcc commit 80c756a

4 files changed

Lines changed: 11 additions & 6 deletions

File tree

scripts/install/php/php-install.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ php${PHP_VER}-xml
4141
php${PHP_VER}-zip"
4242

4343
# PHP 8.5+ has opcache built-in; older versions need the separate package
44-
if [[ "$(echo "${PHP_VER} < 8.5" | bc -l)" -eq 1 ]]; then
44+
# Convert PHP_VER (e.g. "8.4") into an integer (e.g. 84) for numeric comparison
45+
php_major=${PHP_VER%%.*}
46+
php_minor=${PHP_VER#*.}
47+
php_ver_int=$((php_major * 10 + php_minor))
48+
if (( php_ver_int < 85 )); then
4549
php_packages="${php_packages}
4650
php${PHP_VER}-opcache"
4751
fi

scripts/update/php-update.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ php${NEW_PHP_VER}-xml
8787
php${NEW_PHP_VER}-zip"
8888

8989
# PHP 8.5+ has opcache built-in; older versions need the separate package
90-
if [[ "$(echo "${NEW_PHP_VER} < 8.5" | bc -l)" -eq 1 ]]; then
90+
php_major="${NEW_PHP_VER%%.*}"
91+
php_minor="${NEW_PHP_VER#*.}"
92+
if (( php_major < 8 || (php_major == 8 && php_minor < 5) )); then
9193
php_packages="${php_packages}
9294
php${NEW_PHP_VER}-opcache"
9395
fi

scripts/update/software-update.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ print_last_errors
5353
debug_pause "phpMyAdmin"
5454

5555
# Update WP-CLI
56-
echo "y" | wp cli update --stable --allow-root 2>> /tmp/enginescript_install_errors.log
57-
echo "y" | wp package update --allow-root 2>> /tmp/enginescript_install_errors.log
56+
/usr/local/bin/enginescript/scripts/update/wp-cli-update.sh 2>> /tmp/enginescript_install_errors.log
5857
print_last_errors
5958
debug_pause "WP-CLI"
6059

scripts/update/wp-cli-update.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ source /usr/local/bin/enginescript/scripts/functions/shared/enginescript-common.
2121
#----------------------------------------------------------------------------
2222

2323
# Update WP-CLI
24-
echo "y" | wp cli update --stable --allow-root 2>> /tmp/enginescript_install_errors.log
25-
echo "y" | wp package update --allow-root 2>> /tmp/enginescript_install_errors.log
24+
wp cli update --stable --allow-root --yes 2>> /tmp/enginescript_install_errors.log
25+
wp package update --allow-root --yes 2>> /tmp/enginescript_install_errors.log
2626
print_last_errors
2727
debug_pause "WP-CLI Update"

0 commit comments

Comments
 (0)