diff options
author | 2016-01-22 15:51:08 -0500 | |
---|---|---|
committer | 2016-01-22 15:51:08 -0500 | |
commit | 0c235fbacfaf5e741ea6d613eb531541e7e66368 (patch) | |
tree | 1c838f92bded8c2bd04ae7745d2e048451e154f5 | |
parent | Add 70_mod_php.conf.in to EXTRA_DIST in Makefile.am. (diff) | |
download | eselect-php-0c235fbacfaf5e741ea6d613eb531541e7e66368.tar.gz eselect-php-0c235fbacfaf5e741ea6d613eb531541e7e66368.tar.bz2 eselect-php-0c235fbacfaf5e741ea6d613eb531541e7e66368.zip |
Move the apache conf file writing into set_sapi().
When the apache conf file was being written in do_set(), it was
avoidable by e.g. update_sapi(). That could prevent apache2 from
restarting. Since do_set() calls set_sapi() anyway, we just move
the conf file writing to the end of set_sapi().
-rw-r--r-- | src/php.eselect.in.in | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/php.eselect.in.in b/src/php.eselect.in.in index 603dced..8e25f96 100644 --- a/src/php.eselect.in.in +++ b/src/php.eselect.in.in @@ -461,6 +461,17 @@ set_sapi() { "${link_dir}/${link_name}" || \ die -q "failed to create active ${link_name} symlink" done + + # The call to write_mod_php_conf() in particular needs to take + # place here, in set_sapi(), since otherwise it can get skipped by + # e.g. the update_sapi() function. + if [[ "${sapi}" == "apache2" ]]; then + apache2_php5_config_check + write_mod_php_conf "${target_name}" + 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 } @@ -508,14 +519,6 @@ do_set() { 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 } |