Handle case where FPM config contains no PHP options yet https://forum.virtualmin.com/t/pfp-fpm-default-configuration/127002

This commit is contained in:
Jamie Cameron
2024-05-29 16:26:48 -07:00
parent 6d89004446
commit d061a190ac

View File

@ -162,6 +162,10 @@ for(my $i=0; $i<@old || $i<@values; $i++) {
else {
# Just add at the end
$lastfile = @$conf ? $conf->[0]->{'file'} : undef;
if (!$lastfile) {
my @allfiles = keys %get_config_cache;
$lastfile = $allfiles[0] if (@allfiles == 1);
}
$lastfile || &error("Don't know which file to add to");
$lref = &read_file_lines_as_user($lastfile);
$lastline = scalar(@$lref);