diff --git a/phpini/phpini-lib.pl b/phpini/phpini-lib.pl index 05e05d60e..1d47de32a 100755 --- a/phpini/phpini-lib.pl +++ b/phpini/phpini-lib.pl @@ -408,6 +408,30 @@ if ($phpver =~ /(^|\n)PHP\s+([\d\.]+)/) { return undef; } +# get_php_ini_bootup(file) +# Given an ini file, return the bootup action for it +sub get_php_ini_bootup +{ +my ($file) = @_; +return undef if (!&foreign_installed("init")); +&foreign_require("init"); +if ($file =~ /php(\d{1,2})/ || $file =~ /php\/(\d\.\d)/) { + my $shortver = $1; + my $nodot = $shortver; + $nodot =~ s/\.//; + foreach my $init ("php${shortver}-fpm", + "php-fpm${shortver}", + "rh-php${nodot}-php-fpm", + "php${nodot}-php-fpm") { + my $st = &init::action_status($init); + if ($st) { + return $init; + } + } + } +return undef; +} + # php_version_test_against(version, comparison-operator, [file|version-string]) # Given PHP version test if matches with currently installed or given # Returns 1 if given version matches to the given and/or installed, 0 if not matches @@ -498,24 +522,11 @@ if (&foreign_installed("apache")) { &reset_environment(); } } -if ($file && -r $file && &foreign_check("virtual-server")) { - # Looks like FPM format ... maybe a pool restart is needed - &foreign_require("virtual-server"); - if (defined(&virtual_server::restart_php_fpm_server)) { - my $conf; - my $filedir = $file; - $filedir =~ s/\/[^\/]+$//; - my @conf = grep { &is_under_directory($_->{'dir'}, $filedir) } - &virtual_server::list_php_fpm_configs(); - if (@conf) { - $conf = &virtual_server::get_php_fpm_config( - $conf[0]->{'shortversion'}); - } - &virtual_server::push_all_print(); - &virtual_server::set_all_null_print(); - &virtual_server::restart_php_fpm_server($conf); - &virtual_server::pop_all_print(); - } +my $init = &get_php_ini_bootup($file); +if ($init) { + # There's an associated FPM bootup action + &foreign_require("init"); + &init::reload_action($init); } if ($file && &get_config_fmt($file) eq "ini" && &foreign_installed("virtual-server") &&