File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ install_php() {
1515
1616 echo " Determining configuration options..."
1717 local source_path=$( get_download_file_path $install_type $version $tmp_download_dir )
18- local configure_options=" $( construct_configure_options $install_path ) "
18+ local configure_options=" $( construct_configure_options $install_path $version ) "
1919 local make_flags=" -j$ASDF_CONCURRENCY "
2020
2121 local operating_system=$( uname -a)
@@ -109,8 +109,13 @@ install_composer() {
109109 $bin_path /php -r " unlink('composer-setup.php');"
110110}
111111
112+ version_greater_equal () {
113+ printf ' %s\n%s\n' " $2 " " $1 " | sort --check=quiet --version-sort
114+ }
115+
112116construct_configure_options () {
113117 local install_path=$1
118+ local version=$2
114119
115120 # many options included below are not applicable to newer PHP versions
116121 # including these will trigger a build warning, but will not b
@@ -153,6 +158,9 @@ construct_configure_options() {
153158 --with-zlib \
154159 --without-snmp"
155160
161+ # opcache is bundled with php 5.5.0 and later
162+ version_greater_equal $version " 5.5.0" && global_config=" $global_config --enable-opcache"
163+
156164 if [ " $PHP_CONFIGURE_OPTIONS " = " " ]; then
157165 local configure_options=" $( os_based_configure_options) $global_config "
158166 else
You can’t perform that action at this time.
0 commit comments