<?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:46:55 -0600</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Leaseweb Labs Blog: POC: Flexible PHP Output Caching]]></title>
      <guid>http://www.phpdeveloper.org/news/17489</guid>
      <link>http://www.phpdeveloper.org/news/17489</link>
      <description><![CDATA[<p>
On the Leaseweb Labs blog there's <a href="http://www.leaseweblabs.com/2012/01/poc-flexible-php-output-caching/">a recent post</a> looking at using the <a href="http://github.com/tothimre/POC">POC framework</a> to work with flexible output caching. The tool makes it easy to create a new object and push cache content into it, automatically caching the data to sources like the file system, a Redis instance or a MongoDB database.
</p>
<blockquote>
Last year at the Symfony conference in Paris I have heard a really good quote: "There are only two hard things in Computer Science: cache invalidation and naming things" - Phil Karlton. I agree with it and it gave me a boost to keep evolving the concept.
</blockquote>
<p>
He includes an introduction to the caching features of <a href="http://github.com/tothimre/POC">the framework</a> complete with sample code showing first how to cache to the default file system and a more complex example that uses unique caches and page blacklists. Other features planned for the caching tool include edge-side includes, using Twig for templating and statistics recorded to a database.
</p>]]></description>
      <pubDate>Thu, 02 Feb 2012 12:10:21 -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[Ilia Alshanetsky's Blog: PHP's Output Buffering]]></title>
      <guid>http://www.phpdeveloper.org/news/17230</guid>
      <link>http://www.phpdeveloper.org/news/17230</link>
      <description><![CDATA[<p>
In a new post to his blog <i>Ilia Alshanetsky</i> takes a look at PHP's output buffering feature and some <a href="http://ilia.ws/archives/244-PHPs-Output-Buffering.html">interesting things he found</a> when testing some recent code (hint: it has to do with PHP's "interesting" management of the buffer).
</p>
<blockquote>
While profiling our application I came across a a rather strange memory usage by the ob_start() function. We do use ob_start() quite a bit to defer output of data, which is a common thing in many applications. What was unusual is that 16 calls to ob_start() up chewing through almost 700kb of memory, given that the data being buffered rarely exceeds 1-2kb, this was quite unusual.
</blockquote>
<p>
Through a bit more testing he found that, if a buffer provided for content isn't enough, PHP automatically bumps it up by 10kb each time - a waste of resources if you only need a small subset of that. He includes a small patch he made to the PHP core API that allows for defining a custom buffer size and, if it's not enough, bumps up the buffer size by 1kb instead of 10kb.
</p>]]></description>
      <pubDate>Thu, 08 Dec 2011 10:01:15 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[DeveloperDrive.com: What Web Developers Need to Know About Cross-Site Scripting]]></title>
      <guid>http://www.phpdeveloper.org/news/17002</guid>
      <link>http://www.phpdeveloper.org/news/17002</link>
      <description><![CDATA[<p>
On the DeveloperDrive.com site there's a recent post anyone wondering about cross-site scripting should give a read. They <a href="http://www.developerdrive.com/2011/10/what-web-developers-need-to-know-about-cross-site-scripting/">introduce you to the basic concept</a> and two things you can do to help prevent them.
</p>
<blockquote>
This little fable describes the most common vulnerability found in web sites, the Cross Site Scripting (XSS) attack. According to a report from <a href="http://www.darkreading.com/security/app-security/showArticle.jhtml?articleID=221601529">WhiteHat Security</a> 83 percent of websites they tested have had at least one serious vulnerability and 66 percent of all websites with vulnerabilities are susceptible to XSS attacks making it the most common vulnerability web developers face. To fix this, it takes 67 days on average. Tools like <a href="http://www.owasp.org/index.php/Main_Page">WebScarab</a> and <a href="http://www.parosproxy.org/index.shtml">Paros Proxy</a> can be used to scan sites for possible vulnerabilities.
</blockquote>
<p>
They offer two simple pieces of advice that it's all too easy to forget when developing applications - validate all user input to ensure it's what it should be and escape any untrusted output (even sometimes your own!) before pushing it out to the page.
</p>]]></description>
      <pubDate>Mon, 17 Oct 2011 13:39:23 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Abou Kone's Blog: Set up JSON action output in CakePHP 1.3]]></title>
      <guid>http://www.phpdeveloper.org/news/16962</guid>
      <link>http://www.phpdeveloper.org/news/16962</link>
      <description><![CDATA[<p>
<i>Abou Kone</i> has a recent post to his blog showing the CakePHP users out there how to <a href="http://aboukone.com/2011/10/04/set-up-json-action-output-in-cakephp-1-3/">set up JSON output</a> for your actions in a few simple steps.
</p>
<blockquote>
Working  on setting up the <a href="https://github.com/kvz/cakephp-rest-plugin">Rest Plugin</a> for CakePHP helped me realize that i wanted to set up JSON output for some of my actions. This way, if you request for example "www.yourapp.com/app/post/view/1.json" in the url, you will be returned the JSON post data. This <a href="http://blog.pagebakers.nl/2007/06/05/using-json-in-cakephp-12/">excellent tutorial here</a> will help you achieve it. 
</blockquote>
<p>
Changes include updates to configuration for routing, using the RequestHandler component and setting your actions to output the data correctly when the ".json" is detected on the request.
</p>]]></description>
      <pubDate>Fri, 07 Oct 2011 08:45:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Project: Patchwork-Doc - JSON Formatted Output of PHP variables]]></title>
      <guid>http://www.phpdeveloper.org/news/16960</guid>
      <link>http://www.phpdeveloper.org/news/16960</link>
      <description><![CDATA[<p>
<i>Nicolas Grekas</i> has submitted about a new tool he's developed to "represent faithfully any PHP variable as complex as it is" - <a href="https://github.com/nicolas-grekas/Patchwork-Doc/blob/master/Dumping-PHP-Data-en.md">Patchwork-Doc</a> (related to his <a href="https://github.com/nicolas-grekas/Patchwork">Patchwork</a> PHP framework).
</p>
<blockquote>
The JSON format on which it rests guarantees maximum interoperability while ensuring good readability. The implementation done in the JsonDumper class operates all potentialities of the representation while providing maximum latitude to the developer to exploit its ability as desired, both in term of exposure of internal class mechanism for specialization and in terms of custom use, thanks to the callbacks that allow to intercept the JSON line by line and to adjust the dumping of objects or resources according to their type.
</blockquote>
<p>
It isn't required to use the framework to use this tool, however. You can see an example of the output format in <a href="https://github.com/nicolas-grekas/Patchwork-Doc/blob/master/Dumping-PHP-Data-en.md">this example</a> on the project's github page, complete with a guide to some of the advantages and disadvantages of some of the current, more common methods of output. Several types are included in the example including simple string/integer values, objects, classes, stream resources and the results of variable casting.
</p>]]></description>
      <pubDate>Thu, 06 Oct 2011 12:16:58 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Amazium Blog: PHP in the Dark: Input/Output]]></title>
      <guid>http://www.phpdeveloper.org/news/16815</guid>
      <link>http://www.phpdeveloper.org/news/16815</link>
      <description><![CDATA[<p>
On the Amazium blog <i>Jeroen Keppens</i> has a recent post looking at some of tools available to you when needing to <a href="http://www.amazium.com/blog/php-in-the-dark-input-output">filter input and escape output</a> in your applications. This post specifically covers filtering on command line applications.
</p>
<blockquote>
When you need data input in a web context, you send a GET/POST request to your script. On the command line, things work differently. In this blog post, we will talk obout input and output in php-cli.
</blockquote>
<p>The post is broken up into a few different sections:</p>
<ul>
<li><a href="http://www.amazium.com/blog/php-in-the-dark-input-output/#arguments">Handling arguments</a>
<li><a href="http://www.amazium.com/blog/php-in-the-dark-input-output/#file_descriptors">File descriptors</a>
<li><a href="http://www.amazium.com/blog/php-in-the-dark-input-output/#interactive_input">Interactive input</a>
<li><a href="http://www.amazium.com/blog/php-in-the-dark-input-output/#resources">Resources mentioned in the post</a>
</ul>
<p>
Tools mentioned include everything from <a href="http://php.net/getopt">getopt</a> and <a href="http://pear.php.net/package/Console_Getopt">PEAR's' Console_Getopt</a> out to using file descriptors and working with readline.
</p>]]></description>
      <pubDate>Mon, 05 Sep 2011 11:25:32 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Philip Norton's Blog: Netscape HTTP Cooke File Parser In PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16538</guid>
      <link>http://www.phpdeveloper.org/news/16538</link>
      <description><![CDATA[<p>
<i>Philip Norton</i> has <a href="http://www.hashbangcode.com/blog/netscape-http-cooke-file-parser-php-584.html">shared a script he's created</a> in a new post today that lets you read from a Netscape-formatted cookie file (as outputted from a curl request).
</p>
<blockquote>
This file is generated by PHP when it runs CURL (with the appropriate options enabled) and can be used in subsequent CURL calls. This file can be read to see what cookies where created after CURL has finished running. As an example, this is the sort of file that might be created during a typical CURL call.
</blockquote>
<p>
The file is structured, plain-text content with information on the domain, path, security, name and expiration details of each cookie. His script parses out these details and pushes them into a basic array, prime for searching and sorting (and reuse) in your application. 
</p>]]></description>
      <pubDate>Thu, 30 Jun 2011 09:09:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Sameer Borate's Blog: Data filtering and validation using Inspekt]]></title>
      <guid>http://www.phpdeveloper.org/news/16114</guid>
      <link>http://www.phpdeveloper.org/news/16114</link>
      <description><![CDATA[<p>
<i>Sameer Borate</i> has a recent post to his blog looking at an important part of any application - filtering input from the user and output before its used. In <a href="http://www.codediesel.com/php/data-filtering-and-validation-using-inspekt/">his examples</a> he uses a library called <a href="https://github.com/funkatron/inspekt">Inspekt</a> (from <i>Ed Finkler</i>) to make the job a lot easier.
</p>
<blockquote>
Most web security glitches are caused by insufficient input filtering and validation. Despite a large number of validation libraries being available, input sanitization is usually bypassed due to sheer laziness or the idea that your site is somehow immune from bad input data. <a href="https://github.com/funkatron/inspekt">Inspekt</a> is one such library that has a small footprint and is very easy to integrate into your application.
</blockquote>
<p>
He goes through the installation (a require_once) and a few examples of how to "cage" incoming data from a sample form with two hidden fields. He shows how to use the library to access the filtered versions of the values and how to run some tests on the data (like checks for alphanumeric, valid hostname, between two values, valid phone number, etc). He also briefly mentions "super cages" that can be used over and over.
</p>]]></description>
      <pubDate>Tue, 29 Mar 2011 09:55:27 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Dan Horrigan's Blog: Security in FuelPHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16027</guid>
      <link>http://www.phpdeveloper.org/news/16027</link>
      <description><![CDATA[<p>
<i>Dan Horrigan</i>, one of the members of the development team for <a href="http://fuelphp.com">the Fuel PHP framework</a> has a recent post to his blog of an overview of the <a href="http://dhorrigan.com/blog/article/security-in-fuelphp/">the security features of the framework</a> and how it handles things like input and output filtering.
</p>
<blockquote>
There are many ways to handle security in a web application, and many things to think about. This is by no means an in-depth look on application security. It is meant to be an overview of how to use the security features included in FuelPHP.
</blockquote>
<p>
The framework lets you set up application-wide input filtering in your configuration file, making it a nice "set it and forget it" kind of thing you don't have to include in each form. There's three types of filtering - xss_clean, htmlentities and strip_tags. For output, he mentions the "e()" method that escapes your output and strips all HTML tags to prevent XSS attacks.
</p>]]></description>
      <pubDate>Thu, 10 Mar 2011 12:02:32 -0600</pubDate>
    </item>
  </channel>
</rss>

