<?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>Mon, 20 May 2013 04:21:47 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Derick Rethans' Blog: What is PHP doing?]]></title>
      <guid>http://www.phpdeveloper.org/news/18222</guid>
      <link>http://www.phpdeveloper.org/news/18222</link>
      <description><![CDATA[<p>
<i>Derick Rethans</i> has a new post to his blog showing how you can, using a few simple unix tools, figure out <a href="http://derickrethans.nl/what-is-php-doing.html">what PHP is doing</a> when your scripts are executing.
</p>
<blockquote>
Sometimes when you have a long running PHP script, you might wonder what the hell it is doing at the moment. There are a few tools that can help you to find out, without having to stop the script. Some of these work only on Linux.
</blockquote>
<p>
He shows you how to use the following commands to track down exactly what your process is working on: strace, ltrace and gdb (a handy debugger that will probably give you more information than you're looking for). He includes some sample output for the commands and gives an example of a PHP script-to-gdb output relationship.
</p>]]></description>
      <pubDate>Fri, 13 Jul 2012 08:30:02 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: PHP Security: Cross-Site Scripting Attacks (XSS)]]></title>
      <guid>http://www.phpdeveloper.org/news/17890</guid>
      <link>http://www.phpdeveloper.org/news/17890</link>
      <description><![CDATA[<p>
PHPMaster.com has a new tutorial posted today (by <i>George Fekete</i>) about <a href="http://phpmaster.com/php-security-cross-site-scripting-attacks-xss/">preventing cross-site scripting attacks</a> in your PHP-based applications.
</p>
<blockquote>
Unfortunately, cross-site scripting attacks occurs mostly, because developers are failing to deliver secure code. Every PHP programmer has the responsibility to understand how attacks can be carried out against their PHP scripts to exploit possible security vulnerabilities. Reading this article, you'll find out more about cross-site scripting attacks and how to prevent them in your code.
</blockquote>
<p>
Included in the tutorial is an example with a simple form and definitions of different types of XSS attacks - reflected XSS, persistent XSS and three ways to prevent them: data filtering, output filtering and data validation. He also links to a few "cheatsheets" to help even more (including <a href="http://ha.ckers.org/xss.html">this guide</a> and a Zend Framework set of <a href="http://www.zfsnippets.com/snippets/view/id/5">XSS test data</a>.
</p>]]></description>
      <pubDate>Tue, 01 May 2012 11:59:28 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Danne Lundqvist's Blog: Getting to grips with an existing XML structure]]></title>
      <guid>http://www.phpdeveloper.org/news/17864</guid>
      <link>http://www.phpdeveloper.org/news/17864</link>
      <description><![CDATA[<p>
<i>Danne Lundqvist</i> has a new post where he shares a bit of code he's written to "come to grips" with <a href="http://www.dotvoid.com/2012/04/getting-to-grips-with-an-existing-xml-structure/">an existing XML structure</a>.
</p>
<blockquote>
Very often I find myself writing input filters for large XML files using PHP. Common enough task; and PHP offer a great variety of tools to do this effectively depending on the situation. Unfortunately, almost as common is the lack of documentation for the aforementioned XML files. [...] I have looked around for a simple tool but I didn't really find a  tool that gave me the quick and dirty overview I wanted. A year or so ago I finally wrote a small PHP class to analyze large XML files.
</blockquote>
<p>
He includes an example XML file, the <a href="http://www.dotvoid.com/wp-content/uploads/2012/04/xmlstruct.png">HTML output</a> of the parsing and a sample of how to use <a href="http://www.dotvoid.com/wp-content/uploads/2012/04/xmlgrips.tar.gz">the class</a> to parse and output the XML structure, complete with some CSS.
</p>]]></description>
      <pubDate>Wed, 25 Apr 2012 10:44:43 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Code2Learn.com: Generating CSV file using CodeIgniter Framework]]></title>
      <guid>http://www.phpdeveloper.org/news/17841</guid>
      <link>http://www.phpdeveloper.org/news/17841</link>
      <description><![CDATA[<p>
The Code2Learn site has posted another in their CodeIgniter "series" about producing various kinds of output from an application based on this framework. In <a href="http://www.code2learn.com/2012/03/generating-csv-file-using-codeigniter.html">this new article</a> <i>Farhan Khwaja</i> shows how to output a CSV-formatted file.
</p>
<blockquote>
I have already written posts on <a href="http://www.code2learn.com/2012/02/generating-pdf-files-from-database.html">how to generate pdf files using CodeIgniter Framework</a> and also on <a href="http://www.code2learn.com/2012/03/generating-tabulated-pdf-file-from.html">how to generate tabulated pdf file using CodeIgniter Framework</a>.  This post will help you to generate a CSV file using CodeIgniter. The data for the CSV File will be taken from the MySQL Database and will be put into the CSV File.
</blockquote>
<p>
He includes the source for a basic "Generate" controller class that uses a custom "CSV_Helper" to do the work. It has two methods - one to transform array data and another to take the database result object and extract each record. 
</p>]]></description>
      <pubDate>Thu, 19 Apr 2012 11:45:52 -0500</pubDate>
    </item>
    <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>
  </channel>
</rss>
