Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 6... Línea 6...
6
 
6
 
7
![CI](https://github.com/guzzle/psr7/workflows/CI/badge.svg)
7
![CI](https://github.com/guzzle/psr7/workflows/CI/badge.svg)
Línea 8... Línea 8...
8
![Static analysis](https://github.com/guzzle/psr7/workflows/Static%20analysis/badge.svg)
8
![Static analysis](https://github.com/guzzle/psr7/workflows/Static%20analysis/badge.svg)
Línea 9... Línea 9...
9
 
9
 
10
 
10
 
Línea -... Línea 11...
-
 
11
## Features
-
 
12
 
-
 
13
This package comes with a number of stream implementations and stream
-
 
14
decorators.
-
 
15
 
-
 
16
 
-
 
17
## Installation
-
 
18
 
-
 
19
```shell
-
 
20
composer require guzzlehttp/psr7
-
 
21
```
-
 
22
 
-
 
23
## Version Guidance
-
 
24
 
11
# Stream implementation
25
| Version | Status              | PHP Version  |
Línea 12... Línea 26...
12
 
26
|---------|---------------------|--------------|
Línea 13... Línea 27...
13
This package comes with a number of stream implementations and stream
27
| 1.x     | EOL (2024-06-30)    | >=5.4,<8.2   |
Línea 243... Línea 257...
243
{
257
{
244
    use StreamDecoratorTrait;
258
    use StreamDecoratorTrait;
Línea 245... Línea 259...
245
 
259
 
Línea -... Línea 260...
-
 
260
    private $callback;
-
 
261
 
246
    private $callback;
262
    private $stream;
247
 
263
 
248
    public function __construct(StreamInterface $stream, callable $cb)
264
    public function __construct(StreamInterface $stream, callable $cb)
249
    {
265
    {
250
        $this->stream = $stream;
266
        $this->stream = $stream;
Línea 255... Línea 271...
255
    {
271
    {
256
        $result = $this->stream->read($length);
272
        $result = $this->stream->read($length);
Línea 257... Línea 273...
257
 
273
 
258
        // Invoke the callback when EOF is hit.
274
        // Invoke the callback when EOF is hit.
259
        if ($this->eof()) {
275
        if ($this->eof()) {
260
            call_user_func($this->callback);
276
            ($this->callback)();
Línea 261... Línea 277...
261
        }
277
        }
262
 
278
 
263
        return $result;
279
        return $result;
Línea 418... Línea 434...
418
will be parsed into `['foo[a]' => '1', 'foo[b]' => '2'])`.
434
will be parsed into `['foo[a]' => '1', 'foo[b]' => '2'])`.
Línea 419... Línea 435...
419
 
435
 
Línea 420... Línea 436...
420
 
436
 
Línea 421... Línea 437...
421
## `GuzzleHttp\Psr7\Query::build`
437
## `GuzzleHttp\Psr7\Query::build`
Línea 422... Línea 438...
422
 
438
 
423
`public static function build(array $params, int|false $encoding = PHP_QUERY_RFC3986): string`
439
`public static function build(array $params, int|false $encoding = PHP_QUERY_RFC3986, bool $treatBoolsAsInts = true): string`
Línea 480... Línea 496...
480
- version: (string) Set the protocol version.
496
- version: (string) Set the protocol version.
Línea 481... Línea 497...
481
 
497
 
Línea 482... Línea 498...
482
 
498
 
Línea 483... Línea 499...
483
## `GuzzleHttp\Psr7\Utils::readLine`
499
## `GuzzleHttp\Psr7\Utils::readLine`
Línea -... Línea 500...
-
 
500
 
-
 
501
`public static function readLine(StreamInterface $stream, ?int $maxLength = null): string`
-
 
502
 
-
 
503
Read a line from the stream up to the maximum allowed buffer length.
-
 
504
 
-
 
505
 
-
 
506
## `GuzzleHttp\Psr7\Utils::redactUserInfo`
484
 
507
 
Línea 485... Línea 508...
485
`public static function readLine(StreamInterface $stream, int $maxLength = null): string`
508
`public static function redactUserInfo(UriInterface $uri): UriInterface`
Línea 486... Línea 509...
486
 
509
 
Línea 619... Línea 642...
619
## URI Types
642
## URI Types
Línea 620... Línea 643...
620
 
643
 
621
An instance of `Psr\Http\Message\UriInterface` can either be an absolute URI or a relative reference.
644
An instance of `Psr\Http\Message\UriInterface` can either be an absolute URI or a relative reference.
622
An absolute URI has a scheme. A relative reference is used to express a URI relative to another URI,
645
An absolute URI has a scheme. A relative reference is used to express a URI relative to another URI,
623
the base URI. Relative references can be divided into several forms according to
646
the base URI. Relative references can be divided into several forms according to
Línea 624... Línea 647...
624
[RFC 3986 Section 4.2](https://tools.ietf.org/html/rfc3986#section-4.2):
647
[RFC 3986 Section 4.2](https://datatracker.ietf.org/doc/html/rfc3986#section-4.2):
625
 
648
 
626
- network-path references, e.g. `//example.com/path`
649
- network-path references, e.g. `//example.com/path`
Línea 656... Línea 679...
656
Whether the URI is a relative-path reference. A relative reference that does not begin with a slash character is
679
Whether the URI is a relative-path reference. A relative reference that does not begin with a slash character is
657
termed a relative-path reference.
680
termed a relative-path reference.
Línea 658... Línea 681...
658
 
681
 
Línea 659... Línea 682...
659
### `GuzzleHttp\Psr7\Uri::isSameDocumentReference`
682
### `GuzzleHttp\Psr7\Uri::isSameDocumentReference`
Línea 660... Línea 683...
660
 
683
 
661
`public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null): bool`
684
`public static function isSameDocumentReference(UriInterface $uri, ?UriInterface $base = null): bool`
662
 
685
 
Línea 678... Línea 701...
678
### `GuzzleHttp\Psr7\Uri::composeComponents`
701
### `GuzzleHttp\Psr7\Uri::composeComponents`
Línea 679... Línea 702...
679
 
702
 
Línea 680... Línea 703...
680
`public static function composeComponents($scheme, $authority, $path, $query, $fragment): string`
703
`public static function composeComponents($scheme, $authority, $path, $query, $fragment): string`
681
 
704
 
682
Composes a URI reference string from its various components according to
705
Composes a URI reference string from its various components according to
Línea 683... Línea 706...
683
[RFC 3986 Section 5.3](https://tools.ietf.org/html/rfc3986#section-5.3). Usually this method does not need to be called
706
[RFC 3986 Section 5.3](https://datatracker.ietf.org/doc/html/rfc3986#section-5.3). Usually this method does not need
Línea 684... Línea 707...
684
manually but instead is used indirectly via `Psr\Http\Message\UriInterface::__toString`.
707
to be called manually but instead is used indirectly via `Psr\Http\Message\UriInterface::__toString`.
Línea 723... Línea 746...
723
Determines if a modified URL should be considered cross-origin with respect to an original URL.
746
Determines if a modified URL should be considered cross-origin with respect to an original URL.
Línea 724... Línea 747...
724
 
747
 
Línea 725... Línea 748...
725
## Reference Resolution
748
## Reference Resolution
726
 
749
 
727
`GuzzleHttp\Psr7\UriResolver` provides methods to resolve a URI reference in the context of a base URI according
750
`GuzzleHttp\Psr7\UriResolver` provides methods to resolve a URI reference in the context of a base URI according
Línea 728... Línea 751...
728
to [RFC 3986 Section 5](https://tools.ietf.org/html/rfc3986#section-5). This is for example also what web browsers
751
to [RFC 3986 Section 5](https://datatracker.ietf.org/doc/html/rfc3986#section-5). This is for example also what web
Línea 729... Línea 752...
729
do when resolving a link in a website based on the current request URI.
752
browsers do when resolving a link in a website based on the current request URI.
Línea 737... Línea 760...
737
### `GuzzleHttp\Psr7\UriResolver::removeDotSegments`
760
### `GuzzleHttp\Psr7\UriResolver::removeDotSegments`
Línea 738... Línea 761...
738
 
761
 
Línea 739... Línea 762...
739
`public static function removeDotSegments(string $path): string`
762
`public static function removeDotSegments(string $path): string`
740
 
763
 
Línea 741... Línea 764...
741
Removes dot segments from a path and returns the new path according to
764
Removes dot segments from a path and returns the new path according to
Línea 742... Línea 765...
742
[RFC 3986 Section 5.2.4](https://tools.ietf.org/html/rfc3986#section-5.2.4).
765
[RFC 3986 Section 5.2.4](https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4).
Línea 763... Línea 786...
763
```
786
```
Línea 764... Línea 787...
764
 
787
 
Línea 765... Línea 788...
765
## Normalization and Comparison
788
## Normalization and Comparison
766
 
789
 
Línea 767... Línea 790...
767
`GuzzleHttp\Psr7\UriNormalizer` provides methods to normalize and compare URIs according to
790
`GuzzleHttp\Psr7\UriNormalizer` provides methods to normalize and compare URIs according to
Línea 768... Línea 791...
768
[RFC 3986 Section 6](https://tools.ietf.org/html/rfc3986#section-6).
791
[RFC 3986 Section 6](https://datatracker.ietf.org/doc/html/rfc3986#section-6).
Línea 845... Línea 868...
845
`$normalizations` bitmask. The method also accepts relative URI references and returns true when they are equivalent.
868
`$normalizations` bitmask. The method also accepts relative URI references and returns true when they are equivalent.
846
This of course assumes they will be resolved against the same base URI. If this is not the case, determination of
869
This of course assumes they will be resolved against the same base URI. If this is not the case, determination of
847
equivalence or difference of relative references does not mean anything.
870
equivalence or difference of relative references does not mean anything.
Línea 848... Línea -...
848
 
-
 
849
 
-
 
850
## Version Guidance
-
 
851
 
-
 
852
| Version | Status         | PHP Version      |
-
 
853
|---------|----------------|------------------|
-
 
854
| 1.x     | Security fixes | >=5.4,<8.1       |
-
 
855
| 2.x     | Latest         | ^7.2.5 \|\| ^8.0 |
-
 
856
 
871
 
Línea 857... Línea 872...
857
 
872