Skip to content

Commit

Permalink
Add workaround for missing phalcon packages on Ubuntu 22.04
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Jul 15, 2022
1 parent 0d9a1ba commit 4979d5b
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions src/scripts/extensions/phalcon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,36 @@ get_phalcon_version() {
semver="$(get_pecl_version phalcon stable 5)"
([ -n "$semver" ] && echo "$semver") || get_pecl_version phalcon rc 5
elif [ "$extension" = "phalcon4" ]; then
echo '4.1.2'
echo '4.1.3'
elif [ "$extension" = "phalcon3" ]; then
echo '3.4.5'
fi
}

# Function to add phalcon from repo.
add_phalcon_from_repo(){
version=${version:?}
if [ "$extension" = "phalcon5" ]; then
PHALCON_PATH=build/phalcon
else
PHALCON_PATH=build/php"${version%.*}"/64bits
fi
PHALCON_CONFIGURE_OPTS="--enable-phalcon --with-php-config=$(command -v php-config)"
export PHALCON_PATH
export PHALCON_CONFIGURE_OPTS
add_extension_from_source phalcon https://github.com phalcon cphalcon v"$(get_phalcon_version)" extension
}

# Helper function to add phalcon.
add_phalcon_helper() {
status='Installed and enabled'
if [ "$(uname -s)" = "Darwin" ]; then
add_brew_extension "$extension" extension
else
packages=("php${version:?}-$extension")
[ "$extension" = "phalcon4" ] && packages+=("php${version:?}-psr")
package="php${version:?}-$extension"
add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
(check_package "${packages[0]}" && install_packages "${packages[@]}") || pecl_install "phalcon-$(get_phalcon_version)"
[ "$extension" = "phalcon4" ] && (install_packages "php${version:?}-psr" || pecl_install psr || pecl_install psr-1.1.0)
(check_package "$package" && install_packages "$package") || add_phalcon_from_repo
fi
}

Expand Down

0 comments on commit 4979d5b

Please sign in to comment.