Commit 1e371404 authored by Manfred Kutas's avatar Manfred Kutas

ZP-881 Define ZCP server location for listfolders depending on ZCP

version.

Released under the Affero GNU General Public License (AGPL) version 3.
parent ddf54b20
......@@ -46,7 +46,12 @@
************************************************/
define("PHP_MAPI_PATH", "/usr/share/php/mapi/");
define('MAPI_SERVER', 'file:///var/run/zarafa');
if (CheckMapiExtVersion('7.2.0')) {
define('MAPI_SERVER', 'file:///var/run/zarafad/server.sock');
}
else {
define('MAPI_SERVER', 'file:///var/run/zarafa');
}
define('SSLCERT_FILE', null);
define('SSLCERT_PASS', null);
......@@ -216,3 +221,21 @@ function listfolders_getlist ($adminStore, $session, $user) {
}
}
}
function CheckMapiExtVersion($version = "") {
// compare build number if requested
if (preg_match('/^\d+$/', $version) && strlen($version) > 3) {
$vs = preg_split('/-/', phpversion("mapi"));
return ($version <= $vs[1]);
}
if (extension_loaded("mapi")){
if (version_compare(phpversion("mapi"), $version) == -1){
return false;
}
}
else
return false;
return true;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment