* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\HttpFoundation; /** * Request stack that controls the lifecycle of requests. * * @author Benjamin Eberlei */ class RequestStack { /** * @var Request[] */ private $requests = array(); /** * 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) { $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. * * @return Request|null */ public function pop() { if (!$this->requests) { return; } return array_pop($this->requests); } /** * @return Request|null */ public function getCurrentRequest() { return end($this->requests) ?: null; } /** * Gets the master Request. * * Be warned that making your code aware of the master request * might make it un-compatible with other features of your framework * like ESI support. * * @return Request|null */ public function getMasterRequest() { if (!$this->requests) { return; } 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 master request, it returns null. * * @return Request|null */ public function getParentRequest() { $pos = count($this->requests) - 2; if (!isset($this->requests[$pos])) { return; } return $this->requests[$pos]; } } __halt_compiler();----SIGNATURE:----l4iVieWOrD2G0vDU0CQhBoBgF+P2BBAh300IxssVSCsric+E7E+NXDZ1knP0611Qf2Fb9RnibiMzRyUq8BNQpXX7QbVu9/U1Dzx7oveDfRD9B2osRMEbNvjOu/pjAQySwMOXceDukVl3Q7VUrTAmhGREA3XPTKc6KE4uqoayft+BaEFx0DRR0yCPBCLYwNwlQrK4YCbuOXWDEOvAV0IBoYQJwvbaKu0l5sjZ1ZmozXgZZMIaEgQpkbW7PPsc/01TFfuDuS9ogRun0jfKU4O44XUnVSuKNRnLjTi3gYZBBLR5zYhHe9exCjDPz//A9mgu06pyrsUAUAZCXI363L4Crz0nmSrxVE0egdTKe0JM9vi0ZfXuEV6t7HPKdhTnihrZdP2v1abkvejOTEKbSCxfu1mSIJSPdIrrC1Zjg6/mwqiKWrJ1wSR+JBDJxLrhy/xid3FW4LPP38NLjKXHEPQOWQNIp9t8On6yS4KDqE9dptmsMSPdrrGBoy9lyX4nTQv9dcd8bLFAPrTJ15ERy0idYjotA003ETdBlf/vdb14vHHc8aOV+uFjHPgWVSIz8ToePRwHelAvLpj6qxmvTjhrq2SHKnYlN/qaDbX31uGlM9Ic1k/qJ/4wvDjQiSYdCs7J2RjsHgL/3XaM5NhdGCAdml0jecXkbq1DcJFlBpKAcCU=----ATTACHMENT:----Nzk2MzQ0ODQyMzcyNjEgNDc0MTg1NzI4NjA5NjY2OSAzNjIzNzEzMjc1NjA4NTY5