mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-08-20 16:56:02 +00:00
Add PHP version check to setup.php
This commit is contained in:
parent
3bf44378fa
commit
d42c3dc186
@ -286,6 +286,19 @@ function check_davical_version() {
|
||||
return $result;
|
||||
}
|
||||
|
||||
function check_php_version() {
|
||||
global $c;
|
||||
|
||||
$result = new CheckResult(version_compare(phpversion(), $c->minimum_php_version, '>='));
|
||||
if ( ! $result->getOK() ) {
|
||||
$result->setDescription( sprintf(i18n('Minimum: %s, Currently: %s'), $c->minimum_php_version, phpversion()) );
|
||||
$result->setClass('dep_fail');
|
||||
} else {
|
||||
$result->setDescription( sprintf(i18n('Passed: %s'), phpversion() . ' >= ' . $c->minimum_php_version) );
|
||||
}
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
function check_awl_version() {
|
||||
global $c;
|
||||
@ -337,6 +350,7 @@ function build_dependencies_table( ) {
|
||||
|
||||
$dependencies = array(
|
||||
translate('Current DAViCal version ') => 'check_davical_version',
|
||||
translate('PHP version ') => 'check_php_version',
|
||||
translate('AWL Library version ') => 'check_awl_version',
|
||||
translate('PHP not using Apache Filter mode') => 'check_real_php',
|
||||
translate('PHP PDO module available') => 'check_pdo',
|
||||
|
||||
@ -308,6 +308,9 @@ if ( isset($c->version_string) && preg_match( '/(\d+)\.(\d+)\.(\d+)(.*)/', $c->v
|
||||
@header( sprintf('Server: %d.%d', $c->code_major, $c->code_minor) );
|
||||
}
|
||||
|
||||
// What is our minimum supported version of PHP?
|
||||
$c->minimum_php_version = '5.4.0';
|
||||
|
||||
/**
|
||||
* Force the domain name to what was in the configuration file
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user