<?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>Wed, 22 May 2013 04:44:33 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[NetTuts.com: HTTP: The Protocol Every Web Developer Must Know - Part 1]]></title>
      <guid>http://www.phpdeveloper.org/news/19433</guid>
      <link>http://www.phpdeveloper.org/news/19433</link>
      <description><![CDATA[<p>
On NetTuts.com there's a new tutorial about what they think is the one thing every web developer should understand - <a href="http://net.tutsplus.com/tutorials/tools-and-tips/http-the-protocol-every-web-developer-must-know-part-1/">the HTTP protocol</a> and how its used in web-based communications.
</p>
<blockquote>
HTTP stands for Hypertext Transfer Protocol. It's a stateless, application-layer protocol for communicating between distributed systems, and is the foundation of the modern web. As a web developer, we all must have a strong understanding of this protocol. Let's review this powerful protocol through the lens of a web developer. We'll tackle the topic in two parts. In this first entry, we'll cover the basics and outline the various request and response headers. 
</blockquote>
<p>
They cover some of the basics of the protocol first including its statelessness, the concept of URLs and the HTTP "verbs" (like GET, POST and DELETE). They also briefly cover the HTTP response codes (ex. 200, 304) and the flow of the request and response to and from the web server. They also look at some of the basic HTTP headers and the actual low-level text formats of the requests/responses.
</p>
<p>
There's a section at the end of the post that links you to a few tools that you can use to view the HTTP messaging happening in your requests, some of which you might already have. They also briefly cover the use of HTTP in a few libraries - ExpressJS, Ruby on Rails and jQuery's Ajax handling.
</p>
Link: http://net.tutsplus.com/tutorials/tools-and-tips/http-the-protocol-every-web-developer-must-know-part-1/]]></description>
      <pubDate>Tue, 09 Apr 2013 10:56:28 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Igor Wiedler: Stateless Services]]></title>
      <guid>http://www.phpdeveloper.org/news/19410</guid>
      <link>http://www.phpdeveloper.org/news/19410</link>
      <description><![CDATA[<p>
<i>Igor Wiedler</i> has a recent post to his site about creating <a href="https://igor.io/2013/03/31/stateless-services.html">stateless services</a>, specifically in the context of using a dependency injection container to manage the objects your application uses.
</p>
<blockquote>
As more frameworks and libraries, particularly in the PHP world, move towards adopting the Dependency Injection pattern they are all faced with the problem of bootstrapping their application and constructing the object graph. In many cases this is solved by a Dependency Injection Container (DIC). Such a container manages the creation of all the things. The things it manages are services. Or are they?
</blockquote>
<p>
He notes that, according to some of the principles of domain-driven design, "services" should be stateless - the results of calls to the service shouldn't alter it, it should only depend on the values passed in. He goes on to put this into the context of a DIC and gives an example of the "request service" (and how it violates the DDD principles of statelessness). He talks some about scopes (dependencies) and mutable services. He talks about methods to get around these issues with the "request" instance, ultimately coming to the conclusion that event listeners might be the way to go.
</p>
Link: https://igor.io/2013/03/31/stateless-services.html]]></description>
      <pubDate>Thu, 04 Apr 2013 10:41:50 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Hari KT: Aura.Http : Request and Response]]></title>
      <guid>http://www.phpdeveloper.org/news/19194</guid>
      <link>http://www.phpdeveloper.org/news/19194</link>
      <description><![CDATA[<p>
On his blog today <i>Hari KT</i> has an <a href="http://auraphp.github.com/">Aura Framework</a>-related post about one of its components, <a href="http://harikt.com/blog/2013/02/16/aura-dot-http-request-and-response/">the Aura.Http component</a>, and its handling of HTTP requests and responses.
</p>
<blockquote>
The Aura.Http package provide you the tool to build and send request and response. [...] Probably you may not have bothered too much on building the http response either the framework does it for you, or until you need to send the correct response.
</blockquote>
<p>
The post shows you how to use the component to send and receive HTTP requests. Code is included showing how to make Response objects and set headers, content, cookies and HTTP response code. He also shows how to output the response and a more complete example of the entire flow. The post finishes up with an example of using Aura.Http to make a request to another site - in this case back to GitHub to get the users on a repository.
</p>]]></description>
      <pubDate>Mon, 18 Feb 2013 11:49:58 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Segment.io: How to Make Async Requests in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/19142</guid>
      <link>http://www.phpdeveloper.org/news/19142</link>
      <description><![CDATA[<p>
On the Segment.io blog there's a new post by <i>Calvin</i> talking about <a href="https://segment.io/blog/how-to-make-async-requests-in-php/">making asyncronous requests in PHP</a> and three different approaches you could use, depending on your situation.
</p>
<blockquote>
When designing client libraries to send data to our API, one of our top priorities is to make sure that none of our code affects the performance of your core application. That is tricky when you have a single-threaded, "shared-nothing" language like PHP. [...] Ideally, we like to keep the setup process minimal and address a wide variety of use cases. As long as it runs with PHP (and possibly a common script or two), you should be ready to dive right in. We ended up experimenting with three main approaches to make requests in PHP. Here's what we learned.
</blockquote>
<p>
Their three suggestions don't involve external dependencies (like a queue server) and can operate pretty quickly:
</p>
<ul>
<li>Opening a socket and closing it before waiting for a response
<li>Write to a log file (a pseudo-queue)
<li>Fork a curl process (through something like <a href="http://php.net/exec">exec</a>)
</ul>
<p>
They each have small code examples included with them and explanations as to their plusses and minuses. For their needs, the "forked curl" solution worked out the best, but check out the other options too - you might have different needs.
</p>]]></description>
      <pubDate>Wed, 06 Feb 2013 09:52:49 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: An Introduction to the Front Controller Pattern, Part 2]]></title>
      <guid>http://www.phpdeveloper.org/news/18327</guid>
      <link>http://www.phpdeveloper.org/news/18327</link>
      <description><![CDATA[<p>
PHPMaster.com has posted the <a href="http://phpmaster.com/front-controller-pattern-2/">second part</a> of their series introducing you to one of the more popular design patterns in PHP frameworks right now - the Front Controller pattern. <a href="http://phpmaster.com/front-controller-pattern-1">Part 1</a> introduced some of the fundamental concepts and this new article expands on that, getting more into the request and reponse handling process.
</p>
<blockquote>
One of the best things about front controllers is that you can keep them running as tight structures, just routing and dispatching incoming requests, or you can let your wild side show and implement a full-fledged RESTful controller capable of parsing HTTP verbs, accommodating pre/post dispatch hooks, and the like, all behind a unified API. [I'd like to show] you how easy is to deploy a small, yet extensible, HTTP framework capable of putting to work a front controller along with the ones of a standalone router and a dispatcher. Plus, the whole request/response cycle will be independently handled by a couple of reusable classes, which naturally you'll be able to tweak at will.
</blockquote>
<p>
He bases his examples off of the <a href="https://github.com/lstrojny/EPHPMVC/tree/master/library">EPHPMVC</a> project, showing how to implement a RequestInterface, ResponseInterface and link them together with a RouteInterface and use the DispatcherInterface to handle the requests. The front controller is then created with its run() method and an instance is created in a main PHP file that all requests are routed through.
</p>]]></description>
      <pubDate>Tue, 07 Aug 2012 11:06:55 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DZone.com: All the ways to perform HTTP requests in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/18167</guid>
      <link>http://www.phpdeveloper.org/news/18167</link>
      <description><![CDATA[<p>
On DZone.com there's a recent post from <i>Giorgio Sironi</i> listing out some of the <a href="http://css.dzone.com/articles/all-ways-perform-http-requests">HTTP client utilities</a> that can be used in your PHP applications.
</p>
<blockquote>
In the PHP world, HTTP is very important: not only for receiving requests, which is the job of PHP application, but also for performing them. ROT web services are probably the most popular way to interface with external systems nowadays. We'll make no assumptions on the payload of HTTP requests (which may be binary, text, JSON, XML), so you'll have to deal with that yourself. In some cases, you may choose a more specific solution such as the SoapClient class in the SOAP extension, or the XML-RPC extension.
</blockquote>
<p>
Among the methods he mentions are things like <a href="http://php.net/curl">the cURL extension</a>, <a href="http://it.php.net/fsockopen>fsockopen</a> and <a href="http://it.php.net/manual/en/book.http.php">the PECL HTTP extension</a>. He also talks about some of the libraries out there that are popular among developers (<a href="https://github.com/kriswallsmith/Buzz">Buzz</a> and <a href="https://github.com/guzzle/guzzle">Guzzle</a>) as well as the modules included in the Zend Framework (v1 and v2) to make the requests.
</p>]]></description>
      <pubDate>Tue, 03 Jul 2012 10:18:21 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHP.net: PHP 5.3.12 and PHP 5.4.2 Released!]]></title>
      <guid>http://www.phpdeveloper.org/news/17907</guid>
      <link>http://www.phpdeveloper.org/news/17907</link>
      <description><![CDATA[<p>
The PHP project has <a href="http://www.php.net/archive/2012.php#id2012-05-03-1">officially released the latest versions</a> in both the 5.3.x and 5.4.x series in response to a bug that was found in the CGI setup of certain server+PHP configurations.
</p>
<blockquote>
<p>
There is a vulnerability in certain CGI-based setups (Apache+mod_php and nginx+php-fpm are not affected) that has gone unnoticed for at least 8 years. Section 7 of the CGI spec states: 'Some systems support a method for supplying a [sic] array of strings to the CGI script. This is only used in the case of an `indexed' query. This is identified by a "GET" or "HEAD" HTTP request with a URL search string not containing any unencoded "=" characters.'
</p>
<p>
A large number of sites run PHP as either an Apache module through mod_php or using php-fpm under nginx. Neither of these setups are vulnerable to this. Straight shebang-style CGI also does not appear to be vulnerable. If you are using Apache mod_cgi to run PHP you may be vulnerable. To see if you are, just add ?-s to the end of any of your URLs. If you see your source code, you are vulnerable. If your site renders normally, you are not.
</p>
</blockquote>
<p>
You can download this latest version from <a href="http://www.php.net/downloads.php">the downloads page</a> for the source releases or <a href="http://windows.php.net">windows.php.net</a> for the Windows binaries. You can look at <a href="http://www.php.net/ChangeLog-5.php#5.4.2">the Changelog</a> if you'd like more details on the update.
</p>]]></description>
      <pubDate>Fri, 04 May 2012 07:19:08 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Refulz.com: CakePHP AclComponent - ACOs, AROs and Mapping]]></title>
      <guid>http://www.phpdeveloper.org/news/17605</guid>
      <link>http://www.phpdeveloper.org/news/17605</link>
      <description><![CDATA[<p>
On the Refulz blog they've posted <a href="http://php.refulz.com/cakephp-aclcomponent-acos-aros-and-mapping/">the next in their series</a> about access control in CakePHP applications. In this new article they look at Access Request Objects (AROs) and Access Control Objects (ACOs) and how they can be managed via the built-in ACL functionality.
</p>
<blockquote>
Continuing with Access Control Lists, we will read about the two Access Control Lists and their mapping. The Access Request Objects (AROs) are a list of the things that seek permissions and the Access Control Objects (ACOs) are the resources on which permissions are required. Both the lists are maintained in the tow tables, namely aros and acos respectively.
</blockquote>
<p>
Included in the post is the SQL you'll need to create the tables for the system to use as well as some basic code to use the AclComponent with the ACOs/AROs. They also show how to use the parentNode method to create parent/child relationships between the objects.
</p>]]></description>
      <pubDate>Wed, 29 Feb 2012 11:38:12 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Dave Marshall's Blog: How I'm designing a RESTful(ish) web service]]></title>
      <guid>http://www.phpdeveloper.org/news/17570</guid>
      <link>http://www.phpdeveloper.org/news/17570</link>
      <description><![CDATA[<p>
<i>Dave Marshall</i> is in the process of building a "RESTish" web service and has <a href="http://davedevelopment.co.uk/2012/02/16/how-im-doing-rest.html">shared some of his planning steps</a> in a new post to his blog.
</p>
<blockquote>
This post is going to describe how I've ending up designing, what I consider to be a fairly RESTful web API. I'm far from being an expert, and this is definitely the closest thing to a RESTful API that I've ever created, so I'm not even experienced with REST APIs. [...] Until about 6 months ago, I'd always been sceptical of creating RESTful APIs, but I think I've had a few pennies drop since then that have made me fairly confident that I grasp the basics pretty well.
</blockquote>
<p>
He touches on topics like: authentication, the <a href="http://martinfowler.com/articles/richardsonMaturityModel.html">Richardson Maturity model</a>, HTTP verbs, sample request and response messages and some BDD-style tests to predict the output of a basic request.
</p>]]></description>
      <pubDate>Wed, 22 Feb 2012 09:13:31 -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>
  </channel>
</rss>
