3 if(file_exists("config.php")) {
4 require_once("config.php");
6 // config file doesnt exist, we must abort sensibly
9 // get out master library for ga4php
10 require_once("../lib/lib.php");
14 // first we want to fork into the background like all good daemons should
15 //$pid = pcntl_fork();
21 // i am the parent, i shall leave
22 echo "i am a parent, i leave\n";
27 /// ok, this is just testing stuff... create queue
28 global $MSG_QUEUE_KEY_ID_SERVER, $MSG_QUEUE_KEY_ID_CLIENT;
32 $cl_queue = msg_get_queue($MSG_QUEUE_KEY_ID_CLIENT, 0666 | 'IPC_CREAT');
33 $sr_queue = msg_get_queue($MSG_QUEUE_KEY_ID_SERVER, 0666 | 'IPC_CREAT');
42 msg_receive($sr_queue, 0, $msg_type, 16384, $msg);
43 echo "Got message $msg_type\n";
47 echo "got auth message, $msg\n";
48 $username = $msg["user"];
49 $passcode = $msg["passcode"];
51 msg_send($cl_queue, MSG_AUTH_USER, $myga->authenticateUser($username, $passcode));
55 $username = $msg["username"];
57 msg_send($cl_queue, MSG_ADD_USER, $myga->setUser($username));
65 echo "Back to wait\n";