Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
GuzzleHttp\Psr7\HttpFactory Class Reference
Inheritance diagram for GuzzleHttp\Psr7\HttpFactory:
Psr\Http\Message\RequestFactoryInterface Psr\Http\Message\ResponseFactoryInterface Psr\Http\Message\ServerRequestFactoryInterface Psr\Http\Message\StreamFactoryInterface Psr\Http\Message\UploadedFileFactoryInterface Psr\Http\Message\UriFactoryInterface

Public Member Functions

 createRequest (string $method, $uri)
 
 createResponse (int $code=200, string $reasonPhrase='')
 
 createServerRequest (string $method, $uri, array $serverParams=[])
 
 createStream (string $content='')
 
 createStreamFromFile (string $file, string $mode='r')
 Create a stream from an existing file.
 
 createStreamFromResource ($resource)
 Create a new stream from an existing resource.
 
 createUploadedFile (StreamInterface $stream, int $size=null, int $error=UPLOAD_ERR_OK, string $clientFilename=null, string $clientMediaType=null)
 
 createUri (string $uri='')
 

Member Function Documentation

◆ createRequest()

GuzzleHttp\Psr7\HttpFactory::createRequest ( string $method,
$uri )

◆ createResponse()

GuzzleHttp\Psr7\HttpFactory::createResponse ( int $code = 200,
string $reasonPhrase = '' )

◆ createServerRequest()

GuzzleHttp\Psr7\HttpFactory::createServerRequest ( string $method,
$uri,
array $serverParams = [] )

◆ createStream()

GuzzleHttp\Psr7\HttpFactory::createStream ( string $content = '')

◆ createStreamFromFile()

GuzzleHttp\Psr7\HttpFactory::createStreamFromFile ( string $filename,
string $mode = 'r' )

Create a stream from an existing file.

The file MUST be opened using the given mode, which may be any mode supported by the fopen function.

The $filename MAY be any string supported by fopen().

Parameters
string$filenameFilename or stream URI to use as basis of stream.
string$modeMode with which to open the underlying filename/stream.
Return values
StreamInterface
Exceptions
RuntimeExceptionIf the file cannot be opened.
InvalidArgumentExceptionIf the mode is invalid.

Implements Psr\Http\Message\StreamFactoryInterface.

◆ createStreamFromResource()

GuzzleHttp\Psr7\HttpFactory::createStreamFromResource ( $resource)

Create a new stream from an existing resource.

The stream MUST be readable and may be writable.

Parameters
resource$resourcePHP resource to use as basis of stream.
Return values
StreamInterface

Implements Psr\Http\Message\StreamFactoryInterface.

◆ createUploadedFile()

GuzzleHttp\Psr7\HttpFactory::createUploadedFile ( StreamInterface $stream,
int $size = null,
int $error = UPLOAD_ERR_OK,
string $clientFilename = null,
string $clientMediaType = null )

◆ createUri()

GuzzleHttp\Psr7\HttpFactory::createUri ( string $uri = '')

The documentation for this class was generated from the following file: