Zend_Server Class

e_schrade wrote a neat way of doing things in the ser­vice layer; Let’s take a quick look at some­thing that’s kind of neat in Zend Frame­work. I’ve been doing some work with Adobe on some arti­cles and one of them was on work­ing with mobile clients with Flash. Well, me being the masochist I did more. What I did was write an exam­ple that worked as a full web­site, an Ajax web­site, a Flash ser­vice and an XML-RPC service.

Looks like a lot, right?  Actu­ally there’s not much there.  Here’s the logic flow.

  • Is it an XMLHTTP Request and is it a POST? Cre­ate the Json server
  • Is it an AMF request? Cre­ate the AMF server
  • Is it an Xml­Rpc request? Cre­ate the Xml­Rpc server
  • Is it an XMLHTTP Request and is it a GET? Cre­ate the Ser­vice Map (for JSON-RPC 2.0)
  • If a ser­vice han­dler has been cre­ated add all of the application’s map­pers, attach the ser­vice han­dler to the request and redi­rect to the ser­vice action.

And with that you have an appli­ca­tion that can serve con­tent for mul­ti­ple dif­fer­ent types of ser­vice with almost no effort on your part.  At least.. if you copy and paste this code.

Have a good Friday!!!

via Zend_Server – zf ffh zend_server on e_schrade – zend php.

Tags:

Leave a Comment

*

Get Adobe Flash playerPlugin by wpburn.com wordpress themes