diff options
author | 2016-01-09 12:14:24 -0500 | |
---|---|---|
committer | 2016-01-09 12:14:24 -0500 | |
commit | 86c833863a6febca1f1bd4c8408239853ed3acfb (patch) | |
tree | bd383213894d669843ec3bfb0282bf9a18d139a5 | |
parent | Undo the change from phpdbg -> dbg, using "phpdbg" everywhere makes more sense. (diff) | |
download | eselect-php-86c833863a6febca1f1bd4c8408239853ed3acfb.tar.gz eselect-php-86c833863a6febca1f1bd4c8408239853ed3acfb.tar.bz2 eselect-php-86c833863a6febca1f1bd4c8408239853ed3acfb.zip |
Consolidate all of the set_foo() functions.
-rw-r--r-- | src/php.eselect.in | 43 |
1 files changed, 16 insertions, 27 deletions
diff --git a/src/php.eselect.in b/src/php.eselect.in index 8f752e4..9970520 100644 --- a/src/php.eselect.in +++ b/src/php.eselect.in @@ -463,6 +463,9 @@ set_sapi() { # configuration with -DPHP5 and 70_mod_php5.conf. If he is, warn him # that it is outdated, and that his eselect choices will not have any # effect until the configuration is updated. +# +# This can be removed after around a year. +# apache2_php5_config_check() { if [ -f "${EROOT}/etc/apache2/modules.d/70_mod_php5.conf" ] ; then local msg @@ -478,31 +481,6 @@ apache2_php5_config_check() { fi } -set_apache2() { - apache2_php5_config_check - local target="${1}" - set_sapi apache2 "${target}" - write_mod_php_conf "$(resolv_target apache2 "${target}")" - echo "Please restart apache for the changes to take effect." -} - -set_cli() { - set_sapi cli "${1}" -} - -set_cgi() { - set_sapi cgi "${1}" -} - -set_phpdbg() { - set_sapi phpdbg "${1}" -} - -set_fpm() { - set_sapi fpm "${1}" - echo "Please restart php-fpm for the changes to take effect." -} - ## set action describe_set() { @@ -520,8 +498,19 @@ describe_set_options() { do_set() { - check_module $1 - set_$1 $2 + local sapi="${1}" + local target="${2}" + check_module "${sapi}" + + set_sapi "${sapi}" "${target}" + + if [[ "${sapi}" == "apache2" ]]; then + apache2_php5_config_check + write_mod_php_conf "$(resolv_target apache2 "${target}")" + echo "Please restart apache for the changes to take effect." + elif [[ "${sapi}" == "fpm" ]]; then + echo "Please restart php-fpm for the changes to take effect." + fi } |