Commit 3e21a96f authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #400 in ZP/z-push from...

Merge pull request #400 in ZP/z-push from feature/ZP-1080-additional-log-messages-in-webserviceinfo--listuserfolders to develop

* commit '7e9378bd':
  ZP-1080 Added log output when ignoring a folder from the fetched data.
  ZP-1080 Add debug message about the total number of folders processed in a Sync request.
  ZP-1080 Additional debug messages when processing KopanoBackend->GetHierarchy().
parents 9dca8635 7e9378bd
...@@ -353,6 +353,7 @@ class BackendKopano implements IBackend, ISearchProvider { ...@@ -353,6 +353,7 @@ class BackendKopano implements IBackend, ISearchProvider {
$hierarchy = mapi_folder_gethierarchytable($rootfolder, CONVENIENT_DEPTH); $hierarchy = mapi_folder_gethierarchytable($rootfolder, CONVENIENT_DEPTH);
$rows = mapi_table_queryallrows($hierarchy, array(PR_DISPLAY_NAME, PR_PARENT_ENTRYID, PR_ENTRYID, PR_SOURCE_KEY, PR_PARENT_SOURCE_KEY, PR_CONTAINER_CLASS, PR_ATTR_HIDDEN, PR_EXTENDED_FOLDER_FLAGS, PR_FOLDER_TYPE)); $rows = mapi_table_queryallrows($hierarchy, array(PR_DISPLAY_NAME, PR_PARENT_ENTRYID, PR_ENTRYID, PR_SOURCE_KEY, PR_PARENT_SOURCE_KEY, PR_CONTAINER_CLASS, PR_ATTR_HIDDEN, PR_EXTENDED_FOLDER_FLAGS, PR_FOLDER_TYPE));
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendKopano->GetHierarchy(): fetched %d folders from MAPI", count($rows)));
foreach ($rows as $row) { foreach ($rows as $row) {
// do not display hidden and search folders // do not display hidden and search folders
...@@ -360,14 +361,19 @@ class BackendKopano implements IBackend, ISearchProvider { ...@@ -360,14 +361,19 @@ class BackendKopano implements IBackend, ISearchProvider {
(isset($row[PR_FOLDER_TYPE]) && $row[PR_FOLDER_TYPE] == FOLDER_SEARCH) || (isset($row[PR_FOLDER_TYPE]) && $row[PR_FOLDER_TYPE] == FOLDER_SEARCH) ||
// for SYSTEM user $row[PR_PARENT_SOURCE_KEY] == $rootfolderprops[PR_SOURCE_KEY] is true, but we need those folders // for SYSTEM user $row[PR_PARENT_SOURCE_KEY] == $rootfolderprops[PR_SOURCE_KEY] is true, but we need those folders
(isset($row[PR_PARENT_SOURCE_KEY]) && $row[PR_PARENT_SOURCE_KEY] == $rootfolderprops[PR_SOURCE_KEY] && strtoupper($this->storeName) != "SYSTEM")) { (isset($row[PR_PARENT_SOURCE_KEY]) && $row[PR_PARENT_SOURCE_KEY] == $rootfolderprops[PR_SOURCE_KEY] && strtoupper($this->storeName) != "SYSTEM")) {
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendKopano->GetHierarchy(): ignoring folder '%s' as it's a hidden/search/root folder", (isset($row[PR_DISPLAY_NAME]) ? $row[PR_DISPLAY_NAME] : "unknown")));
continue; continue;
} }
$folder = $mapiprovider->GetFolder($row); $folder = $mapiprovider->GetFolder($row);
if ($folder) { if ($folder) {
$folders[] = $folder; $folders[] = $folder;
} }
else {
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendKopano->GetHierarchy(): ignoring folder '%s' as MAPIProvider->GetFolder() did not return a SyncFolder object", (isset($row[PR_DISPLAY_NAME]) ? $row[PR_DISPLAY_NAME] : "unknown")));
}
} }
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendKopano->GetHierarchy(): processed %d folders, starting parent remap", count($folders)));
// reloop the folders to make sure all parentids are mapped correctly // reloop the folders to make sure all parentids are mapped correctly
$dm = ZPush::GetDeviceManager(); $dm = ZPush::GetDeviceManager();
foreach ($folders as $folder) { foreach ($folders as $folder) {
......
...@@ -916,6 +916,7 @@ class Sync extends RequestProcessor { ...@@ -916,6 +916,7 @@ class Sync extends RequestProcessor {
// final top announcement for a multi-folder sync // final top announcement for a multi-folder sync
if ($sc->GetCollectionCount() > 1) { if ($sc->GetCollectionCount() > 1) {
self::$topCollector->AnnounceInformation($this->getMultiFolderInfoLine($sc->GetCollectionCount()), true); self::$topCollector->AnnounceInformation($this->getMultiFolderInfoLine($sc->GetCollectionCount()), true);
ZLog::Write(LOGLEVEL_DEBUG, sprintf("HandleSync: Processed %d folders", $sc->GetCollectionCount()));
} }
return true; return true;
......
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