<?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:14 -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[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[XPertDeveloper.com: Get Facebook Page Detail Using Graph API and PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17338</guid>
      <link>http://www.phpdeveloper.org/news/17338</link>
      <description><![CDATA[<p>
New from the XPertDeveloper.com blog there's a tutorial showing how to <a href="http://www.xpertdeveloper.com/2012/01/facebook-page-detail-using-graph-api-and-php/">use the Facebook graph API to get page details</a> via a simple cURL request (<a href="http://pecl.php.net/curl">cURL PHP support required</a> for the example).
</p>
<blockquote>
Here is the technique to get the detail of the Facebook page with Graph API and PHP. This is the very easy method to get the Facebook page detail. So Let's see how to get this done. With this method you can get details of any Facebook page [inluding] name, picture, link, website, products, description and if the user can post to it.
</blockquote>
<p>
The sample code is only a few lines - it uses the Facebook page ID (easy to grab from the URL) and fetches a URL with it as a parameter. The output is returned as a standard PHP object with all of the properties attached (decoded from JSON). This is just one of many methods the Facebook graph API has, so check out <a href="http://graph.facebook.com">their documentation</a> for more methods and details on returned values.
</p>]]></description>
      <pubDate>Tue, 03 Jan 2012 11:06:04 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Henrik Bj&oslash;rnskov's Blog: Symfony2: Add Cross Site Request Forgery protection to login forms]]></title>
      <guid>http://www.phpdeveloper.org/news/17326</guid>
      <link>http://www.phpdeveloper.org/news/17326</link>
      <description><![CDATA[<p>
In a new post to his blog <i>Henrik Bj&oslash;rnskov</i> has a tip on <a href="http://henrik.bjrnskov.dk/symfony2-cross-site-request-forgery/">preventing cross-site request forgeries</a> in your Symfony2 forms with the help of a simple Symfony2 configuration setting.
</p>
<blockquote>
When talking with <a href="http://twitter.com/jmikola">@jmikola</a> on #Symfony-dev this afternoon we got into the subject of cross site request forgery and symfony2 login forms. And it seems that form-login already supports this but neither of us knew how it worked. So here is another quick tip. This time about securing you login form from cross site attacks.
</blockquote>
<p>
The key is to define a "csrf_provider" in your security.yml config file and point it to the "form.csrf_provider" provider. He also includes the controller and view code/templating you'll need to get the token included in the form (and validated).
</p>]]></description>
      <pubDate>Fri, 30 Dec 2011 10:28:42 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPClasses.org: Can .NET make PHP run faster than the official PHP implementation?]]></title>
      <guid>http://www.phpdeveloper.org/news/17263</guid>
      <link>http://www.phpdeveloper.org/news/17263</link>
      <description><![CDATA[<p>
On the PHPClasses blog today the question is posed "<a href="http://www.phpclasses.org/blog/post/168-Can-NET-make-PHP-run-faster-than-the-official-PHP-implementation.html">can .NET make PHP run faster than the official PHP implementation?</a>" (relating to the use of the <a href="http://www.php-compiler.net/">Phalanger</a> tool to compile PHP down to .NET assemblies.
</p>
<blockquote>
Recently Phalanger 3.0 was released introducing numerous improvements in terms of compatibility with the PHP 5.3, interoperability with .NET platform implementations including Mono on Linux, and probably most importantly performance improvements. [...] What motivated this article was that a PHP developer named Rasmus Schultz went on the php.internals mailing list and <a href="http://marc.info/?l=php-internals&m=132338706602251&w=2">proposed</a> to switch the official PHP implementation based on Zend for another based on Phalanger.
</blockquote>
<p>
<a href="http://www.phpclasses.org/blog/post/168-Can-NET-make-PHP-run-faster-than-the-official-PHP-implementation.html">The post</a> includes some benchmarking results of requests made to a WordPress instance running on various PHP platforms. The Phalanger version came in around <a href="http://www.php-compiler.net/wp-content/uploads/2011/08/wordpress-phalanger-201109-performance.png">2 seconds faster</a> (average, obviously) than the PHP FastCGI setup. Also included are two suggestions for future PHP versions (v6 anyone?) that could help the language perform even better: Thread-safety for running with less memory waste and the inclusion of a JIT (Just in time compiler - of which a few are mentioned specifically.
</p>]]></description>
      <pubDate>Thu, 15 Dec 2011 09:03:31 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Chris Hartjes' Blog: Better HTTP Request/Response in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17256</guid>
      <link>http://www.phpdeveloper.org/news/17256</link>
      <description><![CDATA[<p>
In a recent post to his blog <i>Chris Hartjes</i> looks at the idea of <a href="http://www.littlehart.net/atthekeyboard/2012/12/12/better-http-request-response-in-php/">better HTTP Request/Response functionality</a> in PHP, more than just the <a href="http://us3.php.net/manual/en/language.variables.superglobals.php">superglobal</a> handling and <a href="http://www.php.net/http">PECL HTTP extension</a> it has now.
</p>
<blockquote>
I think the fact that we have $_POST and $_GET lulls some of us into the false sense that we should have $_PUT and $_DELETE objects, since that would map to the commonly-desired set of HTTP verbs that REST likes to use. But what should be inside those things, or should we be moving towards a more Pythonesque solution where a Request object, as part of core or via a only-really-for-the-brave- PECL extension?
</blockquote>
<p>
He mentions opinions from other PHP community members (<a href="http://twitter.com/lxt">Laura Thompson</a> and <a href="http://twitter.com./auroraeosrose">Elizabeth Smith</a>) and a bit about what he (and I'm sure other developers) are looking for in a more full-featured request/response handling feature.
</p>]]></description>
      <pubDate>Wed, 14 Dec 2011 09:51:03 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Community News: Pearhub.org Needs Your Help]]></title>
      <guid>http://www.phpdeveloper.org/news/16851</guid>
      <link>http://www.phpdeveloper.org/news/16851</link>
      <description><![CDATA[<p>
<i>Christian Weiske</i> has a quick post about a handy PEAR-related project that might be in risk of fading away - <a href="http://cweiske.de/tagebuch/pearhub-adoption.htm">a plea for help with pearhub.org</a>.
</p>
<blockquote>
<a href="mailto:troelskn@gmail.com">Troels Knak-Nielsen</a>, father of <a href="http://pearhub.org/">pearhub</a>, wrote to the <a href="http://news.php.net/php.pear.dev/54493">pear-dev mailing list</a>: "Unfortunately I have absolutely no time at hand for this project and probably won't for a foreseeable time. I still think it fills a need, so I'd be happy to hand over the keys to anyone who will take it upon them to move the project forward. I'll try to assist as best as I can, but probably won't have much time to spare. But the project is fairly simple anyway, so it should be relatively easy to get the main idea."
</blockquote>
<p>
If you're interested in hosting or helping out with the project, <a href="mailto:troelskn@gmail.com">let Troels know</a>. Pearhub lets any project with a publicly facing repository be installed via a PEAR channel quickly and easily. For more information, see <a href="http://pearhub.org/faq">the project's FAQ</a>.
</p>]]></description>
      <pubDate>Tue, 13 Sep 2011 10:55:25 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Matthew Wells' Blog: Kohana and Gearman - Practical Multitasking]]></title>
      <guid>http://www.phpdeveloper.org/news/16791</guid>
      <link>http://www.phpdeveloper.org/news/16791</link>
      <description><![CDATA[<p>
<i>Matthew Wells</i> has a new post that looks at <a href="http://www.ninjapenguin.co.uk/blog/2011/08/29/kohana-and-gearman-practical-multitasking/">combining Kohana and Gearman</a> to create a system to handle large data processing without slowing down the rest of the application.
</p>
<blockquote>
A commonly identified bottleneck arises when dealing with large, 'expensive' data. This is commonly seen when an application posts a large volume of well structured data to the API (that some process must be carried out upon), before some form of structured receipt is then returned as a request response. [...] Analysing such a request tends to show high PHP CPU usage with lower database consumption. [...] The structured nature of data exchanged via an API means that we can, relatively simply and reliably, divide the submitted data and process it simultaneously with the help of a great tool called Gearman.
</blockquote>
<p>
He walks you through the entire process including his initial thoughts on what the system should be and how it should behave when the requests are made. He <a href="https://github.com/ninjapenguin/AntFarm/blob/master/application/classes/controller/farmable.php">shares the code</a> he used to implement the system - a simple worker that processes part of the request and returns the results. The command-line calls to run the worker manually for testing are also included.
</p>]]></description>
      <pubDate>Tue, 30 Aug 2011 11:39:11 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Joris de Wit's Blog: Extending different layouts for Ajax requests in Twig, Symfony2]]></title>
      <guid>http://www.phpdeveloper.org/news/16784</guid>
      <link>http://www.phpdeveloper.org/news/16784</link>
      <description><![CDATA[<p>
<i>Joris de Wit</i> has a (very) <a href="http://jorisdewit.ca/2011/08/27/extending-different-layouts-for-ajax-requests-in-twig-symfony2/">quick post</a> about a handy tip he found about switching layouts easily with <a href="http://twig-project.org">Twig</a> in his Symfony2-based application - a handy ternary sort of switch that can detect when something's an Ajax request.
</p>
<blockquote>
I just learned about the 'app' global variable in twig. It's very handy for loading a special layout for ajax requests.
</blockquote>
<p>
The "app" variable allows you get get back at some of the settings of your application and check on special things like the isXMLHttpRequest in his example. For more information about Twig and how you can add it to your application, check out <a href="http://www.twig-project.org/documentation">Twig-Project.org</a>. Using it's as simple as adding a phar.
</p>]]></description>
      <pubDate>Mon, 29 Aug 2011 11:39:34 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso's Blog: Building a client for a REST API with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16660</guid>
      <link>http://www.phpdeveloper.org/news/16660</link>
      <description><![CDATA[<p>
<i>Gonzalo Ayuso</i> has a new post to his blog showing how to <a href="http://gonzalo123.wordpress.com/2011/08/01/building-a-client-for-a-rest-api-with-php/">make a PHP-based client for a REST API</a> with the help of <a href="https://github.com/gonzalo123/GzaasApi">his handy tool</a>.
</p>
<blockquote>
Today we're going to create a library to use a simple RESTfull API for a great project called <a href="http://gzaas.com/">Gzaas</a>. [...] Ok. The API is a simple RESTfull <a href="http://gzaas.com/project/api-embed/api-general-overview/">API</a>, so we can use it with a simple curl interface. A few lines of PHP and it will run smoothly. But Gzaas is cool so we're going to create a cool interface too. This days I'm involved into TDD world, so we're going to create the API wrapper using TDD. Let's start.
</blockquote>
<p>
He starts with his tests, defining checks for fonts, patterns and styles and moves into a sample call that sets configuration options for background color, shadows and visibility. You can find out more about what the service has to offer by <a href="http://gzaas.com/project/api-embed">reading the documentation</a> and the client <i>Gonzalo</i> has written for it <a href="https://github.com/gonzalo123/GzaasApi">in github</a>.
</p>]]></description>
      <pubDate>Mon, 01 Aug 2011 11:57:40 -0500</pubDate>
    </item>
  </channel>
</rss>

