diff --git a/README.md b/README.md index a3a34836..c93afa7a 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,10 @@ Features: This version of carddav2fb is a forked version from carlos22 (https://github.com/carlos22/carddav2fb) with certain updates applied which had been published at http://www.ip-phone-forum.de/showthread.php?t=267477. In addition to being compatible to newer FRITZ!OS versions it also features a bunch of bug fixes. +## Requirements + +PHP version 5.3.6 or higher is required. + ## Installation Checkout the carddav2fb sources including its related subprojects using the following command: diff --git a/carddav2fb.php b/carddav2fb.php index 7aa79aa0..3231d900 100644 --- a/carddav2fb.php +++ b/carddav2fb.php @@ -23,6 +23,13 @@ error_reporting(E_ALL); setlocale(LC_ALL, 'de_DE.UTF8'); +$php_min_version = '5.3.6'; + +if (version_compare(PHP_VERSION, $php_min_version) < 0) { + print 'ERROR: PHP version '.$php_min_version.' is required. Found version: ' . PHP_VERSION . PHP_EOL; + exit(1); +} + require_once('lib/CardDAV-PHP/carddav.php'); require_once('lib/vCard-parser/vCard.php'); require_once('lib/fritzbox_api_php/fritzbox_api.class.php');