summaryrefslogtreecommitdiff
path: root/php-src/tests/http/upload.php
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-09-23 14:00:08 +0300
committerWolfy-J <[email protected]>2018-09-23 14:00:08 +0300
commitf7d64d8e8592951ed5a0f0b06db608bc73786ea2 (patch)
tree1bdef1618288221495f1f38bb528e71cca907e2e /php-src/tests/http/upload.php
parent4815ebb760672c7fa541c941d7f47cd316656020 (diff)
- new directory structure
- singular exception - starting exception deprecation
Diffstat (limited to 'php-src/tests/http/upload.php')
-rw-r--r--php-src/tests/http/upload.php35
1 files changed, 0 insertions, 35 deletions
diff --git a/php-src/tests/http/upload.php b/php-src/tests/http/upload.php
deleted file mode 100644
index 2f7c0b64..00000000
--- a/php-src/tests/http/upload.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-
-use Psr\Http\Message\ResponseInterface;
-use Psr\Http\Message\ServerRequestInterface;
-
-function handleRequest(ServerRequestInterface $req, ResponseInterface $resp): ResponseInterface
-{
- $files = $req->getUploadedFiles();
- array_walk_recursive($files, function (&$v) {
- /**
- * @var \Psr\Http\Message\UploadedFileInterface $v
- */
-
- if ($v->getError()) {
- $v = [
- 'name' => $v->getClientFilename(),
- 'size' => $v->getSize(),
- 'mime' => $v->getClientMediaType(),
- 'error' => $v->getError(),
- ];
- } else {
- $v = [
- 'name' => $v->getClientFilename(),
- 'size' => $v->getSize(),
- 'mime' => $v->getClientMediaType(),
- 'error' => $v->getError(),
- 'md5' => md5($v->getStream()->__toString()),
- ];
- }
- });
-
- $resp->getBody()->write(json_encode($files, JSON_UNESCAPED_SLASHES));
-
- return $resp;
-} \ No newline at end of file