PluginProbe ʕ •ᴥ•ʔ
Independent Analytics – WordPress Analytics Plugin / 2.15.0
Independent Analytics – WordPress Analytics Plugin v2.15.0
2.15.0 2.14.10 trunk 1.1 1.10 1.10.1 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.17.1 1.17.2 1.17.3 1.17.4 1.18 1.18.1 1.19.0 1.19.1 1.2 1.20.0 1.21.0 1.22.0 1.22.1 1.23.0 1.23.1 1.24.0 1.24.1 1.25.0 1.25.1 1.26.0 1.27.0 1.28.0 1.28.1 1.28.2 1.28.3 1.29.0 1.3 1.30.0 1.30.1 1.4 1.5 1.6 1.7 1.8 1.9 2.0.0 2.0.1 2.1.4 2.1.5 2.1.6 2.10.0 2.10.1 2.10.2 2.10.3 2.10.4 2.11.0 2.11.1 2.11.10 2.11.2 2.11.3 2.11.4 2.11.5 2.11.6 2.11.7 2.11.8 2.11.9 2.12.0 2.12.1 2.12.2 2.13.1 2.13.2 2.13.5 2.13.6 2.14.0 2.14.1 2.14.2 2.14.4 2.14.6 2.14.7 2.14.8 2.14.9 2.2.0 2.2.1 2.3.1 2.3.2 2.4.2 2.4.3 2.5.0 2.5.1 2.6.0 2.6.1 2.6.2 2.6.3 2.6.4 2.7.0 2.7.1 2.7.2 2.7.3 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.8 2.8.9 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7
independent-analytics / vendor / psr / http-message / src / UploadedFileInterface.php
independent-analytics / vendor / psr / http-message / src Last commit date
MessageInterface.php 2 years ago RequestInterface.php 2 years ago ResponseInterface.php 2 years ago ServerRequestInterface.php 2 years ago StreamInterface.php 2 years ago UploadedFileInterface.php 2 years ago UriInterface.php 2 years ago
UploadedFileInterface.php
121 lines
1 <?php
2
3 declare (strict_types=1);
4 namespace IAWPSCOPED\Psr\Http\Message;
5
6 /**
7 * Value object representing a file uploaded through an HTTP request.
8 *
9 * Instances of this interface are considered immutable; all methods that
10 * might change state MUST be implemented such that they retain the internal
11 * state of the current instance and return an instance that contains the
12 * changed state.
13 * @internal
14 */
15 interface UploadedFileInterface
16 {
17 /**
18 * Retrieve a stream representing the uploaded file.
19 *
20 * This method MUST return a StreamInterface instance, representing the
21 * uploaded file. The purpose of this method is to allow utilizing native PHP
22 * stream functionality to manipulate the file upload, such as
23 * stream_copy_to_stream() (though the result will need to be decorated in a
24 * native PHP stream wrapper to work with such functions).
25 *
26 * If the moveTo() method has been called previously, this method MUST raise
27 * an exception.
28 *
29 * @return StreamInterface Stream representation of the uploaded file.
30 * @throws \RuntimeException in cases when no stream is available or can be
31 * created.
32 */
33 public function getStream();
34 /**
35 * Move the uploaded file to a new location.
36 *
37 * Use this method as an alternative to move_uploaded_file(). This method is
38 * guaranteed to work in both SAPI and non-SAPI environments.
39 * Implementations must determine which environment they are in, and use the
40 * appropriate method (move_uploaded_file(), rename(), or a stream
41 * operation) to perform the operation.
42 *
43 * $targetPath may be an absolute path, or a relative path. If it is a
44 * relative path, resolution should be the same as used by PHP's rename()
45 * function.
46 *
47 * The original file or stream MUST be removed on completion.
48 *
49 * If this method is called more than once, any subsequent calls MUST raise
50 * an exception.
51 *
52 * When used in an SAPI environment where $_FILES is populated, when writing
53 * files via moveTo(), is_uploaded_file() and move_uploaded_file() SHOULD be
54 * used to ensure permissions and upload status are verified correctly.
55 *
56 * If you wish to move to a stream, use getStream(), as SAPI operations
57 * cannot guarantee writing to stream destinations.
58 *
59 * @see http://php.net/is_uploaded_file
60 * @see http://php.net/move_uploaded_file
61 * @param string $targetPath Path to which to move the uploaded file.
62 * @throws \InvalidArgumentException if the $targetPath specified is invalid.
63 * @throws \RuntimeException on any error during the move operation, or on
64 * the second or subsequent call to the method.
65 */
66 public function moveTo(string $targetPath);
67 /**
68 * Retrieve the file size.
69 *
70 * Implementations SHOULD return the value stored in the "size" key of
71 * the file in the $_FILES array if available, as PHP calculates this based
72 * on the actual size transmitted.
73 *
74 * @return int|null The file size in bytes or null if unknown.
75 */
76 public function getSize();
77 /**
78 * Retrieve the error associated with the uploaded file.
79 *
80 * The return value MUST be one of PHP's UPLOAD_ERR_XXX constants.
81 *
82 * If the file was uploaded successfully, this method MUST return
83 * UPLOAD_ERR_OK.
84 *
85 * Implementations SHOULD return the value stored in the "error" key of
86 * the file in the $_FILES array.
87 *
88 * @see http://php.net/manual/en/features.file-upload.errors.php
89 * @return int One of PHP's UPLOAD_ERR_XXX constants.
90 */
91 public function getError();
92 /**
93 * Retrieve the filename sent by the client.
94 *
95 * Do not trust the value returned by this method. A client could send
96 * a malicious filename with the intention to corrupt or hack your
97 * application.
98 *
99 * Implementations SHOULD return the value stored in the "name" key of
100 * the file in the $_FILES array.
101 *
102 * @return string|null The filename sent by the client or null if none
103 * was provided.
104 */
105 public function getClientFilename();
106 /**
107 * Retrieve the media type sent by the client.
108 *
109 * Do not trust the value returned by this method. A client could send
110 * a malicious media type with the intention to corrupt or hack your
111 * application.
112 *
113 * Implementations SHOULD return the value stored in the "type" key of
114 * the file in the $_FILES array.
115 *
116 * @return string|null The media type sent by the client or null if none
117 * was provided.
118 */
119 public function getClientMediaType();
120 }
121