Skip to content

Commit

Permalink
Merge pull request #17 from michalkleiner/pulls/14-update-bootstrap
Browse files Browse the repository at this point in the history
Update bootstrap to better align with SS
  • Loading branch information
Nathan authored Jan 7, 2019
2 parents 5356bcd + f6d0efa commit 8fb6491
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,27 @@
exit(1);
}

// Mock values to be empty if not set
if (!isset($_SERVER['REQUEST_URI'])) { $_SERVER['REQUEST_URI'] = ''; }
if (!isset($_SERVER['REQUEST_METHOD'])) { $_SERVER['REQUEST_METHOD'] = ''; }
// Ensure global $_SERVER exists
global $_SERVER;
if (!$_SERVER) {
$_SERVER = array();
}

// Mock values in the $_SERVER variable to contain data consistent with the rest of the application.
$_SERVER = array_merge(array(
'SERVER_PROTOCOL' => 'HTTP/1.1',
'HTTP_ACCEPT' => 'text/plain;q=0.5',
'HTTP_ACCEPT_LANGUAGE' => '*;q=0.5',
'HTTP_ACCEPT_ENCODING' => '',
'HTTP_ACCEPT_CHARSET' => 'ISO-8859-1;q=0.5',
'SERVER_SIGNATURE' => 'Command-line PHP/' . phpversion(),
'SERVER_SOFTWARE' => 'PHP/' . phpversion(),
'SERVER_NAME' => 'localhost',
'SERVER_ADDR' => '127.0.0.1',
'REMOTE_ADDR' => '127.0.0.1',
'REQUEST_METHOD' => 'GET',
'HTTP_USER_AGENT' => 'CLI',
), $_SERVER);

// Default application
try {
Expand Down

0 comments on commit 8fb6491

Please sign in to comment.