<?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 21:51:51 -0600</pubDate>
    <ttl>30</ttl>
    <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: PHP 5.4 Built In Webserver]]></title>
      <guid>http://www.phpdeveloper.org/news/17464</guid>
      <link>http://www.phpdeveloper.org/news/17464</link>
      <description><![CDATA[<p>
<i>Lorna Mitchell</i> has <a href="http://www.lornajane.net/posts/2012/php-5-4-built-in-webserver">posted a quick tutorial</a> about a feature of the upcoming PHP 5.4 release, the built-in web server, and some tips on doing things like routing requests and changing the hostname.
</p>
<blockquote>
One of the big features arriving with PHP 5.4 is the addition of a built-in basic webserver for use in development environments. Quite a few of the other scripting languages have something like this so I'm very pleased to see it in PHP. Using a server like this makes it easy to quickly try out some scripts without needing to configure apache or really do anything much! I had to look up a few things to get started, so I thought I'd write them down for posterity.
</blockquote>
<p>
She includes instructions on how to get the server up and running from the command line, updating the location of the document root with a command line option and using a simple "routing.php" script to act as a front controller. Changing the hostname is as simple as changing "localhost" to something else when starting the server. 
</p>]]></description>
      <pubDate>Mon, 30 Jan 2012 11:35:09 -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[PHPClasses.org: PHP Vulnerability May Halt Millions of Servers]]></title>
      <guid>http://www.phpdeveloper.org/news/17382</guid>
      <link>http://www.phpdeveloper.org/news/17382</link>
      <description><![CDATA[<p>
On the PHPClasses.org blog today there's a new post looking at <a href="http://www.phpclasses.org/blog/post/171-PHP-Vulnerability-May-Halt-Millions-of-Servers.html">the security vulnerability</a> that effected not only PHP but lots of other languages making them susceptible to attack from the outside.
</p>
<blockquote>
In PHP and several other languages used to implement Web applications, arrays are used to store the values of request variables such as $_GET, $_POST, $COOKIE, etc.. IF you receive a request with a large number of request values, until recent versions PHP may run into trouble.
</blockquote>
<p>
He goes on to explain why there's an issue with the array overloading and what PHP has done in recent releases to help correct the issue - the max_input_vars setting in the php.ini. He also points out that this is not a new issue - it was originally identified back in 2003 (with a video of the original presentation). He points out that the most recent releases of the PHP language have this fix in them and, if at all possible, you should upgrade to protect your applications.
</p>]]></description>
      <pubDate>Thu, 12 Jan 2012 08:21:55 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[DZone.com: PHP 5.4 Will Have a Built-in Web Server]]></title>
      <guid>http://www.phpdeveloper.org/news/17030</guid>
      <link>http://www.phpdeveloper.org/news/17030</link>
      <description><![CDATA[<p>
As is mentioned in <a href="http://css.dzone.com/news/php-54-will-have-built-web">this new post</a> to DZone.com, one of the features of the upcoming PHP 5.4 release, including things like traits and array dereferencing support, will also have an interesting new feature - a built-in simple web server.
</p>
<blockquote>
Yet another new feature to look forward to in PHP 5.4.0 - the CLI SAPI will now provide a built-in web server which is geared toward developmental purposes.  It shouldn't be used in production right now. 
</blockquote>
<p>
The PHP manual <a href="http://php.net/manual/en/features.commandline.webserver.php">has been updated</a> with the latest on this upcoming feature:
</p>
<blockquote>
URI requests are served from the current working directory where PHP was started, unless the -t option is used to specify an explicit document root. [...] If a PHP file is given on the command line when the web server is started it is treated as a "router" script for the web server. The script is run at the start of each HTTP request. If this script returns FALSE, then the requested resource is returned as-is. Otherwise the script's output is returned to the browser.
</blockquote>
<p>
The PHP 5.4.x series is still in beta as of the time of this post - you can download the beta1 on the <a href="http://www.php.net/downloads.php">downloads section</a> of the PHP site (or the <a href="http://windows.php.net/download/">Windows binaries</a>).
</p>]]></description>
      <pubDate>Mon, 24 Oct 2011 09:24:01 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Adam Patterson's Blog: DIY simple staging server.]]></title>
      <guid>http://www.phpdeveloper.org/news/17026</guid>
      <link>http://www.phpdeveloper.org/news/17026</link>
      <description><![CDATA[<p>
<i>Adam Peterson</i> has posted an interesting idea for those out there running an internal staging server they want to constantly keep up to date with the main line of code (without manual intervention) - <a href="http://www.adampatterson.ca/blog/2011/10/diy-simple-staging-server/">a git pull web frontend</a> combined with git post-receive hooks.
</p>
<blockquote>
This [move from svn to git] left a bit of a gap in my process where I could no longer test on a remote server without updating it manually by S/FTP or opening terminal and manually calling a git pull. Open terminal and manually git pull it did break up the work flow a bit so using the <a href="http://www.dingoframework.com/">Dingo framework</a> I created a very simple Git helper and gave it its own URL something like git/pull.
</blockquote>
<p>
He added a post-receive hook to his git server that calls this "git/pull" URL on the staging server and updates the code on the server. This provides an easy asynchronous way to update things on another server. Note, though, that this should never be done on a publicly accessible server - it's a pretty large security hole (or at the very least made secure somehow). He used <a href="http://www.dingoframework.com/">Dingo</a> to create his interface, but something like the <a href="http://slimframework.com">Slim micro-framework</a> could have worked just as well. You can <a href="https://gist.github.com/1293697">view his code on github</a>.
</p>]]></description>
      <pubDate>Fri, 21 Oct 2011 10:29:41 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[SitePoint.com: How to Create an XML to JSON Proxy Server in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17016</guid>
      <link>http://www.phpdeveloper.org/news/17016</link>
      <description><![CDATA[<p>
On SitePoint.com today there's a new post from <i>Craig Buckler</i> showing you how to create a <a href="http://www.sitepoint.com/php-xml-to-json-proxy/">simple XML to JSON proxy server</a> in PHP with a SimpleXML object at its heart.
</p>
<blockquote>
Unless you're new to this web development lark, you'll know the 'X' in 'AJAX' stands for XML - eXtensible Markup Language. But you're probably not using XML. If you are, you'd probably prefer not to. All the cool kids are using JSON or JSON-P: it has a smaller payload, is easier to use and faster to process. [...] Fortunately, there are a couple of solutions which allow you to retain the benefits of XML data interchange but provide the ease of JSON in JavaScript. In this article, we're going to create an XML to JSON proxy server in PHP.
</blockquote>
<p>
Of course, this will only work with well-formatted XML documents, but it's a quick little hack that pulls in the XML data with a <a href="http://php.net/curl">curl</a> request and parses it via SimpleXML and uses <a href="http://php.net/json_encode">json_encode</a> to push it back out as JSON.
</p>
]]></description>
      <pubDate>Wed, 19 Oct 2011 13:07:08 -0500</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[Reddit.com: How do you test email when in development?]]></title>
      <guid>http://www.phpdeveloper.org/news/16798</guid>
      <link>http://www.phpdeveloper.org/news/16798</link>
      <description><![CDATA[<p>
In <a href="http://www.reddit.com/r/PHP/comments/jzccc/how_do_you_test_email_when_in_development/">this recent post</a> to Reddit, a question is asked that's an issue for many developers testing the email sending abilities of their applications - how can it be tested effectively without outside services flagging you as a possible spammer.
</p>
<blockquote>
So how do you guys do it? My current solution is to just output the email template HTML straight to the browser, but this doesn't always work. [...] I have considered sending emails through to my GMail, but I run my tests quite often and I'm not sure Google would be too happy with the amount I send. [...] I'm sure there's a better way I can handle this without modifying my code too much. Suggestions appreciated.
</blockquote>
<p>
Suggestions from <a href="http://www.reddit.com/r/PHP/comments/jzccc/how_do_you_test_email_when_in_development/#comments">the comments</a> include:
</p>
<ul>
<li>a local SMTP/IMAP server configured to catch all emails being sent
<li>Changing the address based on an environment flag
<li>Using "<anything>@example.com" 
<li>Saving the email as a .msg file for later review
</ul>
<p>
There's also suggestions of other Mac or Windows software to mimic the mail server like <a href="http://smtp4dev.codeplex.com/">smtp4dev</a> and <a href="http://mocksmtpapp.com/">MockStmp</a>
</p>]]></description>
      <pubDate>Wed, 31 Aug 2011 12:58:53 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[VXTIndia Blog: How to setup your new VPS Ubuntu server]]></title>
      <guid>http://www.phpdeveloper.org/news/16790</guid>
      <link>http://www.phpdeveloper.org/news/16790</link>
      <description><![CDATA[<p>
On the VXTIndia blog there's a recent post that gives you a <a href="http://vxtindia.com/blog/how-to-setup-your-new-vps-ubuntu-server/">very complete guide</a> to setting up a VPS server running Ubunut with all of the software you'd need to get a (more than) complete server up and running.
</p>
<blockquote>
Every time you purchase a new Linux VPS, you need to go ahead and set it up for use. Even though we manage to do one server a month, we always seem to forget one thing or the other. So we decided to write down the things that we do. I thought it would be a good thing to share it with everybody as well, so that we could get a few comments about what we're doing wrong, and people who do it the first time can probably pick up a few things from here.
</blockquote>
<p>Steps and software involved in their process include:</p>
<ul>
<li>Updating to the latest Ubuntu packages
<li>Creating other users for the system
<li>Installing the web environment (including PHP, MySQL, phpmyadmin and Apache2)
<li><a href="http://munin-monitoring.org/">Minin</a> for monitoring
<li>Configuring IPTables
<li>Installing <a href="http://www.fail2ban.org/wiki/index.php/Main_Page">Fail2Ban</a>
</ul>
<p>
All of this comes complete with the additions you'll need to make to configuration files and the commands to get everything installed (via aptitude).
</p>]]></description>
      <pubDate>Tue, 30 Aug 2011 10:02:47 -0500</pubDate>
    </item>
  </channel>
</rss>

