My favorites | Sign in
Project Logo
                
Feeds:
People details
Project owners:
  malterisio777

WebServices are cool, you can expose your site functionality to other sites, and consume other sites functionality through this unified interface. But, XML is a pain in the ass and slows everything down. That's why REST and JSON are preferred when developing AJAX clients.

But, when trying to consume a service from a server instance we don't have the benefit of having the data provided in a language the server natively supports. Although most server-side programming languages provide some JSON parsing functionality, it's as similar as XML parsing but without all the versatility of XML. Close but no cigar.

Following the example of JSON, I just decided to apply the same concept to server-to-server communication between PHP instances. I called it PHON (pronounced like font but silencing the ending "t" sound).

Using PHON is quite straightforward. The service provider uses var_export() to export native PHP values to PHON. The service consumer evaluates the code to recreate the values on his side. But there's the concern of having arbitrary code from another server being executed on mine, so I made this simple library to provide a secure environment for PHON consuming.

PHON package in phpclasses.org









Hosted by Google Code