ILIAS  release_8 Revision v8.24
SuperGlobalDropInReplacement.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
5namespace ILIAS\HTTP\Wrapper;
6
9use LogicException;
10use OutOfBoundsException;
11
12/******************************************************************************
13 *
14 * This file is part of ILIAS, a powerful learning management system.
15 *
16 * ILIAS is licensed with the GPL-3.0, you should have received a copy
17 * of said license along with the source code.
18 *
19 * If this is not the case or you just want to try ILIAS, you'll find
20 * us at:
21 * https://www.ilias.de
22 * https://github.com/ILIAS-eLearning
23 *
24 *****************************************************************************/
31{
33
34 public function __construct(Factory $factory, array $raw_values, bool $throwOnValueAssignment = false)
35 {
36 $this->throwOnValueAssignment = $throwOnValueAssignment;
37 parent::__construct($raw_values, $factory->kindlyTo()->string());
38 }
39
43 public function offsetSet($offset, $value): void
44 {
45 if ($this->throwOnValueAssignment) {
46 throw new OutOfBoundsException("Modifying global Request-Array such as \$_GET is not allowed!");
47 }
48
49 parent::offsetSet($offset, $value);
50 }
51
55 public function offsetUnset($offset): void
56 {
57 throw new LogicException("Modifying global Request-Array such as \$_GET is not allowed!");
58 }
59}
Builds data types.
Definition: Factory.php:21
Class SuperGlobalDropInReplacement This Class wraps SuperGlobals such as $_GET and $_POST to prevent ...
__construct(Factory $factory, array $raw_values, bool $throwOnValueAssignment=false)
$factory
Definition: metadata.php:75
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...