adds some minor formatting and debugging improvements
authorPhilipp Schüle <p.schuele@metaways.de>
Tue, 26 Aug 2014 10:47:46 +0000 (12:47 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 4 Sep 2014 09:26:46 +0000 (11:26 +0200)
Change-Id: Iebc4534dd8b972c7796d042b1cfc80e13fcb89fb
Reviewed-on: http://gerrit.tine20.com/customers/1042
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Calendar/Import/CalDav/Client.php
tine20/Tinebase/Import/CalDav/Client.php

index 08150f8..91dca6d 100644 (file)
@@ -95,9 +95,11 @@ class Calendar_Import_CalDav_Client extends Tinebase_Import_CalDav_Client
         }
         
         foreach ($result as $uri => $response) {
-            if (isset($response['{DAV:}resourcetype']) && isset($response['{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set']) && 
+            if (isset($response['{DAV:}resourcetype']) &&
+                    isset($response['{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set']) && 
                     $response['{DAV:}resourcetype']->is('{urn:ietf:params:xml:ns:caldav}calendar') &&
-                    in_array($this->component, $response['{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set']->getValue())) {
+                    in_array($this->component, $response['{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set']->getValue())
+            ) {
                 $this->calendars[$uri]['acl'] = $response['{DAV:}acl'];
                 $this->calendars[$uri]['displayname'] = $response['{DAV:}displayname'];
                 $this->decorator->processAdditionalCalendarProperties($this->calendars[$uri], $response);
index f87a5ef..44f2e01 100644 (file)
@@ -252,13 +252,18 @@ class Tinebase_Import_CalDav_Client extends \Sabre\DAV\Client
         //fputs($this->requestLogFH, $method.' '.$uri."\n".$body."\n".$depth."\n".$response['body']."\n\n\n\n\n\n\n", 10000000);
         
         if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__
-                . ' request: ' . $body . ' response: ' . print_r($response, true));
+                . ' Uri: ' . $uri . ' | request: ' . $body . ' | response: ' . print_r($response, true));
         
         // If depth was 0, we only return the top item
         if ($depth===0) {
             reset($result);
             $result = current($result);
-            return isset($result[200])?$result[200]:array();
+            $result = isset($result[200])?$result[200]:array();
+            
+            if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__
+                    . ' Result (depth 0): ' . var_export($result, true));
+            
+            return $result;
         }
         
         $newResult = array();
@@ -266,6 +271,9 @@ class Tinebase_Import_CalDav_Client extends \Sabre\DAV\Client
         {
             $newResult[$href] = isset($statusList[200])?$statusList[200]:array();
         }
+
+        if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__
+                . ' Result: ' . var_export($newResult, true));
         
         return $newResult;
     }