Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable opcache for php 5.5.0+ #130

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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