mirror of
https://git.proxmox.com/git/dab
synced 2025-10-04 11:45:07 +00:00
php task: restore compat with very old releases using php5 again
note that both, php5 and the affected releases are EOL since years, but as we do not want to drop the historic releases completely just yet, restore the task functionality. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
985f0aa823
commit
cd85c459f7
24
DAB.pm
24
DAB.pm
@ -1889,15 +1889,35 @@ sub task_php {
|
||||
|
||||
my $memlimit = $opts->{memlimit};
|
||||
my $rootdir = $self->{rootfs};
|
||||
my $suite = $self->{config}->{suite};
|
||||
|
||||
my $required = $self->compute_required([qw(php php-cli libapache2-mod-php php-gd)]);
|
||||
my $base_set = [qw(php-cli libapache2-mod-php php-gd)];
|
||||
if ($suite =~ /(?:squeeze|wheezy|jessie)$/) {
|
||||
$self->logmsg("WARN: using EOL php release on EOL suite");
|
||||
$base_set = [qw(php5 php5-cli libapache2-mod-php5 php5-gd)];
|
||||
}
|
||||
my $required = $self->compute_required($base_set);
|
||||
|
||||
$self->cache_packages ($required);
|
||||
|
||||
$self->ve_dpkg ('install', @$required);
|
||||
|
||||
if ($memlimit) {
|
||||
$self->run_command ("sed -e 's/^\\s*memory_limit\\s*=.*;/memory_limit = ${memlimit}M;/' -i $rootdir/etc/php5/apache2/php.ini");
|
||||
my $sed_cmd = ['sed', '-e', "s/^\\s*memory_limit\\s*=.*;/memory_limit = ${memlimit}M;/", '-i'];
|
||||
if ($suite =~ /(?:squeeze|wheezy|jessie)$/) {
|
||||
push @$sed_cmd, "$rootdir/etc/php5/apache2/php.ini";
|
||||
} else {
|
||||
my $found = 0;
|
||||
for my $fn (glob("'${rootdir}/etc/php/*/apache2/php.ini'")) {
|
||||
push @$sed_cmd, "$rootdir/$fn";
|
||||
$found = 1;
|
||||
}
|
||||
if (!$found) {
|
||||
warn "WARN: did not found any php.ini to set the memlimit!\n";
|
||||
return;
|
||||
}
|
||||
}
|
||||
$self->run_command($sed_cmd);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user