PHP FPM integration on SME Server. Let you run several versions of PHP (using SCL from Remi's repo) at the same time
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
893 B
36 lines
893 B
#!/usr/bin/perl -w
|
|
|
|
use strict;
|
|
use warnings;
|
|
use esmith::AccountsDB;
|
|
use File::Path qw(make_path remove_tree);
|
|
|
|
my $a = esmith::AccountsDB->open_ro || die "Couldn't open the accounts database\n";
|
|
|
|
my $event = shift;
|
|
my $pool = shift;
|
|
|
|
die "Misssing pool name argument" unless $pool;
|
|
|
|
my $acc = $a->get($pool);
|
|
|
|
die "$pool not found in the account database\n" unless $acc;
|
|
|
|
my $dyn = $acc->prop('DynamicContent') || 'disabled';
|
|
|
|
if ($dyn =~ m/^enabled|on|1|yes$/ && $event ne 'share-delete'){
|
|
my @dirs = ( "/var/log/php/$pool",
|
|
"/var/lib/php/$pool/session",
|
|
"/var/lib/php/$pool/wsdlcache",
|
|
"/var/lib/php/$pool/opcache",
|
|
"/var/lib/php/$pool/tmp" );
|
|
make_path( @dirs, {
|
|
owner => 'root',
|
|
group => 'www'
|
|
});
|
|
chmod 0770, @dirs;
|
|
}
|
|
else{
|
|
remove_tree( ( "/var/log/php/$pool",
|
|
" /var/lib/php/$pool/" ) );
|
|
}
|
|
|