1*a1a3b679SAndreas Boehler<?php 2*a1a3b679SAndreas Boehler 3*a1a3b679SAndreas Boehlernamespace Sabre\DAV\PartialUpdate; 4*a1a3b679SAndreas Boehler 5*a1a3b679SAndreas Boehleruse Sabre\DAV; 6*a1a3b679SAndreas Boehler 7*a1a3b679SAndreas Boehler/** 8*a1a3b679SAndreas Boehler * This interface provides a way to modify only part of a target resource 9*a1a3b679SAndreas Boehler * It may be used to update a file chunk, upload big a file into smaller 10*a1a3b679SAndreas Boehler * chunks or resume an upload 11*a1a3b679SAndreas Boehler * 12*a1a3b679SAndreas Boehler * @copyright Copyright (C) 2007-2015 fruux GmbH (https://fruux.com/). 13*a1a3b679SAndreas Boehler * @author Jean-Tiare LE BIGOT (http://www.jtlebi.fr/) 14*a1a3b679SAndreas Boehler * @license http://sabre.io/license/ Modified BSD License 15*a1a3b679SAndreas Boehler */ 16*a1a3b679SAndreas Boehlerinterface IPatchSupport extends DAV\IFile { 17*a1a3b679SAndreas Boehler 18*a1a3b679SAndreas Boehler /** 19*a1a3b679SAndreas Boehler * Updates the file based on a range specification. 20*a1a3b679SAndreas Boehler * 21*a1a3b679SAndreas Boehler * The first argument is the data, which is either a readable stream 22*a1a3b679SAndreas Boehler * resource or a string. 23*a1a3b679SAndreas Boehler * 24*a1a3b679SAndreas Boehler * The second argument is the type of update we're doing. 25*a1a3b679SAndreas Boehler * This is either: 26*a1a3b679SAndreas Boehler * * 1. append 27*a1a3b679SAndreas Boehler * * 2. update based on a start byte 28*a1a3b679SAndreas Boehler * * 3. update based on an end byte 29*a1a3b679SAndreas Boehler *; 30*a1a3b679SAndreas Boehler * The third argument is the start or end byte. 31*a1a3b679SAndreas Boehler * 32*a1a3b679SAndreas Boehler * After a successful put operation, you may choose to return an ETag. The 33*a1a3b679SAndreas Boehler * etag must always be surrounded by double-quotes. These quotes must 34*a1a3b679SAndreas Boehler * appear in the actual string you're returning. 35*a1a3b679SAndreas Boehler * 36*a1a3b679SAndreas Boehler * Clients may use the ETag from a PUT request to later on make sure that 37*a1a3b679SAndreas Boehler * when they update the file, the contents haven't changed in the mean 38*a1a3b679SAndreas Boehler * time. 39*a1a3b679SAndreas Boehler * 40*a1a3b679SAndreas Boehler * @param resource|string $data 41*a1a3b679SAndreas Boehler * @param int $rangeType 42*a1a3b679SAndreas Boehler * @param int $offset 43*a1a3b679SAndreas Boehler * @return string|null 44*a1a3b679SAndreas Boehler */ 45*a1a3b679SAndreas Boehler function patch($data, $rangeType, $offset = null); 46*a1a3b679SAndreas Boehler 47*a1a3b679SAndreas Boehler} 48