#!/usr/bin/env bash # PHP Loader Installer # Min. Requirement : GNU/Linux Ubuntu 16.04 & 16.04 # Last Build : 03/04/2021 # Author : MasEDI.Net (me@masedi.net) # Since Version : 1.3.0 # Include helper functions. if [ "$(type -t run)" != "function" ]; then BASEDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd ) # shellcheck disable=SC1091 . "${BASEDIR}/helper.sh" fi # Make sure only root can run this installer script. requires_root ## # Install ionCube Loader. # function install_ioncube() { echo "Installing ionCube PHP loader..." # Delete old loaders file. if [ -d /usr/lib/php/loaders/ioncube ]; then echo "Removing old/existing ionCube PHP loader..." run rm -fr /usr/lib/php/loaders/ioncube fi local CURRENT_DIR && CURRENT_DIR=$(pwd) run cd "${BUILD_DIR}" || return 1 echo "Download latest ionCube PHP loader..." ARCH=${ARCH:-$(uname -p)} if [[ "${ARCH}" == "x86_64" ]]; then run wget -q "https://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz" run tar -xzf ioncube_loaders_lin_x86-64.tar.gz run rm -f ioncube_loaders_lin_x86-64.tar.gz else run wget -q "https://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz" run tar -xzf ioncube_loaders_lin_x86.tar.gz run rm -f ioncube_loaders_lin_x86.tar.gz fi run mv -f ioncube /usr/lib/php/loaders/ run cd "${CURRENT_DIR}" || return 1 } ## # Enable ionCube Loader. # function enable_ioncube() { # PHP version. local PHPv="${1}" if [ -z "${PHPv}" ]; then PHPv=${PHP_VERSION:-"7.4"} fi echo "Enable ionCube PHP ${PHPv} loader" if "${DRYRUN}"; then info "ionCube PHP ${PHPv} enabled in dryrun mode." else if [[ -f "/usr/lib/php/loaders/ioncube/ioncube_loader_lin_${PHPv}.so" && -n $(command -v "php${PHPv}") ]]; then cat > "/etc/php/${PHPv}/mods-available/ioncube.ini" < "/etc/php/${PHPv}/mods-available/sourceguardian.ini" <