Skip to content

Commit

Permalink
Link opcache to ext_dir on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Jul 29, 2023
1 parent 9c77701 commit 5b2015e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/scripts/darwin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ link_libraries() {
done
}

# Link opcache extension to extensions directory.
link_opcache() {
opcache_ini="$brew_prefix"/etc/php/"$version"/conf.d/ext-opcache.ini
if [ -e "$opcache_ini" ]; then
opcache_ext=$(grep -Eo "zend_extension.*opcache.*\.so" "$opcache_ini" | cut -d '"' -f 2)
sudo ln -sf "$opcache_ext" "$ext_dir"
fi
}

# Patch brew to overwrite packages.
patch_brew() {
formula_installer="${brew_repo:?}"/Library/Homebrew/formula_installer.rb
Expand Down Expand Up @@ -233,6 +242,7 @@ setup_php() {
semver="$(php_semver)"
extra_version="$(php_extra_version)"
configure_php
link_opcache
set_output "php-version" "$semver"
if [ "${semver%.*}" != "$version" ]; then
add_log "${cross:?}" "PHP" "Could not setup PHP $version"
Expand Down

0 comments on commit 5b2015e

Please sign in to comment.