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