Home

Introduction

Amfphp is an RPC toolkit for PHP. It allows seamless communication between Php and :

  • Flash and Flex with Remoting
  • JavaScript and Ajax with JSON
  • XML clients with XML-RPC

What’s RPC?

RPC (Remote Procedure Call) is a way to communicate data between a client and a server. You call a method on a local object with various parameters, set a callback, and receive a result. You don’t have to worry about how you’re going to send and receive the data. The server and the client, say php and Flash, agree on a common way of describing method calls and complex data. The implementation details are abstracted away so that it looks as though you’re calling a local method.

Amfphp lets you focus on features instead of implementation details. Testing remote services can be tricky, so amfphp has a built-in service browser which lets you test your services before you start writing the front end, and allows you to generate code for various clients. You can check it out here.

Design philosophy

Amfphp was designed with a few simple goals in mind:

  • Nothing required – PHP4/PHP5 compatible, no extensions needed
  • Low footprint, lightweight, fast
  • Convention over configuration (service and class mapping)
  • Can be embedded into a framework (see CakeAmfphp, Seagull)
  • Services are “non-specific” PHP classes that are portable to anything without code change
  • Productivity tools included (service browser, code gen, profiling)
  • Batteries included – XML-RPC, JSON
  • Not a framework by itself (use your own)