Commit 59ceed09 authored by Sebastian Kummer's avatar Sebastian Kummer

Merge branch 'develop' of https://stash.z-hub.io/scm/zp/z-push into...

Merge branch 'develop' of https://stash.z-hub.io/scm/zp/z-push into feature/ZP-832-detect-folder-changes-faster
parents 8142d73c 593dc404
...@@ -850,11 +850,11 @@ class BackendCardDAV extends BackendDiff implements ISearchProvider { ...@@ -850,11 +850,11 @@ class BackendCardDAV extends BackendDiff implements ISearchProvider {
else { else {
$items[$rc][SYNC_GAL_LASTNAME] = ""; $items[$rc][SYNC_GAL_LASTNAME] = "";
} }
if (isset($contact->business2phonenumber)) { if (isset($contact->businessphonenumber)) {
$items[$rc][SYNC_GAL_PHONE] = $contact->business2phonenumber; $items[$rc][SYNC_GAL_PHONE] = $contact->businessphonenumber;
} }
if (isset($contact->home2phonenumber)) { if (isset($contact->homephonenumber)) {
$items[$rc][SYNC_GAL_HOMEPHONE] = $contact->home2phonenumber; $items[$rc][SYNC_GAL_HOMEPHONE] = $contact->homephonenumber;
} }
if (isset($contact->mobilephonenumber)) { if (isset($contact->mobilephonenumber)) {
$items[$rc][SYNC_GAL_MOBILEPHONE] = $contact->mobilephonenumber; $items[$rc][SYNC_GAL_MOBILEPHONE] = $contact->mobilephonenumber;
......
...@@ -533,21 +533,9 @@ class BackendCombined extends Backend implements ISearchProvider { ...@@ -533,21 +533,9 @@ class BackendCombined extends Backend implements ISearchProvider {
$pos = strpos($folderid, $this->config['delimiter']); $pos = strpos($folderid, $this->config['delimiter']);
if($pos === false) if($pos === false)
return false; return false;
return substr($folderid,0,$pos); return substr($folderid, 0, $pos);
} }
/**
* Returns the BackendCombined as it implements the ISearchProvider interface
* This could be overwritten by the global configuration
*
* @access public
* @return object Implementation of ISearchProvider
*/
public function GetSearchProvider() {
return $this;
}
/** /**
* Indicates which AS version is supported by the backend. * Indicates which AS version is supported by the backend.
* Return the lowest version supported by the backends used. * Return the lowest version supported by the backends used.
...@@ -566,6 +554,17 @@ class BackendCombined extends Backend implements ISearchProvider { ...@@ -566,6 +554,17 @@ class BackendCombined extends Backend implements ISearchProvider {
return $version; return $version;
} }
/**
* Returns the BackendCombined as it implements the ISearchProvider interface
* This could be overwritten by the global configuration
*
* @access public
* @return object Implementation of ISearchProvider
*/
public function GetSearchProvider() {
return $this;
}
/*----------------------------------------------------------------------------------------- /*-----------------------------------------------------------------------------------------
-- ISearchProvider -- ISearchProvider
...@@ -688,5 +687,4 @@ class BackendCombined extends Backend implements ISearchProvider { ...@@ -688,5 +687,4 @@ class BackendCombined extends Backend implements ISearchProvider {
return false; return false;
} }
} }
...@@ -173,7 +173,7 @@ class ExportChangesCombined implements IExportChanges { ...@@ -173,7 +173,7 @@ class ExportChangesCombined implements IExportChanges {
public function InitializeExporter(&$importer) { public function InitializeExporter(&$importer) {
ZLog::Write(LOGLEVEL_DEBUG, "ExportChangesCombined->InitializeExporter(...)"); ZLog::Write(LOGLEVEL_DEBUG, "ExportChangesCombined->InitializeExporter(...)");
foreach ($this->exporters as $i => $e) { foreach ($this->exporters as $i => $e) {
if(!isset($this->_importwraps[$i])){ if(!isset($this->importwraps[$i])){
$this->importwraps[$i] = new ImportHierarchyChangesCombinedWrap($i, $this->backend, $importer); $this->importwraps[$i] = new ImportHierarchyChangesCombinedWrap($i, $this->backend, $importer);
} }
$e->InitializeExporter($this->importwraps[$i]); $e->InitializeExporter($this->importwraps[$i]);
......
...@@ -169,7 +169,7 @@ class ImportChangesCombined implements IImportChanges { ...@@ -169,7 +169,7 @@ class ImportChangesCombined implements IImportChanges {
public function ImportFolderChange($folder) { public function ImportFolderChange($folder) {
$id = $folder->serverid; $id = $folder->serverid;
$parent = $folder->parentid; $parent = $folder->parentid;
ZLog::Write(LOGLEVEL_DEBUG, "ImportChangesCombined->ImportFolderChange() ".print_r($folder, 1)); ZLog::Write(LOGLEVEL_DEBUG, sprintf("ImportChangesCombined->ImportFolderChange() id: '%s', parent: '%s'", $id, $parent));
if($parent == '0') { if($parent == '0') {
if($id) { if($id) {
$backendid = $this->backend->GetBackendId($id); $backendid = $this->backend->GetBackendId($id);
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
/*********************************************** /***********************************************
* File : config.php * File : config.php
* Project : Z-Push * Project : Z-Push
* Descr : VCardDir backend configuration file * Descr : Zarafa backend configuration file
* *
* Created : 27.11.2012 * Created : 27.11.2012
* *
* Copyright 2007 - 2013 Zarafa Deutschland GmbH * Copyright 2007 - 2016 Zarafa Deutschland GmbH
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3, * it under the terms of the GNU Affero General Public License, version 3,
...@@ -46,4 +46,4 @@ ...@@ -46,4 +46,4 @@
// ************************ // ************************
// Defines the server to which we want to connect // Defines the server to which we want to connect
define('MAPI_SERVER', 'file:///var/run/zarafa'); define('MAPI_SERVER', 'http://127.0.0.1:236/zarafa');
...@@ -165,11 +165,6 @@ ...@@ -165,11 +165,6 @@
// a higher value if you have a high load on the server. // a higher value if you have a high load on the server.
define('PING_INTERVAL', 30); define('PING_INTERVAL', 30);
// Interval in seconds to force a re-check of potentially missed notifications when
// using a changes sink. Default are 300 seconds (every 5 min).
// This can also be disabled by setting it to false
define('SINK_FORCERECHECK', 300);
// Set the fileas (save as) order for contacts in the webaccess/webapp/outlook. // Set the fileas (save as) order for contacts in the webaccess/webapp/outlook.
// It will only affect new/modified contacts on the mobile which then are synced to the server. // It will only affect new/modified contacts on the mobile which then are synced to the server.
// Possible values are: // Possible values are:
......
...@@ -466,7 +466,7 @@ class SyncCollections implements Iterator { ...@@ -466,7 +466,7 @@ class SyncCollections implements Iterator {
// use changes sink where available // use changes sink where available
$changesSink = false; $changesSink = false;
$forceRealExport = 0;
// do not create changessink if there are no folders // do not create changessink if there are no folders
if (!empty($classes) && ZPush::GetBackend()->HasChangesSink()) { if (!empty($classes) && ZPush::GetBackend()->HasChangesSink()) {
$changesSink = true; $changesSink = true;
...@@ -527,16 +527,6 @@ class SyncCollections implements Iterator { ...@@ -527,16 +527,6 @@ class SyncCollections implements Iterator {
// Use changes sink if available // Use changes sink if available
if ($changesSink) { if ($changesSink) {
// in some occasions we do realize a full export to see if there are pending changes
// every 5 minutes this is also done to see if there were "missed" notifications
if (SINK_FORCERECHECK !== false && $forceRealExport+SINK_FORCERECHECK <= $now) {
if ($this->CountChanges($onlyPingable)) {
ZLog::Write(LOGLEVEL_DEBUG, "SyncCollections->CheckForChanges(): Using ChangesSink but found relevant changes on regular export");
return true;
}
$forceRealExport = $now;
}
ZPush::GetTopCollector()->AnnounceInformation(sprintf("Sink %d/%ds on %s", ($now-$started), $lifetime, $checkClasses)); ZPush::GetTopCollector()->AnnounceInformation(sprintf("Sink %d/%ds on %s", ($now-$started), $lifetime, $checkClasses));
$notifications = ZPush::GetBackend()->ChangesSink($nextInterval); $notifications = ZPush::GetBackend()->ChangesSink($nextInterval);
......
...@@ -301,12 +301,6 @@ class ZPush { ...@@ -301,12 +301,6 @@ class ZPush {
if (!is_array($specialLogUsers)) if (!is_array($specialLogUsers))
throw new FatalMisconfigurationException("The WBXML log users is not an array."); throw new FatalMisconfigurationException("The WBXML log users is not an array.");
if (!defined('SINK_FORCERECHECK')) {
define('SINK_FORCERECHECK', 300);
}
else if (SINK_FORCERECHECK !== false && (!is_int(SINK_FORCERECHECK) || SINK_FORCERECHECK < 1))
throw new FatalMisconfigurationException("The SINK_FORCERECHECK value must be 'false' or a number higher than 0.");
if (!defined('SYNC_CONTACTS_MAXPICTURESIZE')) { if (!defined('SYNC_CONTACTS_MAXPICTURESIZE')) {
define('SYNC_CONTACTS_MAXPICTURESIZE', 49152); define('SYNC_CONTACTS_MAXPICTURESIZE', 49152);
} }
......
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