Author: ts
Date: Wed Sep 19 16:02:34 2007
New Revision: 6203

Log:
- Added parsing of UNLOCK request.

Added:
    trunk/Webdav/tests/clients/rfc/unlock/request/result.ser   (with props)
Modified:
    trunk/Webdav/src/transport.php

Modified: trunk/Webdav/src/transport.php
==============================================================================
--- trunk/Webdav/src/transport.php [iso-8859-1] (original)
+++ trunk/Webdav/src/transport.php [iso-8859-1] Wed Sep 19 16:02:34 2007
@@ -30,6 +30,7 @@
         'Destination' => 'HTTP_DESTINATION',
         'Overwrite'   => 'HTTP_OVERWRITE',
         'Timeout'     => 'HTTP_TIMEOUT',
+        'Lock-Token'  => 'HTTP_LOCK_TOKEN',
     );
 
     /**
@@ -58,6 +59,8 @@
                 return $this->parseDeleteRequest( $uri, $body );
             case 'LOCK':
                 return $this->parseLockRequest( $uri, $body );
+            case 'UNLOCK':
+                return $this->parseUnlockRequest( $uri, $body );
             default:
                 throw new ezcWebdavInvalidRequestMethodException(
                     $_SERVER['REQUEST_METHOD']
@@ -332,6 +335,32 @@
             ( $ownerElements->length > 0 
                 ? $ownerElements->item( 0 )->textContent
                 : null )
+        );
+
+        return $request;
+    }
+    
+    // UNLOCK
+
+    /**
+     * Parses the UNLOCK request and returns a request object.
+     * This method is responsible for parsing the UNLOCK request. It
+     * retrieves the current request URI in $uri and the request body as $body.
+     * The return value, if no exception is thrown, is a valid [EMAIL 
PROTECTED]
+     * ezcWebdavUnlockRequest} object.
+     * 
+     * @param string $uri 
+     * @param string $body 
+     * @return ezcWebdavUnlockRequest
+     */
+    protected function parseUnlockRequest( $uri, $body )
+    {
+        $request = new ezcWebdavUnlockRequest( $uri );
+
+        $request->setHeaders(
+            $this->parseHeaders(
+                array( 'Lock-Token' )
+            )
         );
 
         return $request;

Added: trunk/Webdav/tests/clients/rfc/unlock/request/result.ser
==============================================================================
Binary file - no diff available.

Propchange: trunk/Webdav/tests/clients/rfc/unlock/request/result.ser
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream


-- 
svn-components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to