Skip to content

Commit c9145d3

Browse files
author
Webslice
committed
Reconfigure incron if the PHP version changes
1 parent 52019c5 commit c9145d3

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

server/plugins-available/z_php_fpm_incron_reload_plugin.inc.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ function incronInsert($eventName, $data) {
4545
function incronUpdate($eventName, $data) {
4646
global $app;
4747

48-
if ($data['new']['document_root'] === $data['old']['document_root']) {
49-
$app->log('Document root unchanged. Not updating incron configuration.', LOGLEVEL_DEBUG);
48+
if ($this->documentRootUnchanged($data) && $this->phpVersionUnchanged($data)) {
49+
$app->log('Document root and PHP version unchanged. Not updating incron configuration.', LOGLEVEL_DEBUG);
5050

5151
return;
5252
}
@@ -59,6 +59,16 @@ function incronDelete($eventName, $data) {
5959
$this->teardown($data['old']);
6060
}
6161

62+
private function documentRootUnchanged($data)
63+
{
64+
return $data['new']['document_root'] === $data['old']['document_root'];
65+
}
66+
67+
private function phpVersionUnchanged($data)
68+
{
69+
return $data['new']['fastcgi_php_version'] === $data['old']['fastcgi_php_version'];
70+
}
71+
6272
private function setup($data)
6373
{
6474
$triggerFile = $this->getTriggerFilePath($data['document_root']);

0 commit comments

Comments
 (0)