1564e09e3987c7063c5c44ce13c6f9a01ae7b528
[mistral.git] / examples / hello_world.php
blob1564e09e3987c7063c5c44ce13c6f9a01ae7b528
1 <?php
2 function my_cool_callback($requests) {
3 /* Takes as argument: status_code, body, and all other headers. The above, string based still works too. */
5 return array('status_code' => '200 OK', 'connection' => 'close', 'content-type' => 'text/plain', 'body' => print_r($requests, true));
8 # Bind Webserver on all ips with port 8081, timeout > 0 == keep-alive
9 mistral_init('0.0.0.0', 8081, 0);
11 # Setup callback function which gets called after each client request
12 mistral_register_callback("my_cool_callback");
14 # Start serving
15 mistral_start();