Skip to content

Commit d2d07ae

Browse files
committed
If needed, Bypass directive auto_globals_jit
1 parent eac2a14 commit d2d07ae

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Router.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
*/
3030
class Router
3131
{
32-
const VERSION = '3.0.5.pre.0';
32+
const VERSION = '3.0.5.pre.1';
3333

3434
private $control = '';
3535
private $forceSlash = false;
@@ -46,8 +46,6 @@ class Router
4646
*/
4747
public function __construct()
4848
{
49-
/** @noinspection PhpExpressionResultUnusedInspection */
50-
$_SERVER; // Bypass auto_globals_jit and populate _SERVER into GLOBALS
5149
// Get the Base of the URI, without 'index.php'
5250
$this->uriBase = strtr($this->getServer('SCRIPT_NAME'), ['index.php' => '']);
5351
// make Relative URI - remove query string from the request (everything after ?)
@@ -60,6 +58,11 @@ public function __construct()
6058
$this->uri = $this->getUriArray($this->uriRelative);
6159
// directory depth of current request
6260
$this->uriCount = count($this->uri);
61+
// If needed, Bypass directive auto_globals_jit
62+
if (!isset($GLOBALS['_SERVER'])) {
63+
/** @noinspection PhpExpressionResultUnusedInspection */
64+
$_SERVER; // force compiler to populate _SERVER into GLOBALS
65+
}
6366
}
6467

6568
/**

0 commit comments

Comments
 (0)