X7ROOT File Manager
Current Path:
/home/gfecatvj/sites/realesbar/vendor/symfony/http-foundation
home
/
gfecatvj
/
sites
/
realesbar
/
vendor
/
symfony
/
http-foundation
/
π
..
π
AcceptHeader.php
(3.55 KB)
π
AcceptHeaderItem.php
(3.36 KB)
π
BinaryFileResponse.php
(11.78 KB)
π
CHANGELOG.md
(13.59 KB)
π
Cookie.php
(10.97 KB)
π
Exception
π
ExpressionRequestMatcher.php
(1.32 KB)
π
File
π
FileBag.php
(3.86 KB)
π
HeaderBag.php
(7.23 KB)
π
HeaderUtils.php
(7.15 KB)
π
InputBag.php
(3.47 KB)
π
IpUtils.php
(5.44 KB)
π
JsonResponse.php
(7.17 KB)
π
LICENSE
(1.04 KB)
π
ParameterBag.php
(5.39 KB)
π
README.md
(531 B)
π
RedirectResponse.php
(3 KB)
π
Request.php
(64.33 KB)
π
RequestMatcher.php
(4.48 KB)
π
RequestMatcherInterface.php
(687 B)
π
RequestStack.php
(2.31 KB)
π
Response.php
(35.98 KB)
π
ResponseHeaderBag.php
(7.82 KB)
π
ServerBag.php
(3.95 KB)
π
Session
π
StreamedResponse.php
(3.07 KB)
π
Test
π
UrlHelper.php
(3.03 KB)
π
composer.json
(1.16 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 $items = []; /** * @var bool */ private $sorted = true; /** * @param AcceptHeaderItem[] $items */ public function __construct(array $items) { foreach ($items as $item) { $this->add($item); } } /** * Builds an AcceptHeader instance from a string. * * @return self */ public static function fromString(?string $headerValue) { $index = 0; $parts = HeaderUtils::split($headerValue ?? '', ',;='); return new self(array_map(function ($subParts) use (&$index) { $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. * * @return string */ public function __toString() { return implode(',', $this->items); } /** * Tests if header has given value. * * @return bool */ public function has(string $value) { return isset($this->items[$value]); } /** * Returns given value's item, if exists. * * @return AcceptHeaderItem|null */ public function get(string $value) { return $this->items[$value] ?? $this->items[explode('/', $value)[0].'/*'] ?? $this->items['*/*'] ?? $this->items['*'] ?? null; } /** * Adds an item. * * @return $this */ public function add(AcceptHeaderItem $item) { $this->items[$item->getValue()] = $item; $this->sorted = false; return $this; } /** * Returns all items. * * @return AcceptHeaderItem[] */ public function all() { $this->sort(); return $this->items; } /** * Filters items on their value using given regex. * * @return self */ public function filter(string $pattern) { return new self(array_filter($this->items, function (AcceptHeaderItem $item) use ($pattern) { return preg_match($pattern, $item->getValue()); })); } /** * Returns first item. * * @return AcceptHeaderItem|null */ public function first() { $this->sort(); return !empty($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