Created final (I hope) version of the API entry file.
This commit is contained in:
parent
627f2fd875
commit
244aaa00fe
38
json_sms.php
38
json_sms.php
@ -5,25 +5,23 @@ require_once 'postgresGatewayBackend.php';
|
|||||||
|
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
//$request_body = file_get_contents('php://input');
|
try
|
||||||
|
{
|
||||||
|
$backend = new postgresGatewayBackend('localhost', 'sms_gateway', 'quaiy8Zu', 'sms_gateway');
|
||||||
|
}
|
||||||
|
catch (PDOException $e)
|
||||||
|
{
|
||||||
|
header('Status: 500 Internal Server Error');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
//$json = json_decode($request_body);
|
try
|
||||||
|
{
|
||||||
|
$smsSender = new smsSender(session_id(), $backend);
|
||||||
|
}
|
||||||
|
catch (Exception $e)
|
||||||
|
{
|
||||||
|
header('Status: 500 Internal Server Error');
|
||||||
|
}
|
||||||
|
|
||||||
/* Begin debug dump */
|
jsonRPCServer::handle($smsSender);
|
||||||
|
|
||||||
$fd = fopen("/tmp/jsonrpc-test", "w");
|
|
||||||
|
|
||||||
fwrite($fd, "\$_SERVER = " . var_export($_SERVER, true) . "\n\n");
|
|
||||||
fwrite($fd, "\$_GET = " . var_export($_GET, true) . "\n\n");
|
|
||||||
fwrite($fd, "\$_POST = " . var_export($_POST, true) . "\n\n");
|
|
||||||
fwrite($fd, "\$_FILES = " . var_export($_FILES, true) . "\n\n");
|
|
||||||
fwrite($fd, "\$_SESSION = " . var_export($_SESSION, true) . "\n\n");
|
|
||||||
//fwrite($fd, "\$request_body = '" . $request_body . "';\n");
|
|
||||||
//fwrite($fd, "\$json = '" . $json . "';\n");
|
|
||||||
|
|
||||||
/* End debug dump */
|
|
||||||
|
|
||||||
$smsSender = new smsSender(session_id());
|
|
||||||
jsonRPCServer::handle($smsSender) or fwrite($fd, "No Request\n");
|
|
||||||
|
|
||||||
fclose($fd);
|
|
Loading…
Reference in New Issue
Block a user