namespace safmq_php
PHP functions to access SAFMQ.
Child Classes
PHP functions to access SAFMQ. The following is a sample PHP script to access
a SAFMQ server.
<?
$con = safmq_open("safmq://localhost","mylogin","mypassword");
if ($con !== false) {
$queue = safmq_open_queue("myqueue",$con);
if ($queue !== false) {
$msg = safmq_msg();
$msg->Label = "Hello World";
$msg->Body = "Hello to all the world";
if (safmq_enqueue($msg,$queue,$con)) {
printf("The message was sent!\n");
} else {
printf("The message was not sent!\n");
}
$msg = false;
$msg = safmq_retrieve(true,-1,$queue,$con);
if ($msg !== false) {
printf("Message Retrieved\n");
printf("Label: %s\n", $msg->Label);
printf("Body: %s\n", $msg->Body);
printf("Timestamp: %s\n", strftime("%Y-%m-%d %H:%M:%S",$msg->TimeStamp));
printf("ID: %s\n", $msg->MessageID);
} else {
printf("Unable to retrieve message\n");
}
} else {
printf("Could not open myqueue\n");
}
safmq_close($con);
} else {
printf("Connect connect to localhost\n");
}
?>
Enumerations (enums), Unions, & Structures
Objects
Functions
con Connection resource.
con Connection resource.
Member Documentation
Table of Contents HTML hierarchy of classes or Java