X7ROOT File Manager
Current Path:
/home/prisjneg/public_html/vendor/symfony/http-foundation
home
/
prisjneg
/
public_html
/
vendor
/
symfony
/
http-foundation
/
π
..
π
AcceptHeader.php
(3.36 KB)
π
AcceptHeaderItem.php
(3.19 KB)
π
BinaryFileResponse.php
(12.62 KB)
π
CHANGELOG.md
(19.11 KB)
π
ChainRequestMatcher.php
(873 B)
π
Cookie.php
(11.93 KB)
π
Exception
π
ExpressionRequestMatcher.php
(1.93 KB)
π
File
π
FileBag.php
(3.74 KB)
π
HeaderBag.php
(7.12 KB)
π
HeaderUtils.php
(9.06 KB)
π
InputBag.php
(5.01 KB)
π
IpUtils.php
(7.95 KB)
π
JsonResponse.php
(6.64 KB)
π
LICENSE
(1.04 KB)
π
ParameterBag.php
(7.46 KB)
π
README.md
(526 B)
π
RateLimiter
π
RedirectResponse.php
(2.56 KB)
π
Request.php
(68.02 KB)
π
RequestMatcher
π
RequestMatcher.php
(5.21 KB)
π
RequestMatcherInterface.php
(621 B)
π
RequestStack.php
(2.87 KB)
π
Response.php
(40.07 KB)
π
ResponseHeaderBag.php
(7.94 KB)
π
ServerBag.php
(3.92 KB)
π
Session
π
StreamedJsonResponse.php
(5.64 KB)
π
StreamedResponse.php
(3 KB)
π
Test
π
UriSigner.php
(3.21 KB)
π
UrlHelper.php
(3.05 KB)
π
composer.json
(1.31 KB)
Editing: AcceptHeader.php
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpFoundation; // Help opcache.preload discover always-needed symbols class_exists(AcceptHeaderItem::class); /** * Represents an Accept-* header. * * An accept header is compound with a list of items, * sorted by descending quality. * * @author Jean-FranΓ§ois Simon <contact@jfsimon.fr> */ class AcceptHeader { /** * @var AcceptHeaderItem[] */ private array $items = []; private bool $sorted = true; /** * @param AcceptHeaderItem[] $items */ public function __construct(array $items) { foreach ($items as $item) { $this->add($item); } } /** * Builds an AcceptHeader instance from a string. */ public static function fromString(?string $headerValue): self { $parts = HeaderUtils::split($headerValue ?? '', ',;='); return new self(array_map(function ($subParts) { static $index = 0; $part = array_shift($subParts); $attributes = HeaderUtils::combine($subParts); $item = new AcceptHeaderItem($part[0], $attributes); $item->setIndex($index++); return $item; }, $parts)); } /** * Returns header value's string representation. */ public function __toString(): string { return implode(',', $this->items); } /** * Tests if header has given value. */ public function has(string $value): bool { return isset($this->items[$value]); } /** * Returns given value's item, if exists. */ public function get(string $value): ?AcceptHeaderItem { return $this->items[$value] ?? $this->items[explode('/', $value)[0].'/*'] ?? $this->items['*/*'] ?? $this->items['*'] ?? null; } /** * Adds an item. * * @return $this */ public function add(AcceptHeaderItem $item): static { $this->items[$item->getValue()] = $item; $this->sorted = false; return $this; } /** * Returns all items. * * @return AcceptHeaderItem[] */ public function all(): array { $this->sort(); return $this->items; } /** * Filters items on their value using given regex. */ public function filter(string $pattern): self { return new self(array_filter($this->items, fn (AcceptHeaderItem $item) => preg_match($pattern, $item->getValue()))); } /** * Returns first item. */ public function first(): ?AcceptHeaderItem { $this->sort(); return $this->items ? reset($this->items) : null; } /** * Sorts items by descending quality. */ private function sort(): void { if (!$this->sorted) { uasort($this->items, function (AcceptHeaderItem $a, AcceptHeaderItem $b) { $qA = $a->getQuality(); $qB = $b->getQuality(); if ($qA === $qB) { return $a->getIndex() > $b->getIndex() ? 1 : -1; } return $qA > $qB ? -1 : 1; }); $this->sorted = true; } } }
Upload File
Create Folder