<?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>Sun, 12 Feb 2012 20:38:09 -0600</pubDate>
    <ttl>30</ttl>
    <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[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[ZendCasts.com: SLIMming Out Your Controller]]></title>
      <guid>http://www.phpdeveloper.org/news/17007</guid>
      <link>http://www.phpdeveloper.org/news/17007</link>
      <description><![CDATA[<p>
On the ZendCasts.com site today, they branch out from just talking about Zend Framework-related topics and take a look at he <a href="http://www.slimframework.com/">Slim micro-framework</a> in <a href="http://www.zendcasts.com/slimming-out-your-controller/2011/10/">this new screencast</a>.
</p>
<p>
He introduces the framework as a light-weight, easy to use tool that doesn't include "all of that extra stuff". He walks you through the creation of a (very) simple site that includes some basic templating too. At the end of the screencast he hints at the next part of the series - creating a simple JSON endpoint as a RESTful web service.
</p>
<p>
You can find out more about the Slim framework <a href="http://www.slimframework.com/">on its site</a> that includes documentation and a <a href="http://dev.slimframework.com/phpdocs/">PHPDoc generated manual</a> for every part of the code.
</p>]]></description>
      <pubDate>Tue, 18 Oct 2011 11:02:58 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso's Blog: Building a small microframework with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16756</guid>
      <link>http://www.phpdeveloper.org/news/16756</link>
      <description><![CDATA[<p>
In investigating microframeworks and some of the offerings out there <i>Gonzalo Ayuso</i> has done a little exploring of his own. He's <a href="http://gonzalo123.wordpress.com/2011/08/22/building-a-small-microframework-with-php/">worked up a basic microframework</a> and shared it in a new post as a sort of academic exercise.
</p>
<blockquote>
Nowadays microframewors are very popular. Since Blake Mizerany created <a href="http://www.sinatrarb.com/">Sinatra</a> (Ruby), we have a lot of Sinatra clones in PHP world. Probably the most famous (and a really good one) is <a href="http://silex-project.org/">Silex</a>. But we also have several ones, such as <a href="http://www.limonade-php.net/">Limonade</a>, <a href="http://gluephp.com/">GluePHP</a> and <a href="http://www.slimframework.com/">Slim</a>. Those frameworks are similar. 
</blockquote>
<p>
He looks at how several of these frameworks handle routing and setup, mostly using the closures/anonymous function callbacks available in PHP 5.3. His <a href="https://github.com/gonzalo123/microFramework">simple example framework</a> does some basic URI handling to find the requested module, class and function (action) to call. You can even define the output format from options like json, txt, css, js and jsonp. A sample "controller" is included with a "Hello world" and there's a mention of some other options he's exploring including <a href="http://twig-project.org">Twig</a> and <a href="https://github.com/kriswallsmith/assetic">Assetic</a> integration.
</p>]]></description>
      <pubDate>Tue, 23 Aug 2011 09:48:27 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Blitz Agency Blog: REST Service Routing with PHP and Apache]]></title>
      <guid>http://www.phpdeveloper.org/news/15464</guid>
      <link>http://www.phpdeveloper.org/news/15464</link>
      <description><![CDATA[<p>
New on the Blitz Agency blog <i>Adam Venturella</i> <a href="http://labs.blitzagency.com/?p=2494">walks you through his process</a> of creating a simple REST service routing system with the PHP and Apache combination that has the same concepts as <a href="http://www.sinatrarb.com/">Sinatra</a> routing.
</p>
<blockquote>
This is just a quickie.  I had spent some time creating a routing system in PHP for services.  The goal was to bypass .htaccess or a vhost configuration file.  Basically, I wanted to map endpoints (HTTP methods + paths) to PHP methods. My goal at the time was something similar to Sinatra and/or MVC2 routes.
</blockquote>
<p>
He shows examples from both the Sinatra documentation and a code example from a <a href="http://www.asp.net/mvc">MVC2</a> project that uses the same ideas. His first show with PHP proved to not quite be the right way, so he opted for a combination of Apache mod_rewrite and some PHP to take the mapped values and execute. It also includes support fo rthe "X-HTTP-Method-Override" header if you happen to need it.
</p>]]></description>
      <pubDate>Fri, 19 Nov 2010 12:12:55 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Zend Developer Zone: Zend Framework Routing with XML]]></title>
      <guid>http://www.phpdeveloper.org/news/14512</guid>
      <link>http://www.phpdeveloper.org/news/14512</link>
      <description><![CDATA[<p>
On the Zend Developer Zone today there's <a href="http://devzone.zend.com/article/12122-Zend-Framework-Routing-with-XML">a new tutorial</a> looking at creating custom routing with the help of XML for your <a href="http://framework.zend.com">Zend Framework</a> application.
</p>
<blockquote>
If you use Zend Framework you probably used the initRoutes() function in your Initializer.php to create nice URI's and creating some different routing in your application. To create a customized route for your application you can use the <A href="http://framework.zend.com/manual/en/zend.controller.router.html">Zend_Controller_Router_Route</a> class from the Zend Framework. 
</blockquote>
<p>
The tutorial shows you the code you'll need in your application, a sample XML document with some custom routes defined, the class to read it all in and the initializer to get the ball rolling. 
</p>]]></description>
      <pubDate>Fri, 14 May 2010 08:31:29 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[The Bakery: CakePHP's routing explained]]></title>
      <guid>http://www.phpdeveloper.org/news/13463</guid>
      <link>http://www.phpdeveloper.org/news/13463</link>
      <description><![CDATA[<p>
New on The Bakery there's <a href="http://bakery.cakephp.org/articles/view/cakephp-s-routing-explained">an article explaining</a> some of the inner workings of the CakePHP framework - its routing system.
</p>
<blockquote>
Routing in CakePHP is a very powerful feature and is used to make URLs look good. Experience in the #cakephp IRC support channel tells me it appears to be hard to grasp even though the book is quite complete. This article should change that a bit and discuss the main features of routing. Comments below asking for support will be ignored, to get support, there is the Google group and the #cakephp IRC channel.
</blockquote>
<p>
They look at some of the default routes built into the framework, how to create custom routes with named elements (and passing parameters into the action for them) as well as tips on setting up match conditions and prefix routing. Code samples are included.
</p>]]></description>
      <pubDate>Mon, 02 Nov 2009 08:28:59 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Matt Curry's Blog: 8 Ways to Speed Up CakePHP Apps]]></title>
      <guid>http://www.phpdeveloper.org/news/12160</guid>
      <link>http://www.phpdeveloper.org/news/12160</link>
      <description><![CDATA[<p>
<i>Matt Curry</i> has <a href="http://www.pseudocoder.com/archives/2009/03/17/8-ways-to-speed-up-cakephp-apps/">a new post</a> to his blog listing a few ways that you can help get the most out of your CakePHP application's performance.
</p>
<blockquote>
It's a not so well kept secret that CakePHP is slow. What isn't well know is that this is done by design. I could get in a lot of trouble by revealing this, but I'm willing to take that risk. [...] Every time you use one of the tips in this article it's one less gold chain on the neck of a Cake developer.
</blockquote>
<p>Here's his list of eight tips:</p>
<ul>
<li>Set Debug to 0
<li>Cache your slow queries/web service requests/whatever
<li>View Caching
<li>HTML Caching
<li>APC (or some other opcode cache)
<li>Persistent Models
<li>Store The Persistent Cache in APC
<li>Speed Up Reverse Routing
</ul>
<p>
Some of the tips are CakePHP specific, but several of them (the caching) can be useful no matter what sort of application you're using - framework or not.
</p>]]></description>
      <pubDate>Wed, 18 Mar 2009 10:23:26 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Echolibre Blog: Customising Zend Framework Routing]]></title>
      <guid>http://www.phpdeveloper.org/news/12131</guid>
      <link>http://www.phpdeveloper.org/news/12131</link>
      <description><![CDATA[<p>
On the echolibre blog <i>J.D.</i> has <a href="http://blog.echolibre.com/2009/03/customising-zend-framework-routing/">made a new post</a> looking at Zend Framework routing and how you can customize it to get the user where they need to go.
</p>
<blockquote>
I wanted to write a post that shows a few different ways to customise Zend Frameworks routing when you're using their MVC implementation. Most of this is covered in the <a href="http://framework.zend.com/manual/en/zend.controller.router.html">documentation</a>, but it can be a little difficult to dig out.
</blockquote>
<p>
He starts with the normal routing setup (the standard /module/controller/action and /controller/action setups) and moves on to the "magic" - a way to have a standard "framework URL" without having to include an action. He sets up a route with a wildcard to catch anything for that controller and passes it off to a custom router that goes through the request values and returns the values as though they were formatted normally in the URL.
</p>]]></description>
      <pubDate>Fri, 13 Mar 2009 10:23:04 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Make Me Pulse: Using the Zend Framework URL rewriting]]></title>
      <guid>http://www.phpdeveloper.org/news/11743</guid>
      <link>http://www.phpdeveloper.org/news/11743</link>
      <description><![CDATA[<p>
New from the Make Me Pulse blog is <A href="http://blog.makemepulse.com/2009/01/15/using-the-zend-framework-url-rewriting/">this quick tutorial</a> about bending the URL rewriting that the Zend Framework does to match whatever your needs might be.
</p>
<blockquote>
Today for a good website's referencement in Google, it's necessary to have an URL rewriting. [...] If your application is based on ZF, we have a htaccess base file which will redirect all php files to the boostrap (<a href="http://framework.zend.com/docs/quickstart/create-a-bootstrap-file">what is the bootstrap ?</a>), and ZF classes will manage all redirection rules. How to implement the URL rewriting with ZF classes ?
</blockquote>
<p>
He sets up a config file (an ini file) with the routing instructions the framework will need to adhere to and shows how to get the application to include it and match against it for routing rules. His example sets a default route and several regular expression-based routes to remap requests right where they need to go.
</p>]]></description>
      <pubDate>Thu, 15 Jan 2009 07:55:15 -0600</pubDate>
    </item>
  </channel>
</rss>

