-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from devilbox/release-0.18
Add Module: IonCube
- Loading branch information
Showing
14 changed files
with
169 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
Dockerfiles/prod/data/docker-entrypoint.d/38-enable-modules.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
set -u | ||
set -o pipefail | ||
|
||
|
||
############################################################ | ||
# Functions | ||
############################################################ | ||
|
||
### | ||
### Enable PHP Modules | ||
### | ||
enable_modules() { | ||
local mod_varname="${1}" | ||
local debug="${2}" | ||
local cfg_path="/usr/local/etc/php/conf.d" | ||
local mod_path= | ||
mod_path="$( php -i | grep ^extension_dir | awk -F '=>' '{print $2}' | xargs )" | ||
|
||
|
||
if ! env_set "${mod_varname}"; then | ||
log "info" "\$${mod_varname} not set. Not enabling any PHP modules." "${debug}" | ||
else | ||
mods="$( env_get "${mod_varname}" )" | ||
|
||
if [ -z "${mods}" ]; then | ||
log "info" "\$${mod_varname} set, but empty. Not enabling any PHP modules." "${debug}" | ||
else | ||
log "info" "Enabling the following PHP modules: ${mods}" "${debug}" | ||
fi | ||
|
||
while read -r mod; do | ||
mod="$( echo "${mod}" | xargs )" # trim | ||
|
||
# Does the module exist? | ||
if [ -f "${mod_path}/${mod}.so" ]; then | ||
# Exceptions to load speficially | ||
if [ "${mod}" = "ioncube" ]; then | ||
run "eche 'zend_extension=${mod_path}/ioncube.so' > '${cfg_path}/docker-ext-php-ext-ioncube.ini'" "${debug}" | ||
# Generic Load | ||
else | ||
run "docker-php-ext-enable ${mod} || true" "${debug}" | ||
fi | ||
else | ||
log "warn" "Enabling PHP Module: '${mod}' does not exist" "${debug}" | ||
fi | ||
done <<< "$( echo "${mods}" | tr ',' '\n' )" | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters