From: Andrey Kutejko Date: Sun, 28 Jul 2013 11:56:29 +0000 (+0300) Subject: add README X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=bfb8b2eda5d83325be2a2bb985c344e5945e40b7;p=ipf-xmlrpc.git add README --- diff --git a/README.org b/README.org new file mode 100644 index 0000000..4a9022d --- /dev/null +++ b/README.org @@ -0,0 +1,32 @@ +#+TITLE: IPF XML-RPC + +XML-RPC engine extracted from IPF web framework + +* Example + + #+BEGIN_SRC php + function Api_Views_Handler($request, $match) + { + $server = new IPF_XmlRpc_Server(); + + $server->addFunction('getCustomers'); + $server->addFunction('getProducts'); + + return new IPF_Http_Response($server->handle()); + } + + function getCustomers() + { + return IPF_ORM_Manager::connection()->fetchAll('select * from customer'); + } + + function getProducts($parameters) + { + $customer = (int)$parameters['customer']; + $query = 'select * from product'; + if ($customer) + $query .= ' where customer_id = ' . $customer; + return IPF_ORM_Manager::connection()->fetchAll($query); + } + #+END_SRC +