- clear php-fcgi-starter directories so no old files for non-existing domains are on the filesystem, fixes #367
This commit is contained in:
@@ -75,8 +75,7 @@ while($row = $db->fetch_array($result_tasks))
|
|||||||
$awstatsclean['fh'] = fopen($awstatsclean['fullentry'], 'r');
|
$awstatsclean['fh'] = fopen($awstatsclean['fullentry'], 'r');
|
||||||
$awstatsclean['headerRead'] = fgets($awstatsclean['fh'], strlen($awstatsclean['header'])+1);
|
$awstatsclean['headerRead'] = fgets($awstatsclean['fh'], strlen($awstatsclean['header'])+1);
|
||||||
fclose($awstatsclean['fh']);
|
fclose($awstatsclean['fh']);
|
||||||
if($awstatsclean['headerRead'] == $awstatsclean['header'] || $awstatsclean['headerRead'] ==
|
if($awstatsclean['headerRead'] == $awstatsclean['header'] || $awstatsclean['headerRead'] == $awstatsclean['headerold']) {
|
||||||
$awstatsclean['headerold']) {
|
|
||||||
$cronlog->logAction(CRON_ACTION, LOG_INFO, "Removing awstats configuration ".$awstatsclean['fullentry']." for re-creation");
|
$cronlog->logAction(CRON_ACTION, LOG_INFO, "Removing awstats configuration ".$awstatsclean['fullentry']." for re-creation");
|
||||||
@unlink($awstatsclean['fullentry']);
|
@unlink($awstatsclean['fullentry']);
|
||||||
}
|
}
|
||||||
@@ -91,6 +90,34 @@ $awstatsclean['headerold']) {
|
|||||||
}
|
}
|
||||||
//end dhr
|
//end dhr
|
||||||
|
|
||||||
|
// clear fcgid - starter files prior to re-creation to keep it clean, #367
|
||||||
|
if ($settings['system']['mod_fcgid'] == '1')
|
||||||
|
{
|
||||||
|
$configdir = makeCorrectDir($settings['system']['mod_fcgid_configdir']);
|
||||||
|
|
||||||
|
if (is_dir($configdir))
|
||||||
|
{
|
||||||
|
$its = new RecursiveIteratorIterator(
|
||||||
|
new RecursiveDirectoryIterator($configdir)
|
||||||
|
);
|
||||||
|
|
||||||
|
// iterate through all subdirs,
|
||||||
|
// look for php-fcgi-starter files
|
||||||
|
// and take immutable-flag away from them
|
||||||
|
// so we can delete them :)
|
||||||
|
foreach ($its as $fullFileName => $it )
|
||||||
|
{
|
||||||
|
if ($it->isFile() && $it->getFilename() == 'php-fcgi-starter')
|
||||||
|
{
|
||||||
|
removeImmutable($its->getPathname());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// now get rid of old stuff
|
||||||
|
//(but append /* so we don't delete the directory)
|
||||||
|
safe_exec('rm -rf '. escapeshellarg(makeCorrectFile($configdir.'/*')));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(!isset($webserver))
|
if(!isset($webserver))
|
||||||
{
|
{
|
||||||
if($settings['system']['webserver'] == "apache2")
|
if($settings['system']['webserver'] == "apache2")
|
||||||
|
|||||||
Reference in New Issue
Block a user