<?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>Fri, 24 May 2013 12:49:03 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Lorna Mitchell: Simplest PHP Generator Example]]></title>
      <guid>http://www.phpdeveloper.org/news/19623</guid>
      <link>http://www.phpdeveloper.org/news/19623</link>
      <description><![CDATA[<p>
On her blog <i>Lorna Mitchell</i> has posted an example of a <a href="http://www.lornajane.net/posts/2013/simplest-php-generator-example">basic generator</a> written in PHP, a feature of the upcoming PHP version 5.5</a>.
</p>
<blockquote>
I really like the generators feature that's arriving in PHP 5.5, and since we're now into release candidate releases, it's actually not that far away. I've been speaking on this topic and I thought I'd share my trivially simple code example from my slides.
</blockquote>
<p>
She includes an example of a very basic generator using the new "yield" keyword and how to implement it in a simple foreach loop. There's also a little talk about when is a good time to use generators in your applications (two examples: complex number calculation and working with large data sets a chunk at a time). For more information on how these generators will work, check out <a href="http://php.net/manual/en/language.generators.overview.php">this page</a> in the PHP manual.
</p>
Link: http://www.lornajane.net/posts/2013/simplest-php-generator-example]]></description>
      <pubDate>Thu, 23 May 2013 10:31:02 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Rob Allen: Simple logging of ZF2 exceptions]]></title>
      <guid>http://www.phpdeveloper.org/news/19507</guid>
      <link>http://www.phpdeveloper.org/news/19507</link>
      <description><![CDATA[<p>
In <a href="http://akrabat.com/zend-framework-2/simple-logging-of-zf2-exceptions/">this new post to his site</a> <i>Rob Allen</i> shows you how to implement a simple logging method for catching exceptions in your Zend Framework 2 application.
</p>
<blockquote>
I recently had a problem with a ZF2 based website where users were reporting seeing the error page displayed, but I couldn't reproduce in testing. To find this problem I decided to log every exception to a file so I could then go back and work out what was happening. In a standard ZF2 application, the easiest way to do this is to add a listener to the 'dispatch.error' event and log using ZendLog.
</blockquote>
<p>
He uses an event listener to attach a service that contains a "logException" method. This method uses the ZendLog component to write out the error message to a local log file including a backtrace of where the issue occurred.
</p>
Link: http://akrabat.com/zend-framework-2/simple-logging-of-zf2-exceptions]]></description>
      <pubDate>Thu, 25 Apr 2013 10:31:40 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Vance Lucas: Valitron: The Simple Validation Library That Doesn't Suck]]></title>
      <guid>http://www.phpdeveloper.org/news/19272</guid>
      <link>http://www.phpdeveloper.org/news/19272</link>
      <description><![CDATA[<p>
<i>Vance Lucas</i> has created a "<a href="http://www.vancelucas.com/blog/valitron-the-simple-validation-library-that-doesnt-suck/">validation library that dosen't suck</a>" and posted about it to his site - his <a href="https://github.com/vlucas/valitron">Valitron</a> library.
</p>
<blockquote>
<a href="https://github.com/vlucas/valitron">Valitron</a> is a simple, minimal and elegant stand-alone PHP validation library with NO dependencies. Valitron uses simple, straightforward validation methods with a focus on readable and concise syntax.
</blockquote>
<p>
He created the library because of frustration with other tools that had (sometimes major) dependencies on other packages. All he wanted was something lightweight and easy to use that was flexible about how it handled its validation rules. <a href="https://github.com/vlucas/valitron">Valitron</a> lets you apply a validation (like "required") against multiple fields in the provided data and includes checks for things like length, valid IP, active URL, alpha-numeric, date format and regular expression match. You can also add custom validation rules via a callback/closure.
</p>]]></description>
      <pubDate>Tue, 05 Mar 2013 11:43:24 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Anthony Ferrara: Designing An API: Simplified Password Hashing]]></title>
      <guid>http://www.phpdeveloper.org/news/18768</guid>
      <link>http://www.phpdeveloper.org/news/18768</link>
      <description><![CDATA[<p>
A while back <i>Anthony Ferrara</i> proposed a standardized password hashing feature to be included into the core of PHP. It was <a href="https://wiki.php.net/rfc/password_hash">voted on</a> and it was decided it would be introduced in the PHP 5.5 releases. <i>Anthony</i> has <a href="http://blog.ircmaxell.com/2012/11/designing-api-simplified-password.html">written up a new post</a> talking some about his process in making this upcoming feature and answering some of the most common questions he's gotten about it.
</p>
<blockquote>
The other day, <a href="http://www.php.net/archive/2012.php#id2012-11-15-1">PHP 5.5 Alpha 1</a> was released to the public for the first round of testing the new features that are coming out. One of those new features is the <a href="https://wiki.php.net/rfc/password_hash">Simplified Password Hashing API</a> that I proposed (and was accepted). I have received a lot of feedback and criticism of the new API in the months since it's been committed. I figured now that Alpha 1 is out and people can play with it, I should respond to some of those items, and give a little bit more insight into why it was built the way it was...
</blockquote>
<p>
He talks about some of his goals with the use of the functionality (simplicity, something "the 99%" can use) ans answers questions about:
</p>
<ul>
<li>Why the functions aren't namespaced
<li>Why it's not just a class that can be included when needed
<li>The choice of not going with an OOP interface
<li>Why PBKDF2 and Crypt-SHA-512 aren't supported
</ul>
<p>
...and several other questions, but you'll have to <a href="http://blog.ircmaxell.com/2012/11/designing-api-simplified-password.html">read the full post</a> for the rest of those. You can find out a lot about the API for this functionality from <a href="https://wiki.php.net/rfc/password_hash">its wiki page</a> and, if you'd like to try it out (in an alpha state), you can <a href="http://www.php.net/archive/2012.php#id2012-11-15-1">download this version of PHP</a> and compile it yourself.
</p>]]></description>
      <pubDate>Mon, 19 Nov 2012 12:42:22 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Chris Hartjes' Blog: Simple API Testing Using Behat]]></title>
      <guid>http://www.phpdeveloper.org/news/17589</guid>
      <link>http://www.phpdeveloper.org/news/17589</link>
      <description><![CDATA[<p>
<i>Chris Hartjes</i> has taken some of his first steps to testing a web service with the help of the <a href="http://behat.org">Behat</a> BDD testing framework. In <a href="http://www.littlehart.net/atthekeyboard/2012/02/26/simple-api-testing-with-behat/">this new post</a> he shares some of that knowledge and a bit of code to help guide you if you'd like to get started yourself.
</p>
<blockquote>
I have been trying to push my JavaScript skills lately by first playing around with Node.js to get a feel for event-driven server-side coding and by trying to build something semi-useful using <a href="http://knockoutjs.com/">Knockout</a>. [...] After working with PHPUnit's "assert that the result matches expectations" philosophy, switching to using a behavioural approach has changed how I decide to approach actually testing something. 
</blockquote>
<p>
He shows how to define a "scenario" in a more recognizable sort of English. His example is testing a web service to ensure of a few things:
</p>
<ul>
<li>the response is JSON
<li>it contains at least one transaction
<li>the first transaction has an ID, contains two teams and has a description
</ul>
<p>
Included in the post is the resulting Behat test code (generated and modified with his testing details) and an example of the execution of the test.
</p>
<blockquote>
I think that the BDD approach maps better to a results-oriented methodology when it comes to testing: you are using real-life scenarios to make sure that you are getting back the results you are expecting. In the end. that is still the goal of testing.
</blockquote>]]></description>
      <pubDate>Mon, 27 Feb 2012 10:09:18 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: WordPress Plugin Development]]></title>
      <guid>http://www.phpdeveloper.org/news/17561</guid>
      <link>http://www.phpdeveloper.org/news/17561</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a new tutorial showing how you can <a href="http://phpmaster.com/wordpress-plugin-development/">create a custom WordPress plugin</a> for the popular PHP-based blogging/CMS tool.
</p>
<blockquote>
If you've ever used WordPress to build a site quickly, chances are you've used one of the many plugins that are offered to extend the functionality of this popular blogging software. Plugins are one of the many things that make WordPress so attractive. [...] There are times, however, when you can't quite find what you need from existing plugins. This article will show you how to create your own WordPress plugins by walking you through an example to display some text using a widget in a the sidebar.
</blockquote>
<p>
He walks you through all of the steps you'll need to create the plugin - making the main plugin file (definition) and using some of the methods available to create the functionality: update, form, widget and the constructor to set it all up.
</p>]]></description>
      <pubDate>Mon, 20 Feb 2012 10:50:39 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Dave Marshall's Blog: Phpmig - Simple migrations for php]]></title>
      <guid>http://www.phpdeveloper.org/news/17072</guid>
      <link>http://www.phpdeveloper.org/news/17072</link>
      <description><![CDATA[<p>
In a new post to his blog <i>Dave Marshall</i> shares a <a href="http://davedevelopment.co.uk/2011/11/01/phpmig-simple-migrations-for-php.html">homegrown migration tool</a> he's created to help make database migrations a simpler task - <a href="http://github.com/davedevelopment/phpmig">phpmig</a>.
</p>
<blockquote>
I've previously blogged about <a href="http://davedevelopment.co.uk/how-to-simple-database-migrations-with-phing-and-dbdeploy.html">migrations with phing and dbdeploy</a> and also <a href="http://davedevelopment.co.uk/notes-from-porting-ruby-to-php.html">porting ActiveRecord::Migrations to PHP</a>, now here I am again blogging about yet another way of doing migrations in PHP projects. Only maybe this time it's different, maybe this time I've found a way I'm happy with...? <a href="http://github.com/davedevelopment/phpmig">Phpmig</a> is a simple migrations system that was written to be easily adopted regardless of the framework or libraries you are using. It requires a little bit of setting up, but if you know you should be using migrations, you're probably more than capable.
</blockquote>
<p>
He's worked up a sample application to show you how to get things set up and working - a basic <a href="http://silex.sensiolabs.org/">Silex</a>-based application. Phpmig is used to create a basic bootstrap for the deployment that includes the use of <a href="https://github.com/fabpot/Pimple">Pimple</a> for dependency injection and a command-line interface to generate a migration skeleton class for the up/down methods. The source for phpmig can be <a href="https://github.com/davedevelopment/phpmig">found on github</a>.
</p>]]></description>
      <pubDate>Tue, 01 Nov 2011 13:19:02 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Developer Drive: Create Your Own CRUD App with MySQL and PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17067</guid>
      <link>http://www.phpdeveloper.org/news/17067</link>
      <description><![CDATA[<p>
On the Developer Drive blog today there's <a href="http://www.developerdrive.com/2011/11/create-your-own-crud-app-with-mysql-and-php/">a new tutorial</a> helping you build out a simple CRUD (create, read, update and delete) system using a MySQL backend. This is just the first part of the series, introducing you to some concepts and getting the ball rolling connecting PHP and the database.
</p>
<blockquote>
You're may be wondering what exactly CRUD is. CRUD simply stands for Create, Read, Update and Delete and it is the one of the fundamental principles of programming logic that can be expanded and applied to larger projects. For example, let's imagine we're creating a social network and we like to have the ability for users to create accounts, edit and update information for those accounts and also delete said accounts; that is CRUD at work.
</blockquote>
<p>
This <a href="http://www.developerdrive.com/2011/11/create-your-own-crud-app-with-mysql-and-php/">first part</a> covers the structure of the database that'll make up the storage and includes a brief snippet of code to connect your PHP to the database (using PDO).
</p>]]></description>
      <pubDate>Tue, 01 Nov 2011 08:06:52 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPBuilder.com: PHP Simple HTML DOM Parser: Editing HTML Elements in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16833</guid>
      <link>http://www.phpdeveloper.org/news/16833</link>
      <description><![CDATA[<p>
On PHPBuilder.com today there's a new tutorial from <i>Vojislav Janjic</i> about using a <a href="http://www.phpbuilder.com/columns/PHP_HTML_DOM_parser/PHPHTMLDOMParser.cc_09-07-2011.php3">simple DOM parser</a> in PHP to edit the markup even if it's not correctly W3C-formatted - the <a href="http://simplehtmldom.sourceforge.net/">Simple HTML DOM Parser</a>
</p>
<blockquote>
Simple HTML DOM parser is a PHP 5+ class which helps you manipulate HTML elements. The class is not limited to valid HTML; it can also work with HTML code that did not pass W3C validation. Document objects can be found using selectors, similar to those in jQuery. You can find elements by ids, classes, tags, and much more. DOM elements can also be added, deleted or altered. 
</blockquote>
<p>
They help you get started using the parser, passing in the HTML content to be handled (either directly via a string or loading a file) and locating elements in the document either by ID, class or tag. Selectors similar to those in CSS are available. Finally, they show how to find an object and update its contents, either by adding more HTML inside or by appending a new object after it.
</p>]]></description>
      <pubDate>Thu, 08 Sep 2011 10:06:07 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Devshed: Simple and Secure PHP Login Script]]></title>
      <guid>http://www.phpdeveloper.org/news/16645</guid>
      <link>http://www.phpdeveloper.org/news/16645</link>
      <description><![CDATA[<p>
In <a href="http://www.devshed.com/c/a/PHP/Creating-a-Secure-PHP-Login-Script-59941/">this new tutorial</a> on DevShed, they walk you through the creation of a secure login script that uses sha256 encryption, a captcha to prevent automated signups, XSS attack protection and several other features.
</p>
<blockquote>
Recent advancements in PHP offer the developer a variety of tools to improve the security of login systems. [...] This programming tutorial will teach you how to create a simple, yet secure login script utilizing PHP using MySQL and bracing for XSS attack prevention.
</blockquote>
<p>
Other features include no persistent logins, preventing direct file access, an idle timeout on the user session, protection against session fixation and anti-brute force measures. Full (procedural) code is provided as well as screenshots from phpMyAdmin showing the database table structure. You can grab the code for the project <a href="http://www.php-developer.org/php-secure-authentication-of-user-logins/">here</a>.
</p>]]></description>
      <pubDate>Thu, 28 Jul 2011 09:57:39 -0500</pubDate>
    </item>
  </channel>
</rss>
