<?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>Thu, 23 May 2013 06:50:39 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[PHPMaster.com: Openbiz Cubi: A Robust PHP Application Framework, Part 2]]></title>
      <guid>http://www.phpdeveloper.org/news/19618</guid>
      <link>http://www.phpdeveloper.org/news/19618</link>
      <description><![CDATA[<p>
PHPMaster.com has posted the second part of their look at the Openbiz Cubi framework (<a href="http://phpdeveloper.org/news/19599">part one here</a>), this time focusing on the code - mostly XML - that you'll need to create your own custom module.
</p>
<blockquote>
In the first part of this series we talked about the development challenges we face and how Openbiz Cubi can help by providing a solid, ready-to-use web application framework. In this part we'll see how to build our own module and dive a bit deeper into the core architecture of the framework.
</blockquote>
<p>
They include the SQL you'll need to run to create a new table for the "Customer" module they're going to help you build. With that in place, they walk you through the command to execute to make the module skeleton, the locations of the XML files to work with and the contents of each. Included in the module are things like a data object, a module description file and the form object. He finishes up the post with a look at the overall flow of the Cubi execution so you know where each piece falls.
</p>
Link: http://phpmaster.com/openbiz-cubi-a-robust-php-application-framework-2]]></description>
      <pubDate>Wed, 22 May 2013 10:27:16 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[NetTuts.com: Your One-Stop Guide to Laravel Commands]]></title>
      <guid>http://www.phpdeveloper.org/news/19257</guid>
      <link>http://www.phpdeveloper.org/news/19257</link>
      <description><![CDATA[<p>
Over on NetTuts.com today they've published a <a href="http://net.tutsplus.com/tutorials/php/your-one-stop-guide-to-laravel-commands">"one stop guide" to creating Laravel commands</a> that can make using the <a href="http://laravel.com">Laravel PHP framework</a> simpler. The format for these commands are more related to the <a href="http://four.laravel.com">Laravel 4</a> version of the framework (still in beta).
</p>
<blockquote>
In this day and age, it's quite normal for a developer to have an understanding of consoles, and how to issue basic commands. But what if you could code your own custom commands to improve your workflow? If we look back to Laravel 3, you might remember that it offered tasks. Tasks were extremely helpful, but still came up short for more complex operations. Thankfully, Laravel 4 packs a beefed up Artisan that will make your life as a developer so much easier!
</blockquote>
<p>
They start by introducing you to Artisan and what it can do already, then move into how you can create you own custom commands (with code examples). They show you how to add a description, coloring for the output, work with arguments, use confirm/question prompts and working with dependencies you might need.
</p>]]></description>
      <pubDate>Fri, 01 Mar 2013 10:56:44 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Joshua Thijssen: Custom symfony2 config loader]]></title>
      <guid>http://www.phpdeveloper.org/news/19111</guid>
      <link>http://www.phpdeveloper.org/news/19111</link>
      <description><![CDATA[<p>
In <a href="http://www.adayinthelifeof.nl/2013/01/30/custom-symfony2-config-loader/">his latest post</a> <i>Joshua Thjissen</i> looks at the creation of a custom configuration loader for a Symfony2 application. This kind of thing is mostly useful for parsing configurations that Symfony2 doesn't already know how to parse.
</p>
<blockquote>
It happens more and more: large projects where your symfony2 site is just a small part in the big picture. Lots of additional components might even play a bigger part, especially when you are dealing with asynchronous components  which are connected through message queues for instance. [...] Our first idea is obvious: symfony2 uses by default a parameters.yml file, which gets imported by your configuration (config.yml) [...] So nothing new here and this setup works perfectly, provided that your symfony2 project is the ONLY thing that needs to be configured. As soon as you add multiple other components (like gearman or activemq workers that need to connect to solr too), they need to share this configuration. 
</blockquote>
<p>
His solution involves falling back to the INI-file format that's known as useful for several different languages and tools. Because of how Symfony2 reads these files though (only looking for "parameters") he's had to create a "ConfFileLoader" instance of the "FileLoader" that uses the <a href="http://php.net/parse_ini_file"> parse_ini_file</a> method to parse the data and return it back to the main container as parameters. He also includes the code/config you'll need to implement this custom loader into your application.
</p>]]></description>
      <pubDate>Wed, 30 Jan 2013 11:51:47 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Exceptional Exceptions]]></title>
      <guid>http://www.phpdeveloper.org/news/18761</guid>
      <link>http://www.phpdeveloper.org/news/18761</link>
      <description><![CDATA[<p>
On PHPMaster.com today they have a new post from <i>Remi Woler</i> about "<a href="http://phpmaster.com/exceptional-exceptions/">exceptional exceptions</a>" - using exceptions to handle the flow of your application's execution a bit better.
</p>
<blockquote>
Unlike errors, exceptions are designed to be handled by the calling code and will bubble up the execution chain until they are caught. Code in the current scope will stop executing as soon as an exception is thrown (so any lines after a throw statement won't be executed) and control is handed back to the first matching exception handler (either a catch block, configured exception handler, or language-provided exception handler). Only when an exception is caught will code execution continue from there. This article does not aim to teach you exceptions at a 101 level, but instead gives an opinion on how to use exceptions better
</blockquote>
<p>
The post helps you determine the difference between an error and an exceptional event and gives examples of the sorts of things he considers exceptions useful for. He also talks about throwing different kinds of exceptions to make their context more meaningful, but notes that this has been known to cause trouble if used too much. 
</p>
<blockquote>
In summary, only throw exceptions when your code cannot complete the requested instruction with the given input, always throw a custom exception that actually tells the calling code what the situation is, and if you call other code then only catch the exceptions that you can and should handle.
</blockquote>]]></description>
      <pubDate>Fri, 16 Nov 2012 11:49:08 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Setting Custom Error Messages for Zend_Form_Element]]></title>
      <guid>http://www.phpdeveloper.org/news/18589</guid>
      <link>http://www.phpdeveloper.org/news/18589</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a new post for all the Zend Framework (v1) users out there. In it, <i>Aurelio De Rosa</i> shows you how to <a href="http://phpmaster.com/setting-custom-error-messages-for-zend_form_element/">set custom error messages</a> for elements in a Zend_Form.
</p>
<blockquote>
In this article I'll show the solution to a common problem which arises when a developer has to create a non-English website or application that is based on the Zend Framework. How do we mark a field of a Zend_Form which is a Zend_Form_Element as invalid, showing one or more custom error messages? The problem is mainly caused by the native counter-intuitive methods of the Zend_Form_Element class which I'll explain in more details.
</blockquote>
<p>
He's included a basic example showing the creation of a form and the setup of a text element and some validators to match. He makes a controller and view to handle the output and submission then shows how to use "setErrors" (and "setErrorMessages") of the Zend_Form elements to setup that custom error. This only lets you set one message, though, regardless of the point of failure. To stop things when there's an error, you have to set the "breakChainOnFailure" parameter on the validator to false - then the message will make more sense.
</p>]]></description>
      <pubDate>Thu, 11 Oct 2012 08:58:37 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Juan Treminio: Composer Namespaces in 5 Minutes]]></title>
      <guid>http://www.phpdeveloper.org/news/18546</guid>
      <link>http://www.phpdeveloper.org/news/18546</link>
      <description><![CDATA[<p>
<i>Juan Treminio</i> has a new post to his site today talking about <a href="http://jtreminio.com/2012/10/composer-namespaces-in-5-minutes/">Composer and namespacing</a> and shows you how the two work together to make using 3rd party tools easy.
</p>
<blockquote>
You've heard of Composer, right? The nifty new tool for PHP that aims to centralize and streamline package management? Do you also know of, but don't really understand how namespaces work in PHP? Then let's set you straight! In 5 minutes you'll learn how Composer's autoloader and namespaces work!
</blockquote>
<p>He's broken it up into a few sections:</p>
<ul>
<li>Getting Composer up and running
<li>Making a basic "composer.json" file
<li>Going through what the "install" creates (including the "autoload_namespaces.php" file)
<li>Using the vendor/ autoloader
</ul>
<p>
As a bonus, he also shows how to implement your own namespacing in the "composer.json" file if you have a special case - just use the "autoload" section in the configuration (examples included).
</p>]]></description>
      <pubDate>Tue, 02 Oct 2012 15:47:32 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Testing Error Conditions with PHPUnit]]></title>
      <guid>http://www.phpdeveloper.org/news/18543</guid>
      <link>http://www.phpdeveloper.org/news/18543</link>
      <description><![CDATA[<p>
Over on PHPMaster.com there's a new post for the unit testers in the audience (you all unit test, right?) from <i>Matt Turland</i> about <a href="http://phpmaster.com/testing-error-conditions-with-phpunit/">testing error conditions</a> in your applications.
</p>
<blockquote>
Let's say you're maintaining code that uses PHP's native trigger_error() function to log error information. Let's also say that you're in the process of <a href="http://phpmaster.com/getting-started-with-phpunit/">using PHPUnit</a> to write unit tests for that code. If you refer to the PHPUnit manual, there's a section that deals with <a href="http://www.phpunit.de/manual/current/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.errors">testing for error condition</a>.  [...] However, depending on what your code looks like, it's possible that you'll run into a problem with PHPUnit's approach to this. This article will detail what this problem is, how it impacts your ability to test your code, and how to go about solving it.
</blockquote>
<p>
He points out that, since errors and exceptions handle differently, you have to work with them differently in your tests. PHPUnit has a feature that automatically turns errors into a specific type of exception when they're thrown and how, by using a simple custom error handler, you can more correctly tests error vs exception.
</p>]]></description>
      <pubDate>Tue, 02 Oct 2012 11:57:40 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Amazon DynamoDB: Store PHP Sessions with Load Balancer]]></title>
      <guid>http://www.phpdeveloper.org/news/18474</guid>
      <link>http://www.phpdeveloper.org/news/18474</link>
      <description><![CDATA[<p>
PHPMaster.com has a new tutorial posted showing how you can <a href="http://phpmaster.com/amazon-dynamodb-store-php-sessions-with-load-balancer/">work with the Amazon DynamoDB</a> to store session information from your PHP application (originally posted on <a href="http://cloudspring.com/">CloudSpring</a>).
</p>
<blockquote>
This tutorial will show you how to use Amazon DynamoDB as a storage facility for PHP sessions. This method becomes very useful when your applications take advantage of the Elastic Load Balancing and Autoscaling services. You will need Amazon AWS account enabled to use EC2, Elastic Load Balancer and DynamoDB as a prerequisite to play along the tutorial.
</blockquote>
<p>
He starts with a description of what the elastic load balancing service is and how it autoscales. He shows how, based on <a href="https://github.com/cloudspring/AWSDynamoDBSession_PHP">this demo application</a>, to use a custom PHP session handler that implements the Amazon SDK libraries to hook into the DynamoDB service. Also included are screenshots (and the steps that go with them) to configure the service itself.
</p>]]></description>
      <pubDate>Thu, 13 Sep 2012 11:19:57 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Robert Basic: Working with custom view helpers in Zend Framework 2]]></title>
      <guid>http://www.phpdeveloper.org/news/18468</guid>
      <link>http://www.phpdeveloper.org/news/18468</link>
      <description><![CDATA[<p>
In his latest post <i>Robert Basic</i> looks at <a href="http://robertbasic.com/blog/working-with-custom-view-helpers-in-zend-framework-2">working with custom view helpers</a> in your Zend Framework 2 application and shows how to implement a simple one to display a simple greeting.
</p>
<blockquote>
I took the skeleton [Zend Framework 2] application, made it even skinnier by throwing out some (for me) unneeded parts and just put it all besides my old ZF1 code. [...] The first problem I ran into was using custom view helpers, especially view helpers that are more general and don't fit into one specific module. Where to put the code? How to access them in views? The second problem was how to access the service manager from a view helper? And the third problem was how to tell the helper to use a specific value when inside a specific module?
</blockquote>
<p>
He includes a simple example - the greeting helper - and shows where to place it in the application structure, how to work with the service locator inside it and how to set up some module-specific views inside.
</p>]]></description>
      <pubDate>Wed, 12 Sep 2012 09:27:08 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Thomas Weinart: What Iterators Can Do For You]]></title>
      <guid>http://www.phpdeveloper.org/news/18301</guid>
      <link>http://www.phpdeveloper.org/news/18301</link>
      <description><![CDATA[<p>
<i>Thomas Weinert</i> has a new post to his site showing some of the things that <a href="http://www.a-basketful-of-papayas.net/2012/07/what-iterators-can-do-for-you.html">iterators can do for you</a> (including working with arrays and aggregation).
</p>
<blockquote>
Basically Iterators provide a list interface for an object. Like all interfaces they are a contract how something can be used. If you use an interface it is not relevant how it is implemented - the implementation logic is encapsulated. It is of course relevant on the integration level. A bad implementation can impact the performance of you application. Even an good implementation may need special resources (like a database). But all this does not impact how you use it. Your code using the object with the Iterator interface stays the same.
</blockquote>
<p>
He shows how to use the <a href="http://php.net/IteratorAggregate"> IteratorAggregate</a>, <a href="http://php.net/ArrayIterator"> ArrayIterator</a>,  <a href="http://php.net/FilterIterator"> FilterIterator</a> and how to create a custom Iterator that you can extend in your own code.
</p>]]></description>
      <pubDate>Wed, 01 Aug 2012 09:55:22 -0500</pubDate>
    </item>
  </channel>
</rss>
