From 0038552955138cdfa192ba390af419b3a9f13025 Mon Sep 17 00:00:00 2001 From: "Florian Aders (EleRas)" Date: Mon, 27 Feb 2012 19:43:56 +0100 Subject: [PATCH] Remove php-fpm-specific configuration (files) correctly, patch by Slydder, fixes #1022, fixes #914 Signed-off-by: Florian Aders (EleRas) --- .../jobs/cron_tasks.inc.http.10.apache.php | 22 +++++++++++++++++++ .../jobs/cron_tasks.inc.http.20.lighttpd.php | 22 +++++++++++++++++++ scripts/jobs/cron_tasks.inc.http.30.nginx.php | 22 +++++++++++++++++++ 3 files changed, 66 insertions(+) diff --git a/scripts/jobs/cron_tasks.inc.http.10.apache.php b/scripts/jobs/cron_tasks.inc.http.10.apache.php index c96f0ee3..0e3b09e1 100644 --- a/scripts/jobs/cron_tasks.inc.http.10.apache.php +++ b/scripts/jobs/cron_tasks.inc.http.10.apache.php @@ -1347,6 +1347,28 @@ class apache } } } + if($this->settings['phpfpm']['enabled'] == '1') + { + foreach($this->known_vhostfilenames as $vhostfilename){ + $known_phpfpm_files[]=preg_replace('/^(05|10|20|21|22|30|50|51)_(froxlor|syscp)_(dirfix|ipandport|normal_vhost|wildcard_vhost|ssl_vhost)_/', '', $vhostfilename); + } + + $configdir = $this->settings['phpfpm']['configdir']; + $phpfpm_file_dirhandle = opendir($this->settings['phpfpm']['configdir']); + + while(false !== ($phpfpm_filename = readdir($phpfpm_file_dirhandle))) + { + if($phpfpm_filename != '.' + && $phpfpm_filename != '..' + && !in_array($phpfpm_filename, $known_phpfpm_files) + && file_exists(makeCorrectFile($this->settings['phpfpm']['configdir'] . '/' . $phpfpm_filename))) + { + fwrite($this->debugHandler, ' apache::wipeOutOldVhostConfigs: unlinking PHP5-FPM ' . $phpfpm_filename . "\n"); + $this->logger->logAction(CRON_ACTION, LOG_NOTICE, 'unlinking ' . $phpfpm_filename); + unlink(makeCorrectFile($this->settings['phpfpm']['configdir'] . '/' . $phpfpm_filename)); + } + } + } } /* diff --git a/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php b/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php index ea21ff24..18a3506b 100644 --- a/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php +++ b/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php @@ -1030,6 +1030,28 @@ class lighttpd } } } + if($this->settings['phpfpm']['enabled'] == '1') + { + foreach($this->known_vhostfilenames as $vhostfilename){ + $known_phpfpm_files[]=preg_replace('/^(05|10|20|21|22|30|50|51)_(froxlor|syscp)_(dirfix|ipandport|normal_vhost|wildcard_vhost|ssl_vhost)_/', '', $vhostfilename); + } + + $configdir = $this->settings['phpfpm']['configdir']; + $phpfpm_file_dirhandle = opendir($this->settings['phpfpm']['configdir']); + + while(false !== ($phpfpm_filename = readdir($phpfpm_file_dirhandle))) + { + if($phpfpm_filename != '.' + && $phpfpm_filename != '..' + && !in_array($phpfpm_filename, $known_phpfpm_files) + && file_exists(makeCorrectFile($this->settings['phpfpm']['configdir'] . '/' . $phpfpm_filename))) + { + fwrite($this->debugHandler, ' lighttpd::wipeOutOldConfigs: unlinking PHP5-FPM ' . $phpfpm_filename . "\n"); + $this->logger->logAction(CRON_ACTION, LOG_NOTICE, 'unlinking ' . $phpfpm_filename); + unlink(makeCorrectFile($this->settings['phpfpm']['configdir'] . '/' . $phpfpm_filename)); + } + } + } } } diff --git a/scripts/jobs/cron_tasks.inc.http.30.nginx.php b/scripts/jobs/cron_tasks.inc.http.30.nginx.php index 17a7c9ee..596a304e 100644 --- a/scripts/jobs/cron_tasks.inc.http.30.nginx.php +++ b/scripts/jobs/cron_tasks.inc.http.30.nginx.php @@ -1038,6 +1038,28 @@ class nginx } } } + if($this->settings['phpfpm']['enabled'] == '1') + { + foreach($this->known_vhostfilenames as $vhostfilename){ + $known_phpfpm_files[]=preg_replace('/^(05|10|20|21|22|30|50|51)_(froxlor|syscp)_(dirfix|ipandport|normal_vhost|wildcard_vhost|ssl_vhost)_/', '', $vhostfilename); + } + + $configdir = $this->settings['phpfpm']['configdir']; + $phpfpm_file_dirhandle = opendir($this->settings['phpfpm']['configdir']); + + while(false !== ($phpfpm_filename = readdir($phpfpm_file_dirhandle))) + { + if($phpfpm_filename != '.' + && $phpfpm_filename != '..' + && !in_array($phpfpm_filename, $known_phpfpm_files) + && file_exists(makeCorrectFile($this->settings['phpfpm']['configdir'] . '/' . $phpfpm_filename))) + { + fwrite($this->debugHandler, ' nginx::wipeOutOldVhostConfigs: unlinking PHP5-FPM ' . $phpfpm_filename . "\n"); + $this->logger->logAction(CRON_ACTION, LOG_NOTICE, 'unlinking ' . $phpfpm_filename); + unlink(makeCorrectFile($this->settings['phpfpm']['configdir'] . '/' . $phpfpm_filename)); + } + } + } } /*