Just Launched: You can now import projects and releases from Google Code onto SourceForge
We are excited to release new functionality to enable a 1-click import from Google Code onto the Allura platform on SourceForge. You can import tickets, wikis, source, releases, and more with a few simple steps. Read More
From: Patrick Mineault <lists@5e...> - 2005-07-21 16:13:17
So after my failed attempt at getting a debug gateway to work using cURL
I decided to use PEAR HTTP request to try and get this to work as
suggested on list. Turns out that underneath all the fluff it simply
uses fsockopen and I quickly came up with this:
* The debug gateway is a simple gateway that calls the real gateway and
then checks if
* the outgoing message is correctly formatted. If not, it wraps the
message into a correctly
* formatted message, so that even fatal errors are caught. It is highly
* the the real gateway be called directly for production use.
* This gateway requires CURL to work properly
if(strpos($_SERVER['PHP_SELF'], '/') === FALSE)
$newGateway = "/gateway.php";
$parts = explode('/', $_SERVER['PHP_SELF']);
$newGateway = implode('/', $parts) . '/gateway.php';
$newGateway .= "?" . ini_get('session.name') . "=" . session_id();
$headers = array();
$headers = "POST /$newGateway HTTP/1.0";
$headers = "Accept: */*";
$headers = "x-flash-version: 7,0,19,0";
$headers = "Content-Type: application/x-amf";
$headers = "Content-Length: " . strlen($HTTP_RAW_POST_DATA);
$headers = "Host: " . $_SERVER['HTTP_HOST'];
$headers = "Pragma: no-cache";
$headers = "Connection: Close";
$data = "";
$sock = fsockopen($_SERVER['HTTP_HOST'], 80, $err, $errno, 2);
fwrite($sock, implode("\r\n", $headers) . "\r\n\r\n" . $HTTP_RAW_POST_DATA);
$data = stream_get_contents($sock);
$fp = fopen('c:\php\dump\amfdump.txt', 'w');
Now the original gateway gets called with the right data... But when
testing it out live it simply hangs... I have the impression that the
connection is made and everything's executed but it's never dropped.
Anybody clueful about sockets help me out here?
From: . m a r c o s a u g u s t o <chadart@gm...> - 2005-07-22 17:55:18
I'm joining you guys, .....i'm from brasil.... so... hi everyone..
Whas is the better way to connect and have debug..
like... I 'm testing the remotConnector (from Patrick amfphp) and I
don't see nothing in debugger...that right ?
I'm using the as1 aproach too... but I heard about the as2 way...
what should I learn ?
. m a r c o s a u g u s t o ;