<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Sat, 25 May 2013 16:07:05 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Matthew Weier O'Phinney: RESTful APIs with ZF2, Part 1]]></title>
      <guid>http://www.phpdeveloper.org/news/19170</guid>
      <link>http://www.phpdeveloper.org/news/19170</link>
      <description><![CDATA[<p>
<i>Matthew Weier O'Phinney</i> has posted <a href="http://www.mwop.net/blog/2013-02-11-restful-apis-with-zf2-part-1.html">the first part</a> of a new series he's been working on about creating RESTful APIs with the help of Zend Framework v2. In this part, he looks at things like the "Richardson Maturity Model" and "Hypertext Application Language" as parts of development of the API too.
</p>
<blockquote>
RESTful APIs have been an interest of mine for a couple of years, but due to <a href="http://framework.zend.com/blog//zend-framework-2-0-0-stable-released.html">circumstances</a>, I've not had much chance to work with them in any meaningful fashion until recently. <a href="http://akrabat.com/">Rob Allen</a> and I proposed a workshop for <a href="http://conference.phpbenelux.eu/2013/">PHP Benelux 2013</a> covering RESTful APIs with ZF2. When it was accepted, it gave me the perfect opportunity to dive in and start putting the various pieces together.
</blockquote>
<p>
After going over the "Richardson Maturity Model" for the REST structure he spends the rest of the post looking at HAL ("Hypertext Application Language") structure and examples. He mentions the media types it uses, how it handles links between resources and how to embed a resource into the resulting response.
</p>]]></description>
      <pubDate>Tue, 12 Feb 2013 11:40:26 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[NetTuts.com: Laravel 4: A Start at a RESTful API]]></title>
      <guid>http://www.phpdeveloper.org/news/19143</guid>
      <link>http://www.phpdeveloper.org/news/19143</link>
      <description><![CDATA[<p>
On NetTuts.com today they've posted the start of a new series looking at the <a href="http://net.tutsplus.com/tutorials/php/laravel-4-a-start-at-a-restful-api/">creation of a RESTful API</a> with the help of the <a href="http://four.laravel.com">Laravel 4</a> framework (in beta at the time of this post).
</p>
<blockquote>
RESTful API's are hard! There are a lot of aspects to designing and writing a successful one. For instance, some of the topics that you may find yourself handling include authentication, hypermedia, versioning, rate limits, and content negotiation. Rather than tackling all of these concepts, however, let's instead focus on the basics of REST. We'll make some JSON endpoints behind a basic authentication system, and learn a few Laravel 4 tricks in the process.
</blockquote>
<p>
Their API example is a "read it later" kind of application where users can store links to URLs they want to read later. They walk you through the installation of the framework, creation/configuration of the database and include the migrations to set it up. From there they help you set up the models, some authentication and routing. Finally, they get to the controllers and the functionality of the application, creating the URL controller to handle the creation, listing and updating of the resources. 
</p>]]></description>
      <pubDate>Wed, 06 Feb 2013 10:37:10 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Lorna Mitchell: Five Clues That Your API isn't RESTful]]></title>
      <guid>http://www.phpdeveloper.org/news/19078</guid>
      <link>http://www.phpdeveloper.org/news/19078</link>
      <description><![CDATA[<p>
<i>Lorna Mitchell</i> has <a href="http://www.lornajane.net/posts/2013/five-clues-that-your-api-isnt-restful">posted a quick checklist</a> of things you can ask about your API to see if it's RESTful or not (five of them):
</p>
<blockquote>
I get a lot of emails asking me to get involved with API projects, and that means I see a lot of both implemented and planned "RESTful" APIs. [...] A service of some other description may work better for other scenarios or skill sets, and non-RESTful services can be very, very useful. If you tell me that your service is RESTful, then I expect it to be. If you're not sure, look out for these clues:
</blockquote>
<ul>
<li>It has a single endpoint
<li>All requests are POSTs
<li>Response metadata is in the body, not header
<li>There are verbs in the URL
<li>The URL includes method names
</ul>
<p>
She suggests, though, that "being RESTful" isn't a requirement for "being useful" when it comes to APIs. 
</p>]]></description>
      <pubDate>Wed, 23 Jan 2013 10:50:49 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Lorna Mitchell's Blog: Building A RESTful PHP Server: Output Handlers]]></title>
      <guid>http://www.phpdeveloper.org/news/17478</guid>
      <link>http://www.phpdeveloper.org/news/17478</link>
      <description><![CDATA[<p>
<i>Lorna Mitchell</i> is back with another post in her "Building a RESTful PHP Server" series today with <a href="http://www.lornajane.net/posts/2012/building-a-restful-php-server-output-handlers">this new post</a> showing how to work with output handlers (her focus is on JSON).
</p>
<blockquote>
So far we've covered parsing requests to determine exactly what the user is asking for, and also looked at routing to a controller to obtain the data or perform the action required. This post gives examples of how to return the data to the client in a good way.
</blockquote>
<p>
She advocates using output handlers instead of the usual views you'd think of in a typical MVCish sort of application. The difference here is that there's not a lot of extra overhead to produce the results - it's literally an output directly from a class extending the base view (including the correct headers). She also briefly mentions the inclusion of <a href="http://en.wikipedia.org/wiki/JSONP">JSONP</a> functionality, allowing you to specify a local callback to execute when the request is returned. A few other "nice to haves" are also mentioned like the number of results returned and pagination support.
</p>]]></description>
      <pubDate>Wed, 01 Feb 2012 10:25:33 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Lorna Mitchell's Blog: Building A RESTful PHP Server: Routing the Request]]></title>
      <guid>http://www.phpdeveloper.org/news/17433</guid>
      <link>http://www.phpdeveloper.org/news/17433</link>
      <description><![CDATA[<p>
<i>Lorna Mitchell</i> is back with a second installment in her "Building a RESTful PHP Server" series with <a href="http://www.lornajane.net/posts/2012/building-a-restful-php-server-routing-the-request">this new post</a> about handling and routing the incoming requests. (You can find the first part about working with the request <a href="http://phpdeveloper.org/news/17418">here</a>)
</p>
<blockquote>
This is the second part of a series, showing how you might write a RESTful API using PHP. This part covers the routing, autoloading, and controller code for the service, and follows on from the first installment which showed how to parse the incoming request to get all the information you need.
</blockquote>
<p>
She shows how to grab the controller name from the incoming request (based on her previous code), create the object for it and execute the requested action name. Also included is a sample autoloader and a basic controller - a UsersController with "getAction" and "postAction" 
 methods for responding to GET and POST requests.
</p>]]></description>
      <pubDate>Mon, 23 Jan 2012 11:14:11 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Lorna Mitchell's Blog: Building A RESTful PHP Server: Understanding the Request]]></title>
      <guid>http://www.phpdeveloper.org/news/17418</guid>
      <link>http://www.phpdeveloper.org/news/17418</link>
      <description><![CDATA[<p>
In <a href="http://www.lornajane.net/posts/2012/building-a-restful-php-server-understanding-the-request">this new post</a> to her blog <i>Lorna Mitchell</i> starts off a new series (based on popular demand) looking at building an RESTful server in PHP. Back to basics - no framework, just PHP.
</p>
<blockquote>
In the first part of this (probably) 3-part series, we'll begin with the basics. It might seem boring, but the most important thing to get right with REST is parsing all the various elements of the HTTP request and responding accordingly. I've put in code samples from from a small-scale toy project I created to make me think about the steps involved.
</blockquote>
<p>Her "basics" include:</p>
<ul>
<li>the routing to send everything to the main index file (a "front controller" of sorts) with the .htaccess settings included
<li>Handling the incoming request with a "Request" class
<li>Parsing the incoming parameters from the "php://input" stream
</p>]]></description>
      <pubDate>Thu, 19 Jan 2012 10:02:18 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPBuilder.com: Building RESTful Web Services with the Zend Framework]]></title>
      <guid>http://www.phpdeveloper.org/news/17120</guid>
      <link>http://www.phpdeveloper.org/news/17120</link>
      <description><![CDATA[<p>
New on PHPBuilder.com today is a tutorial introducing you to <a href="http://www.phpbuilder.com/columns/RESTful_Web_Services_with_Zend/RESTful_Web_Services_with_Zend_11-03-2011.php3">web services with the Zend Framework</a>, a guide to creating a simple RESTful service with this popular PHP framework.
</p>
<blockquote>
Rather than attempt to build and maintain multiple versions of the Web application in order to accommodate the diverse array of challenges and advantages presented by each device type, developers are increasingly embracing a unified approach which allows them to manage a single server-side code base which communicates with multiple client-specific interfaces by way of a RESTful Web service. The Zend Framework's <a href="http://framework.zend.com/manual/en/zend.rest.html">Zend_Rest</a> component offers PHP developers with an incredibly straightforward approach to building RESTful Web services. 
</blockquote>
<p>
He shows how to set up some internal RESTful routing (with the help of <a href="http://framework.zend.com/manual/en/zend.controller.router.html#zend.controller.router.routes.rest">Zend_Rest_Route</a>) and create a simple controller that responds to several of the major HTTP request types - POST, GET, PUT, etc. In his simple example, he shows how to update a basic TODO list with a POST and the JSON response that would follow.
</p>]]></description>
      <pubDate>Fri, 11 Nov 2011 11:37:45 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPBuilder.com: Building RESTful APIs with the Slim Microframework]]></title>
      <guid>http://www.phpdeveloper.org/news/16958</guid>
      <link>http://www.phpdeveloper.org/news/16958</link>
      <description><![CDATA[<P>
On PHPBuilder.com today there's a new tutorial from <i>Jason Gilmore</i> about building a <a href="http://www.phpbuilder.com/columns/RESTfulAPIs/RESTfulAPIs_10-04-2011.php3">simple RESTful API with Slim</a>, a microframework for PHP.
</p>
<blockquote>
Although a relatively new entrant in the PHP framework sweepstakes, I've been lately quite intrigued by <a href="https://github.com/codeguy/Slim">Slim</a>, a slick RESTful microframework modeled after Ruby's <a href="http://www.sinatrarb.com/">Sinatra</a>, which is coincidentally by far <a href="http://www.developer.com/lang/rubyrails/building-an-ajax-friendly-rest-api-with-sinatra.html">my favorite microframework</a> available for any programming language. In this article I'll show you just how easy it is to get started building a powerful RESTful API using this streamlined framework.
</blockquote>
<p>
Setup of the framework is as simple as downloading the latest copy from <a href="https://github.com/codeguy/Slim">its github repository</a>. It can then be included and used to make the simple routes in his examples. He uses a "games" request type to show how to handle GET, POST and PUT requests through Slim's simple interface.
</p>]]></description>
      <pubDate>Thu, 06 Oct 2011 10:12:07 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Kris Jordan's Blog: Towards RESTful PHP - 5 Basic Tips]]></title>
      <guid>http://www.phpdeveloper.org/news/11546</guid>
      <link>http://www.phpdeveloper.org/news/11546</link>
      <description><![CDATA[<p>
<i>Kris Jordan</i> recently posted <a href="http://www.krisjordan.com/2008/12/02/towards-restful-php-5-basic-tips/">five tips</a> to help you get a "more correct" REST interface in your application.
</p>
<blockquote>
As we entered a programmable web of applications with APIs the decision to ignore HTTP gave us problems we're still dealing with today. We have an internet full of applications with different interfaces (GET /user/1/delete vs. POST /user/delete {id=1}). With REST we can say /user/1 is a resource and use the HTTP DELETE verb to delete it. 
</blockquote>
<p>Here's the five (six?) tips:</p>
<ul>
<li>Using PUT and DELETE methods
<li>Send Custom HTTP/1.1 Headers
<li>Send Meaningful HTTP Headers
<li>Don't Use $_SESSION
<li>Test with cURL or rest-client
<li>Use a RESTful PHP Framework
</ul>]]></description>
      <pubDate>Wed, 10 Dec 2008 12:08:27 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Symfony Blog: New in symfony 1.2: Toward a RESTful architecture (Part 1)]]></title>
      <guid>http://www.phpdeveloper.org/news/10963</guid>
      <link>http://www.phpdeveloper.org/news/10963</link>
      <description><![CDATA[<p>
The symfony blog <a href="http://www.symfony-project.org/blog/2008/09/04/new-in-symfony-1-2-toward-a-restful-architecture-part-1">points out</a> more new functionality included in the latest version of the framework - a move towards a RESTful architecture.
</p>
<blockquote>
Yesterday, I have committed the first slew of changes to the routing framework. Thanks to this refactoring, developers have new opportunities to customize the routing and this will allow very cool features in the very near future. But today, let's dive into the goodness of the symfony 1.2 routing framework.
</blockquote>
<p>
He illustrates the (now built-in) routing functionality that allows you to define customized routes that can do things like pattern matching and can push the output through another external function to handle the results. He also takes a look at the sfRequestRoute component that forces the request to match the route definition 
</p>]]></description>
      <pubDate>Thu, 04 Sep 2008 12:08:49 -0500</pubDate>
    </item>
  </channel>
</rss>
