From bfb8b2eda5d83325be2a2bb985c344e5945e40b7 Mon Sep 17 00:00:00 2001 From: Andrey Kutejko Date: Sun, 28 Jul 2013 14:56:29 +0300 Subject: [PATCH] add README --- README.org | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 README.org 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 + -- 2.49.0