File manager - Edit - /home/opticamezl/www/newok/laminas.zip
Back
PK �>�\��F�[ [ laminas-diactoros/COPYRIGHT.mdnu �[��� Copyright (c) 2020 Laminas Project a Series of LF Projects, LLC. (https://getlaminas.org/) PK �>�\#"� laminas-diactoros/PATCHES.txtnu �[��� This file was automatically generated by Composer Patches (https://github.com/cweagans/composer-patches) Patches applied to this directory: Fixes HTTP Multiline Header Termination Source: ./build/composer_patches/4.4.4-2024-04-13_php-laminas-diactoros.patch PK �>�\K8%� � laminas-diactoros/LICENSE.mdnu �[��� Copyright (c) 2020 Laminas Project a Series of LF Projects, LLC. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of Laminas Foundation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PK �>�\ql�T� � , laminas-diactoros/src/AbstractSerializer.phpnu �[��� <?php /** * @see https://github.com/laminas/laminas-diactoros for the canonical source repository * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License */ declare(strict_types=1); namespace Laminas\Diactoros; use Psr\Http\Message\StreamInterface; use function array_pop; use function implode; use function ltrim; use function preg_match; use function sprintf; use function str_replace; use function ucwords; /** * Provides base functionality for request and response de/serialization * strategies, including functionality for retrieving a line at a time from * the message, splitting headers from the body, and serializing headers. */ abstract class AbstractSerializer { const CR = "\r"; const EOL = "\r\n"; const LF = "\n"; /** * Retrieve a single line from the stream. * * Retrieves a line from the stream; a line is defined as a sequence of * characters ending in a CRLF sequence. * * @throws Exception\DeserializationException if the sequence contains a CR * or LF in isolation, or ends in a CR. */ protected static function getLine(StreamInterface $stream) : string { $line = ''; $crFound = false; while (! $stream->eof()) { $char = $stream->read(1); if ($crFound && $char === self::LF) { $crFound = false; break; } // CR NOT followed by LF if ($crFound && $char !== self::LF) { throw Exception\DeserializationException::forUnexpectedCarriageReturn(); } // LF in isolation if (! $crFound && $char === self::LF) { throw Exception\DeserializationException::forUnexpectedLineFeed(); } // CR found; do not append if ($char === self::CR) { $crFound = true; continue; } // Any other character: append $line .= $char; } // CR found at end of stream if ($crFound) { throw Exception\DeserializationException::forUnexpectedEndOfHeaders(); } return $line; } /** * Split the stream into headers and body content. * * Returns an array containing two elements * * - The first is an array of headers * - The second is a StreamInterface containing the body content * * @throws Exception\DeserializationException For invalid headers. */ protected static function splitStream(StreamInterface $stream) : array { $headers = []; $currentHeader = false; while ($line = self::getLine($stream)) { if (preg_match(';^(?P<name>[!#$%&\'*+.^_`\|~0-9a-zA-Z-]+):(?P<value>.*)$;', $line, $matches)) { $currentHeader = $matches['name']; if (! isset($headers[$currentHeader])) { $headers[$currentHeader] = []; } $headers[$currentHeader][] = ltrim($matches['value']); continue; } if (! $currentHeader) { throw Exception\DeserializationException::forInvalidHeader(); } if (! preg_match('#^[ \t]#', $line)) { throw Exception\DeserializationException::forInvalidHeaderContinuation(); } // Append continuation to last header value found $value = array_pop($headers[$currentHeader]); $headers[$currentHeader][] = $value . ltrim($line); } // use RelativeStream to avoid copying initial stream into memory return [$headers, new RelativeStream($stream, $stream->tell())]; } /** * Serialize headers to string values. */ protected static function serializeHeaders(array $headers) : string { $lines = []; foreach ($headers as $header => $values) { $normalized = self::filterHeader($header); foreach ($values as $value) { $lines[] = sprintf('%s: %s', $normalized, $value); } } return implode("\r\n", $lines); } /** * Filter a header name to wordcase */ protected static function filterHeader($header) : string { $filtered = str_replace('-', ' ', $header); $filtered = ucwords($filtered); return str_replace(' ', '-', $filtered); } } PK �>�\$znCG G ! laminas-diactoros/src/Request.phpnu �[��� <?php /** * @see https://github.com/laminas/laminas-diactoros for the canonical source repository * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License */ declare(strict_types=1); namespace Laminas\Diactoros; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\StreamInterface; use Psr\Http\Message\UriInterface; use function strtolower; /** * HTTP Request encapsulation * * Requests are considered immutable; all methods that might change state are * implemented such that they retain the internal state of the current * message and return a new instance that contains the changed state. */ class Request implements RequestInterface { use RequestTrait; /** * @param null|string|UriInterface $uri URI for the request, if any. * @param null|string $method HTTP method for the request, if any. * @param string|resource|StreamInterface $body Message body, if any. * @param array $headers Headers for the message, if any. * @throws Exception\InvalidArgumentException for any invalid value. */ public function __construct($uri = null, string $method = null, $body = 'php://temp', array $headers = []) { $this->initialize($uri, $method, $body, $headers); } /** * {@inheritdoc} */ public function getHeaders() : array { $headers = $this->headers; if (! $this->hasHeader('host') && $this->uri->getHost() ) { $headers['Host'] = [$this->getHostFromUri()]; } return $headers; } /** * {@inheritdoc} */ public function getHeader($header) : array { if (! $this->hasHeader($header)) { if (strtolower($header) === 'host' && $this->uri->getHost() ) { return [$this->getHostFromUri()]; } return []; } $header = $this->headerNames[strtolower($header)]; return $this->headers[$header]; } } PK �>�\?3�) ) ( laminas-diactoros/src/ConfigProvider.phpnu �[��� <?php /** * @see https://github.com/laminas/laminas-diactoros for the canonical source repository * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License */ declare(strict_types=1); namespace Laminas\Diactoros; use Psr\Http\Message\ServerRequestFactoryInterface; use Psr\Http\Message\RequestFactoryInterface; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\StreamFactoryInterface; use Psr\Http\Message\UploadedFileFactoryInterface; use Psr\Http\Message\UriFactoryInterface; class ConfigProvider { /** * Retrieve configuration for laminas-diactoros. * * @return array */ public function __invoke() : array { return [ 'dependencies' => $this->getDependencies(), ]; } /** * Returns the container dependencies. * Maps factory interfaces to factories. */ public function getDependencies() : array { return [ 'invokables' => [ RequestFactoryInterface::class => RequestFactory::class, ResponseFactoryInterface::class => ResponseFactory::class, StreamFactoryInterface::class => StreamFactory::class, ServerRequestFactoryInterface::class => ServerRequestFactory::class, UploadedFileFactoryInterface::class => UploadedFileFactory::class, UriFactoryInterface::class => UriFactory::class ], ]; } } PK �>�\�hA� � '