<?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, 19 May 2013 07:25:11 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Josh Adell: Serializing Data Like a PHP Session]]></title>
      <guid>http://www.phpdeveloper.org/news/19534</guid>
      <link>http://www.phpdeveloper.org/news/19534</link>
      <description><![CDATA[<p>
In <a href="http://blog.everymansoftware.com/2013/05/serializing-data-like-php-session.html">this new post</a> <i>Josh Adell</i> looks at working with PHP sessions and how you can manually encode data to look as if it came from the normal session handling.
</p>
<blockquote>
If you have ever popped open a PHP session file, or stored session data in a database, you may have noticed that this serialization looks very similar to the serialize function's output, but it is not the same. Recently, I needed to serialize data so that it looked like PHP session data (don't ask why; I highly suggest not doing this if it can be avoided.) It turns out, PHP has a function that encodes data in this format: <a href="http://php.net/session_encode">session_encode</a>. 
</blockquote>
<p>
Unfortunately, this method doesn't take arguments - it just outputs the encoded version of the current session data. So, he came up with his own encode/decode methods that use the PHP session, extract the serialized string and return it.
</p>
Link: http://blog.everymansoftware.com/2013/05/serializing-data-like-php-session.html]]></description>
      <pubDate>Thu, 02 May 2013 09:11:33 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Extending Twig Templates: Inheritance, Filters, and Functions]]></title>
      <guid>http://www.phpdeveloper.org/news/19467</guid>
      <link>http://www.phpdeveloper.org/news/19467</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a new tutorial for the <a href="http://twig.sensiolabs.org/">Twig</a> templating users out there showing you how to <a href="http://phpmaster.com/extending-twig-templates-inheritance-filters-and-functions/">extend your templates</a> via inheritance, filters and functions - all abilities already built in to the tool.
</p>
<blockquote>
When working within an MVC architecture, it's common to use a template library to populate the dynamic content of our views. There are dozens of such libraries available for PHP, but Twig is one of the standouts because of the ability to extend core features with custom implementations. In this article we'll explore how Twig templates can be extended using template inheritance, filters, and functions.
</blockquote>
<p>
He starts first with some of the common limitations of templating frameworks (extension) and how Twig gets around this. He shows the use of the "extends" keyword and the "block"/"endblock" for splitting up the page into reusable chunks. He also shows how to use filters and functions in your Twig tags, allowing for more customized content and functionality for your output.
</p>
Link: http://phpmaster.com/extending-twig-templates-inheritance-filters-and-functions/]]></description>
      <pubDate>Tue, 16 Apr 2013 11:05:22 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Etsy Code as Craft: There and Back Again: Migrating Geolocation Data to GeoNames]]></title>
      <guid>http://www.phpdeveloper.org/news/19392</guid>
      <link>http://www.phpdeveloper.org/news/19392</link>
      <description><![CDATA[<p>
On the Etsy "Code as Craft" blog there's <a href="http://codeascraft.etsy.com/2013/03/26/there-and-back-again-migrating-geolocation-data-to-geonames/">a recent post</a> about their move to using the <a href="http://geonames.org/">GeoNames</a> service internally rather than the external, third-party API previously in use.
</p>
<blockquote>
People are passionate about where they live. At Etsy we need to keep track of lots of different locations, such as buyers' billing and shipping addresses and sellers' shop locations. As Etsy continues to expand internationally we wanted to provide better localization and translations for our location place names. We determined that the best way to effect this change was to move from using a closed location API provider to internal services backed by the open <a href="http://geonames.org/">GeoNames</a> data set.
</blockquote>
<p>
<a href="http://codeascraft.etsy.com/2013/03/26/there-and-back-again-migrating-geolocation-data-to-geonames/">The post</a> details some of the steps in the process including the mapping of the current data to the new structure (the script is <a href="https://github.com/etsy/geonames">available on github</a>). They talk about how they mapped their old data over (trial and error sometimes) and the creation of a database of "GeoNameIDs" for each customer in their records. They've also implemented a <a href="http://lucenerevolution.org/">Lucene/Solr</a> search for improved searching and auto-suggestion based on the user's location.
</p>]]></description>
      <pubDate>Mon, 01 Apr 2013 11:48:36 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Web & PHP Magazine: Issue #12 - Don't Get in a PECL]]></title>
      <guid>http://www.phpdeveloper.org/news/19290</guid>
      <link>http://www.phpdeveloper.org/news/19290</link>
      <description><![CDATA[<p>
The latest issue of the Web and PHP Magazine has been published - <a href="http://webandphp.com/issue-12">issue #12</a>, "Don't get in a PECL". This latest issue includes articles like:
</p>
<ul>
<li>"The Power of PECL" by <i>Simon Holywell</i>
<li>"Be 'ready' if you want to be done!" by <i>Steffan Surdek</i>
<li>"All Data is Relational" by <i>Cory Isaacson</i>
<lI>"Fixing PHP Production Problems with APM" by <i>Dan Delany</i> and <i>Chris Kelly</i>
<li>"Trust" by <i>Sebastian Bergmann</i>
</ul>
<p>
You can download your copy for free from <a href="http://webandphp.com/issue-12">their site</a> and catch up on back issues.
</p>]]></description>
      <pubDate>Fri, 08 Mar 2013 10:23:36 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Sameer Borate: Storing images into a database - resolving a contentious matter]]></title>
      <guid>http://www.phpdeveloper.org/news/19215</guid>
      <link>http://www.phpdeveloper.org/news/19215</link>
      <description><![CDATA[<p>
In <a href="http://www.codediesel.com/mysql/storing-images-into-a-database/">this new post</a> to his CodeDiesel site <i>Sameer Borate</i> looks at something that's been a controversial topic with developers (not just PHP) about storing binary data, like images, in a database instead of on the local file system. 
</p>
<blockquote>
There is much discussion and argument with no final say on the issue. In one of my recent project the same issue was raised; the client and myself discussing the benefits and drawback of storing the images into a database. The project needed storing around 50,000 images, so it was important to get the question resolved satisfactorily. After much deliberation we settled on using the file system. The major factor in the decision was that we needed the database and images decoupled as we would be having multiple databases using the same set of images. 
</blockquote>
<p>
He goes on to talk about some of the things you should consider when you're deciding if storing images in the database is the right thing for your application including:
</p>
<ul>
<li>The bloat that can come with storing binary data (larger database size)
<li>Updating images requires two operations - updating the database and updating the cached image locally
<li>Images usually serve faster when they come from the filesystem through the web server
<li>BLOB (a common type for binary data storage) is variable-width and can degrade performance
</ul>
<p>
You can read the rest of the reasons (and get more detail on the ones above) in <a href="http://www.codediesel.com/mysql/storing-images-into-a-database/">the rest of the post</a>.
</p>]]></description>
      <pubDate>Thu, 21 Feb 2013 11:16:45 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Simplifying Test Data Generation with Faker]]></title>
      <guid>http://www.phpdeveloper.org/news/19203</guid>
      <link>http://www.phpdeveloper.org/news/19203</link>
      <description><![CDATA[<p>
In a new post to PHPMaster.com today, <i>Rakhitha Nimesh</i> <a href="http://phpmaster.com/simplifying-test-data-generation-with-faker/">takes a look at Faker</a>, a tool that can be used to generate random test case data as a part of your workflow.
</p>
<blockquote>
Testing is an iterative part of the development process that we carry out to ensure the quality of our code. A large portion of this entails writing test cases and testing each unit of our application using random test data. Actual data for our application comes in when we release it to production, but during the development process we need fake data similar to real data for testing purposes. The popular open source library Faker provides us with the ability to generate different data suitable for a wide range of scenarios.
</blockquote>
<p>
Faker uses built-in data providers like "Person", "Company", "DateTime" and "UserAgent" to give you randomized output from the data sets you define. Code is included showing how to create the provider in your objects, extending the correct provider and making a request for a property. A real-world example is also included about testing an email marketing engine for address, title, name and content. There's also a little bit added at the end showing how you can increase the randomness of the results returned by "seeding" the Faker engine.
</p>]]></description>
      <pubDate>Tue, 19 Feb 2013 12:09:02 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Paul Reinheimer: XHGui and MongoDB]]></title>
      <guid>http://www.phpdeveloper.org/news/18949</guid>
      <link>http://www.phpdeveloper.org/news/18949</link>
      <description><![CDATA[<p>
<i>Paul Reinhemier</i> has <a href="http://blog.preinheimer.com/index.php?/archives/403-XHGui-on-MongoDB.html">written up  post</a> sharing his creation of the code to get <a href="https://github.com/preinheimer/xhgui">XHGui working with MongoDB</a>.
</p>
<blockquote>
<a href="http://mark-story.com/posts/archive">Mark Story</a> & I are pleased as punch to introduce <a href="https://github.com/preinheimer/xhgui">XHGui on MongoDB</a>. Our goal was to get as close to the original feature set of the tool I worked on a few years ago (which leveraged the starting point provided by Facebook) and then to release what we had. What we've got now works; there's still a good distance to go, but we think it's far enough that we can ask for help form the community at large.
</blockquote>
<p>
The tool collects XHProf data and stores it into a MongoDB database and allows you to <a href="http://blog.preinheimer.com/uploads/runpage.png">view</a> <a href="http://blog.preinheimer.com/uploads/urlpage.png">recent</a> activity. There's a few warnings that he includes with the post, so be sure to read those through if you plan on using the tool.
</p>]]></description>
      <pubDate>Wed, 26 Dec 2012 10:02:01 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Ulrich Kautz: PHP Validation & Sanitization]]></title>
      <guid>http://www.phpdeveloper.org/news/18815</guid>
      <link>http://www.phpdeveloper.org/news/18815</link>
      <description><![CDATA[<p>
<i>Ulrich Kautz</i> has recently taken a look at <a href="http://foaa.de/blog/2012/11/27/php-validation-and-sanitization/">validation and sanitization</a> of data in PHP applications. He talks about several different methods - both in core PHP and in various frameworks.
</p>
<blockquote>
Validation and sanitization are extremely important topics, any developer should be aware of. Especially with powerful, modern frameworks, people seem to forget about the underlying concepts and wrongly assume it's already solved somehow. Correctly used and early on integrated, both play the central role in defending against attacks on your application.
</blockquote>
<p>
He talks a bit about why you should care about the topic, some of the common issues/threats that could come up because of it and some general information on what validation and sanitization are. He looks at implementation with the <a href="http://www.php.net/manual/en/intro.filter.php">filter extension</a> and touches on functionality from Symfony 2, Laravel 3, CakePHP 2 and shares <a href="https://github.com/fortrabbit/datafilter">his own data filtering module</a> with examples of its use.
</p>]]></description>
      <pubDate>Wed, 28 Nov 2012 11:57:35 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Shashikant Jagtap: Automating Web Performance Data Collection with Behat and BrowserMob Proxy]]></title>
      <guid>http://www.phpdeveloper.org/news/18679</guid>
      <link>http://www.phpdeveloper.org/news/18679</link>
      <description><![CDATA[<p>
<i>Shashikant Jagtap</i> has <a href="https://lestbddphp.wordpress.com/2012/10/30/automating-web-performance-data-collection-with-behat-and-browsermob-proxy/>a new post</a> to his site about using the PHP-based <a href="http://behat.org">Behat</a> TDD testing tool and the <a href="http://opensource.webmetrics.com/browsermob-proxy/">BrowserMob-Proxy</a> to make an automated system that collects performance data on your applications (including load time, recording headers and simulations of network traffic and latency).
</p>
<blockquote>
BrowserMob Proxy is a utility which is used for capuring HTTP traffic and performance data from the browser. <a href="http://opensource.webmetrics.com/browsermob-proxy/">BrowserMob-Proxy</a> adds in essential missing capabilities such as checking HTTP status codes and injecting headers for HTTP Basic Auth. Web Perfomance data can be manually captured by other tools like Firebug or Developers Tools. Using BrowserMob Proxy we can capture perfonace data in <a href="http://www.softwareishard.com/blog/har-12-spec/">HAR</a> format while running automated tests.
</blockquote>
<p>
He includes the commands you'll need to set up the PHP interface for BrowserMob (<a href="https://github.com/Element-34/PHPBrowserMobProxy">PHPBrowserMob</a>) the <a href="http://opensource.webmetrics.com/browsermob-proxy/">proxy itself</a> and a sample test and context file that runs some checks against Facebook.
</p>]]></description>
      <pubDate>Wed, 31 Oct 2012 10:19:40 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[MaltBlue.com: Painless Data Traversal with PHP FilterIterators]]></title>
      <guid>http://www.phpdeveloper.org/news/18654</guid>
      <link>http://www.phpdeveloper.org/news/18654</link>
      <description><![CDATA[<p>
On the MaltBlue blog <i>Matt Setter</i> has a new post introducing you to <a href="http://www.maltblue.com/php/painless-data-traversal-with-php-filteriterators">using FilterIterators for data traversal</a>:
</p>
<blockquote>
There's load of ways to traverse data, especially in PHP where there are a variety of loops available; including while, do while, for and foreach. These are fine for normal structures, such as scalar and associative arrays. But what if you want to get a bit more fancy?
</blockquote>
<p>
He includes a bit of code showing the typical looping approach that a lot of developers take and how, using a <a href="http://php.net/filteriterator">FilterIterator</a>, you can extend the default and make a custom "accept" method to remove certain matching items from the data set.
</p>]]></description>
      <pubDate>Thu, 25 Oct 2012 08:54:35 -0500</pubDate>
    </item>
  </channel>
</rss>
