Skip to content
This repository has been archived by the owner on Nov 21, 2019. It is now read-only.

Commit

Permalink
put the request into a global so the rescuer can see it
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs committed Nov 10, 2011
1 parent a2612e7 commit 8ddb24c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions interfaces/apache.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ interface apache with halfmoon and route the request via $QUERY_STRING

require_once(__DIR__ . "/../lib/halfmoon.php");

$req = new HalfMoon\Request(
global $_HALFMOON_REQUEST;
$_HALFMOON_REQUEST = new HalfMoon\Request(
$_SERVER["SCRIPT_URI"] . (empty($_SERVER["QUERY_STRING"]) ? ""
: "?" . $_SERVER["QUERY_STRING"]),
$_GET, $_POST, $_SERVER, $start_time
);
$req->process();
$_HALFMOON_REQUEST->process();

?>
4 changes: 3 additions & 1 deletion lib/rescue.ptxt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ print str_repeat("-", 75) . "\n";
print "\n";
print " HALFMOON_ROOT: " . HALFMOON_ROOT . "\n";

if (!is_null($request)) {
if (!is_null($GLOBALS["_HALFMOON_REQUEST"])) {
$request = $GLOBALS["_HALFMOON_REQUEST"];

print " URL: " . $request->url . "\n";
print " Remote IP: " . $request->remote_ip() . "\n";
print "\n";
Expand Down

0 comments on commit 8ddb24c

Please sign in to comment.