Skip to content

Commit

Permalink
Enable opcache for php 5.5.0+
Browse files Browse the repository at this point in the history
  • Loading branch information
joec4i committed Jun 22, 2022
1 parent ab86d61 commit e36da1f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion bin/install
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ install_php() {

echo "Determining configuration options..."
local source_path=$(get_download_file_path $install_type $version $tmp_download_dir)
local configure_options="$(construct_configure_options $install_path)"
local configure_options="$(construct_configure_options $install_path $version)"
local make_flags="-j$ASDF_CONCURRENCY"

local operating_system=$(uname -a)
Expand Down Expand Up @@ -109,8 +109,13 @@ install_composer() {
$bin_path/php -r "unlink('composer-setup.php');"
}

version_greater_equal() {
printf '%s\n%s\n' "$2" "$1" | sort --check=quiet --version-sort
}

construct_configure_options() {
local install_path=$1
local version=$2

# many options included below are not applicable to newer PHP versions
# including these will trigger a build warning, but will not b
Expand Down Expand Up @@ -153,6 +158,9 @@ construct_configure_options() {
--with-zlib \
--without-snmp"

# opcache is bundled with php 5.5.0 and later
version_greater_equal $version "5.5.0" && global_config="$global_config --enable-opcache"

if [ "$PHP_CONFIGURE_OPTIONS" = "" ]; then
local configure_options="$(os_based_configure_options) $global_config"
else
Expand Down

0 comments on commit e36da1f

Please sign in to comment.