Private GIT

Skip to content
Snippets Groups Projects
Commit 1912a260 authored by Miha Petkovsek's avatar Miha Petkovsek
Browse files

Dropping php 5.3 support with optional override in config.php #1732

parent 9c64ee26
No related branches found
No related tags found
No related merge requests found
...@@ -39,6 +39,7 @@ $db['tmptable_engine_type'] = "MEMORY"; ...@@ -39,6 +39,7 @@ $db['tmptable_engine_type'] = "MEMORY";
/** /**
* Mail sending and other parameters for pingCheck and DiscoveryCheck scripts * Mail sending and other parameters for pingCheck and DiscoveryCheck scripts
******************************/ ******************************/
# pingCheck.php script parameters # pingCheck.php script parameters
$config['ping_check_send_mail'] = true; // true/false, send or not mail on ping check $config['ping_check_send_mail'] = true; // true/false, send or not mail on ping check
$config['ping_check_method'] = false; // false/ping/pear/fping, reset scan method $config['ping_check_method'] = false; // false/ping/pear/fping, reset scan method
...@@ -62,6 +63,14 @@ $config['resolve_verbose'] = true; // verbose response - print ...@@ -62,6 +63,14 @@ $config['resolve_verbose'] = true; // verbose response - print
$debugging = false; $debugging = false;
/**
* Allow older version
*
* allow version < 5.4 with limited functionality
******************************/
$allow_older_version = false;
/** /**
* manual set session name for auth * manual set session name for auth
* increases security * increases security
......
...@@ -45,15 +45,8 @@ if ((@include_once 'PEAR.php') != true) { ...@@ -45,15 +45,8 @@ if ((@include_once 'PEAR.php') != true) {
$missingExt[] = "php PEAR support"; $missingExt[] = "php PEAR support";
} }
# if db ssl = true check version
if (@$db['ssl']==true) {
if (phpversion() < "5.3.7") {
$missingExt[] = "For SSL MySQL php version 5.3.7 is required!";
}
}
# if any extension is missing print error and die! # if any extension is missing print error and die!
if (sizeof($missingExt) != 1) { if (sizeof($missingExt) != 1 || (phpversion() < "5.4" && $allow_older_version!==true)) {
/* remove dummy 0 line */ /* remove dummy 0 line */
unset($missingExt[0]); unset($missingExt[0]);
...@@ -72,7 +65,8 @@ if (sizeof($missingExt) != 1) { ...@@ -72,7 +65,8 @@ if (sizeof($missingExt) != 1) {
$error .= '</div>'; $error .= '</div>';
$error .= '</div></div>'; $error .= '</div></div>';
/* error */ /* Extensions error */
if(sizeof($missingExt)>0) {
$error .= "<div class='alert alert-danger' style='margin:auto;margin-top:20px;width:500px;'><strong>"._('The following required PHP extensions are missing').":</strong><br><hr>"; $error .= "<div class='alert alert-danger' style='margin:auto;margin-top:20px;width:500px;'><strong>"._('The following required PHP extensions are missing').":</strong><br><hr>";
$error .= '<ul>' . "\n"; $error .= '<ul>' . "\n";
foreach ($missingExt as $missing) { foreach ($missingExt as $missing) {
...@@ -80,10 +74,17 @@ if (sizeof($missingExt) != 1) { ...@@ -80,10 +74,17 @@ if (sizeof($missingExt) != 1) {
} }
$error .= '</ul><hr>' . "\n"; $error .= '</ul><hr>' . "\n";
$error .= _('Please recompile PHP to include missing extensions and restart Apache.') . "\n"; $error .= _('Please recompile PHP to include missing extensions and restart Apache.') . "\n";
}
/* php version error */
else {
$error .= "<div class='alert alert-danger' style='margin:auto;margin-top:20px;width:500px;'><strong>"._('Unsupported PHP version')."!</strong><br><hr>";
$error .= _('From release 1.3.2 on at least PHP version 5.4 is required!')."<br>"._('You can override this by setting $allow_older_version=true in config.php.')."<br>";
$error .= _("Detected PHP version: ").phpversion(). "<br><br>\n";
$error .= _("Last development version can be downloaded ")." <a href='https://github.com/phpipam/phpipam/tree/9ca731d475d5830ca421bac12da31d5023f02636' target='_blank'>here</a>.";
}
$error .= "</body>"; $error .= "</body>";
$error .= "</html>"; $error .= "</html>";
die($error); die($error);
} }
\ No newline at end of file
?>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment