File Manager Lite
Dir:
/home/codewavebd/public_html/vendor/symfony/http-foundation
Upload
[..]
AcceptHeader.php (8.81 KB)
Edit
Rename
Del
AcceptHeaderItem.php (3.16 KB)
Edit
Rename
Del
BinaryFileResponse.php (13.19 KB)
Edit
Rename
Del
CHANGELOG.md (22.02 KB)
Edit
Rename
Del
ChainRequestMatcher.php (873 B)
Edit
Rename
Del
Cookie.php (11.53 KB)
Edit
Rename
Del
EventStreamResponse.php (2.88 KB)
Edit
Rename
Del
Exception/
Rename
Del
File/
Rename
Del
FileBag.php (3.77 KB)
Edit
Rename
Del
HeaderBag.php (6.94 KB)
Edit
Rename
Del
HeaderUtils.php (9.07 KB)
Edit
Rename
Del
InputBag.php (5.26 KB)
Edit
Rename
Del
IpUtils.php (9.34 KB)
Edit
Rename
Del
JsonResponse.php (6.45 KB)
Edit
Rename
Del
LICENSE (1.04 KB)
Edit
Rename
Del
ParameterBag.php (8.03 KB)
Edit
Rename
Del
README.md (526 B)
Edit
Rename
Del
RateLimiter/
Rename
Del
RedirectResponse.php (2.57 KB)
Edit
Rename
Del
Request.php (75.9 KB)
Edit
Rename
Del
RequestMatcher/
Rename
Del
RequestMatcherInterface.php (621 B)
Edit
Rename
Del
RequestStack.php (3.05 KB)
Edit
Rename
Del
Response.php (39.6 KB)
Edit
Rename
Del
ResponseHeaderBag.php (7.79 KB)
Edit
Rename
Del
ServerBag.php (3.92 KB)
Edit
Rename
Del
ServerEvent.php (3.3 KB)
Edit
Rename
Del
Session/
Rename
Del
StreamedJsonResponse.php (5.65 KB)
Edit
Rename
Del
StreamedResponse.php (3.57 KB)
Edit
Rename
Del
Test/
Rename
Del
UriSigner.php (7.53 KB)
Edit
Rename
Del
UrlHelper.php (3.05 KB)
Edit
Rename
Del
composer.json (1.33 KB)
Edit
Rename
Del
redisconfig.php (0 B)
Edit
Rename
Del
Edit: RequestStack.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; use Symfony\Component\HttpFoundation\Exception\SessionNotFoundException; use Symfony\Component\HttpFoundation\Session\SessionInterface; /** * Request stack that controls the lifecycle of requests. * * @author Benjamin Eberlei <kontakt@beberlei.de> */ class RequestStack { /** * @var Request[] */ private array $requests = []; /** * @param Request[] $requests */ public function __construct(array $requests = []) { foreach ($requests as $request) { $this->push($request); } } /** * Pushes a Request on the stack. * * This method should generally not be called directly as the stack * management should be taken care of by the application itself. */ public function push(Request $request): void { $this->requests[] = $request; } /** * Pops the current request from the stack. * * This operation lets the current request go out of scope. * * This method should generally not be called directly as the stack * management should be taken care of by the application itself. */ public function pop(): ?Request { if (!$this->requests) { return null; } return array_pop($this->requests); } public function getCurrentRequest(): ?Request { return end($this->requests) ?: null; } /** * Gets the main request. * * Be warned that making your code aware of the main request * might make it un-compatible with other features of your framework * like ESI support. */ public function getMainRequest(): ?Request { if (!$this->requests) { return null; } return $this->requests[0]; } /** * Returns the parent request of the current. * * Be warned that making your code aware of the parent request * might make it un-compatible with other features of your framework * like ESI support. * * If current Request is the main request, it returns null. */ public function getParentRequest(): ?Request { $pos = \count($this->requests) - 2; return $this->requests[$pos] ?? null; } /** * Gets the current session. * * @throws SessionNotFoundException */ public function getSession(): SessionInterface { if ((null !== $request = end($this->requests) ?: null) && $request->hasSession()) { return $request->getSession(); } throw new SessionNotFoundException(); } public function resetRequestFormats(): void { static $resetRequestFormats; $resetRequestFormats ??= \Closure::bind(static fn () => self::$formats = null, null, Request::class); $resetRequestFormats(); } }
Simpan