mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 22:46:55 +00:00
Initial import
This commit is contained in:
commit
2295a33590
884 changed files with 93939 additions and 0 deletions
15
php/vendor/http-interop/http-factory-guzzle/src/RequestFactory.php
vendored
Normal file
15
php/vendor/http-interop/http-factory-guzzle/src/RequestFactory.php
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
namespace Http\Factory\Guzzle;
|
||||
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
use Psr\Http\Message\RequestFactoryInterface;
|
||||
use Psr\Http\Message\RequestInterface;
|
||||
|
||||
class RequestFactory implements RequestFactoryInterface
|
||||
{
|
||||
public function createRequest(string $method, $uri): RequestInterface
|
||||
{
|
||||
return new Request($method, $uri);
|
||||
}
|
||||
}
|
||||
15
php/vendor/http-interop/http-factory-guzzle/src/ResponseFactory.php
vendored
Normal file
15
php/vendor/http-interop/http-factory-guzzle/src/ResponseFactory.php
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
namespace Http\Factory\Guzzle;
|
||||
|
||||
use GuzzleHttp\Psr7\Response;
|
||||
use Psr\Http\Message\ResponseFactoryInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
class ResponseFactory implements ResponseFactoryInterface
|
||||
{
|
||||
public function createResponse(int $code = 200, string $reasonPhrase = ''): ResponseInterface
|
||||
{
|
||||
return new Response($code, [], null, '1.1', $reasonPhrase);
|
||||
}
|
||||
}
|
||||
24
php/vendor/http-interop/http-factory-guzzle/src/ServerRequestFactory.php
vendored
Normal file
24
php/vendor/http-interop/http-factory-guzzle/src/ServerRequestFactory.php
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace Http\Factory\Guzzle;
|
||||
|
||||
use GuzzleHttp\Psr7\ServerRequest;
|
||||
use Psr\Http\Message\ServerRequestFactoryInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
||||
class ServerRequestFactory implements ServerRequestFactoryInterface
|
||||
{
|
||||
public function createServerRequest(string $method, $uri, array $serverParams = []): ServerRequestInterface
|
||||
{
|
||||
|
||||
if (empty($method)) {
|
||||
if (!empty($serverParams['REQUEST_METHOD'])) {
|
||||
$method = $serverParams['REQUEST_METHOD'];
|
||||
} else {
|
||||
throw new \InvalidArgumentException('Cannot determine HTTP method');
|
||||
}
|
||||
}
|
||||
|
||||
return new ServerRequest($method, $uri, [], null, '1.1', $serverParams);
|
||||
}
|
||||
}
|
||||
26
php/vendor/http-interop/http-factory-guzzle/src/StreamFactory.php
vendored
Normal file
26
php/vendor/http-interop/http-factory-guzzle/src/StreamFactory.php
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
namespace Http\Factory\Guzzle;
|
||||
|
||||
use GuzzleHttp\Psr7\Stream;
|
||||
use GuzzleHttp\Psr7\Utils;
|
||||
use Psr\Http\Message\StreamFactoryInterface;
|
||||
use Psr\Http\Message\StreamInterface;
|
||||
|
||||
class StreamFactory implements StreamFactoryInterface
|
||||
{
|
||||
public function createStream(string $content = ''): StreamInterface
|
||||
{
|
||||
return Utils::streamFor($content);
|
||||
}
|
||||
|
||||
public function createStreamFromFile(string $file, string $mode = 'r'): StreamInterface
|
||||
{
|
||||
return $this->createStreamFromResource(Utils::tryFopen($file, $mode));
|
||||
}
|
||||
|
||||
public function createStreamFromResource($resource): StreamInterface
|
||||
{
|
||||
return new Stream($resource);
|
||||
}
|
||||
}
|
||||
25
php/vendor/http-interop/http-factory-guzzle/src/UploadedFileFactory.php
vendored
Normal file
25
php/vendor/http-interop/http-factory-guzzle/src/UploadedFileFactory.php
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace Http\Factory\Guzzle;
|
||||
|
||||
use GuzzleHttp\Psr7\UploadedFile;
|
||||
use Psr\Http\Message\UploadedFileFactoryInterface;
|
||||
use Psr\Http\Message\StreamInterface;
|
||||
use Psr\Http\Message\UploadedFileInterface;
|
||||
|
||||
class UploadedFileFactory implements UploadedFileFactoryInterface
|
||||
{
|
||||
public function createUploadedFile(
|
||||
StreamInterface $stream,
|
||||
int $size = null,
|
||||
int $error = \UPLOAD_ERR_OK,
|
||||
string $clientFilename = null,
|
||||
string $clientMediaType = null
|
||||
): UploadedFileInterface {
|
||||
if ($size === null) {
|
||||
$size = $stream->getSize();
|
||||
}
|
||||
|
||||
return new UploadedFile($stream, $size, $error, $clientFilename, $clientMediaType);
|
||||
}
|
||||
}
|
||||
15
php/vendor/http-interop/http-factory-guzzle/src/UriFactory.php
vendored
Normal file
15
php/vendor/http-interop/http-factory-guzzle/src/UriFactory.php
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
namespace Http\Factory\Guzzle;
|
||||
|
||||
use GuzzleHttp\Psr7\Uri;
|
||||
use Psr\Http\Message\UriFactoryInterface;
|
||||
use Psr\Http\Message\UriInterface;
|
||||
|
||||
class UriFactory implements UriFactoryInterface
|
||||
{
|
||||
public function createUri(string $uri = ''): UriInterface
|
||||
{
|
||||
return new Uri($uri);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue