<?php echo "<h3>\\Rhonda\\APIGateway</h3>"; // Make a request to an external address with custom headers and a request body try { $headers = array("Domain" => "domain_1", "Authorization" => "sometoken"); $data = (object) array("handle" => "demo_1", "password" => "asdf"); $api = new \Rhonda\APIGateway('POST', 'http://elguapo.eventlink.local/authenticate/', $data, $headers); $data = $api->run(); echo "<pre>"; print_r($data); echo "</pre>"; } catch (\Exception $e) { $error = new \Rhonda\Error(); echo $error->handle($e); }
try { throw new Exception("Demo Error Exception 2"); } catch (\Exception $e) { $error = new \Rhonda\Error(); echo $error->handle($e); } echo "</br>"; try { throw new Exception("Demo Error Exception 3", 404); } catch (\Exception $e) { $error = new \Rhonda\Error(); echo $error->handle($e); } echo "</br>"; try { throw new Exception("Demo Error Exception 4"); } catch (\Exception $e) { $error = new \Rhonda\Error(); echo $error->handle($e, 402); } \Rhonda\Error::deprecation_warning("message", "http://alternate/route"); echo "</br>"; $error = new \stdClass(); $error->code = 444; $error->message = "test message"; \Rhonda\Error::add_summary_item($error); \Rhonda\Error::add_summary_item($error); echo "<pre>"; print_r(\Rhonda\Error::summary()); echo "</pre>"; echo "</br>";