summaryrefslogtreecommitdiff
path: root/src/snuffleupagus.c
diff options
context:
space:
mode:
authorBen Fuhrmannek2021-11-19 16:47:08 +0100
committerBen Fuhrmannek2021-11-19 16:47:08 +0100
commit0462573a7678468b19bc4865c75f7b82dbedbe03 (patch)
tree2300593bcde4ecf2af3ac315270736f9e18ae3fb /src/snuffleupagus.c
parentc447df6ce8964b2863a50f0f8027d9b234b7507f (diff)
added old php version check
Diffstat (limited to 'src/snuffleupagus.c')
-rw-r--r--src/snuffleupagus.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/snuffleupagus.c b/src/snuffleupagus.c
index c96a911..e3ecd72 100644
--- a/src/snuffleupagus.c
+++ b/src/snuffleupagus.c
@@ -276,6 +276,9 @@ static PHP_INI_MH(OnUpdateConfiguration) {
276 return FAILURE; 276 return FAILURE;
277 } 277 }
278 278
279 // set some defaults
280 SPCFG(show_old_php_warning) = true;
281
279 char *str = new_value->val; 282 char *str = new_value->val;
280 283
281 while (1) { 284 while (1) {
@@ -365,6 +368,16 @@ static PHP_INI_MH(OnUpdateConfiguration) {
365 (SPCFG(disabled_functions) && zend_hash_num_elements(SPCFG(disabled_functions))) || 368 (SPCFG(disabled_functions) && zend_hash_num_elements(SPCFG(disabled_functions))) ||
366 (SPCFG(disabled_functions) && zend_hash_num_elements(SPCFG(disabled_functions_ret))); 369 (SPCFG(disabled_functions) && zend_hash_num_elements(SPCFG(disabled_functions_ret)));
367 370
371 if (SPCFG(show_old_php_warning)) {
372 time_t ts = time(NULL);
373 sp_log_debug("foo");
374 if (PHP_VERSION_ID < 70300 ||
375 PHP_VERSION_ID < 70400 && ts >= (time_t)1638745200L ||
376 PHP_VERSION_ID < 80000 && ts >= (time_t)1669590000L ||
377 PHP_VERSION_ID < 80100 && ts >= (time_t)1700953200L) {
378 sp_log_warn("End-of-Life Check", "Your PHP version '" PHP_VERSION "' is not officially mainained anymore. Please upgrade as soon as possible.");
379 }
380 }
368 return SUCCESS; 381 return SUCCESS;
369} 382}
370 383