1 | <?php |
||
18 | class Request extends \yii\web\Request |
||
19 | { |
||
20 | /** |
||
21 | * @var boolean Force web request to enable unit tests with simulated web requests |
||
22 | */ |
||
23 | public $forceWebRequest = false; |
||
24 | |||
25 | /** |
||
26 | * @var string The validation cookie for cookies, should be overwritten in your configuration. |
||
27 | * |
||
28 | * The cookie validation key is generated randomly or by any new release but should be overriten in your config. |
||
29 | * |
||
30 | * http://randomkeygen.com using a 504-bit WPA Key |
||
31 | */ |
||
32 | public $cookieValidationKey = '(`1gq(|TI2Zxx7zZH<Zk052a9a$@l2EtD9wT`lkTO@7uy{cPaJt4y70mxh4q(3'; |
||
33 | |||
34 | /** |
||
35 | * @var array A list of default available parsers. |
||
36 | */ |
||
37 | public $parsers = [ |
||
38 | 'application/json' => 'yii\web\JsonParser', |
||
39 | ]; |
||
40 | |||
41 | private $_isAdmin; |
||
42 | |||
43 | /** |
||
44 | * Setter method to force isAdmin request. |
||
45 | * |
||
46 | * @param boolean $state Whether its an admin request or not |
||
47 | */ |
||
48 | public function setIsAdmin($state) |
||
52 | |||
53 | /** |
||
54 | * Getter method resolves the current url request and check if admin context. |
||
55 | * |
||
56 | * This is mostly used in order to bootstrap more modules and application logic in admin context. |
||
57 | * |
||
58 | * @return boolean If the current request is in admin context return value is true, otherwise false. |
||
59 | */ |
||
60 | public function getIsAdmin() |
||
90 | |||
91 | /** |
||
92 | * Get the user client language. |
||
93 | * |
||
94 | * @param string $defaultValue Return if not set. |
||
95 | * @return string |
||
96 | */ |
||
97 | public function getClientLanguage($defaultValue) |
||
101 | } |
||
102 |