<?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>Wed, 23 May 2012 04:28:51 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Chris Hartjes' Blog: Metatesting: Extending Your Testing Tools]]></title>
      <guid>http://www.phpdeveloper.org/news/17851</guid>
      <link>http://www.phpdeveloper.org/news/17851</link>
      <description><![CDATA[<p>
<i>Chris Hartjes</i> has had a few posts about "metatesting" already and in <a href="http://www.littlehart.net/atthekeyboard/2012/04/19/metatesting-extending-your-testing-tools/">this latest article</a> he takes the series one more step. He looks at moving outside of the current toolset and expanding on them to meet your testing needs.
</p>
<blockquote>
While <a href="http://phpunit.de/">PHPUnit</a> is awesome out of the box, it still lacks some tools that are required to do things like test protected class methods or assign values to protected class attributes. Lucky for me we have an awesome testing engineer at Kaplan named <a href="https://twitter.com/FreshWillisms">Will Parker</a> who has shown me some ways that they have extended PHPUnit itself to make testing certain things easier.
</blockquote>
<p>
<i>Chris</i> talks about things like testing protected methods (easy thanks to a helper) and checking the value of a class property. The key to both of them lies in using PHP's own <a href="http://php.net/reflection">Reflection</a> functionality to alter properties on the class objects themselves.
</p>]]></description>
      <pubDate>Mon, 23 Apr 2012 11:27:02 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[NetTuts.com: The Ins and Outs of PHP Exceptions]]></title>
      <guid>http://www.phpdeveloper.org/news/16993</guid>
      <link>http://www.phpdeveloper.org/news/16993</link>
      <description><![CDATA[<p>
On NetTuts.com today there's <a href="http://net.tutsplus.com/tutorials/php/the-ins-and-outs-of-php-exceptions/">a new tutorial</a> showing you the "ins and outs" of using <a href="http://php.net/exceptions">exceptions</a> in PHP - throwing them, handling the result and integrating them into your error handling process.
</p>
<blockquote>
Still returning false whenever a function in your program fails? In this article, we'll learn about PHP exceptions, and how you can use them to soup up your application's error handling.
</blockquote>
<p>
The include some of the methods you can call on your exceptions (including getting the message, code, file, line and the results of a <a href="http://php.net/debug_backtrace">debug_backtrace</a> right before it was thrown). Included is code to throw exceptions, catch them with a try/catch and using error codes as return values and extending them to fit your own needs.
</p>]]></description>
      <pubDate>Fri, 14 Oct 2011 08:44:32 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Play nice when extending Exception]]></title>
      <guid>http://www.phpdeveloper.org/news/16397</guid>
      <link>http://www.phpdeveloper.org/news/16397</link>
      <description><![CDATA[<p>
<i>Lukas Smith</i> <a href="http://pooteeweet.org/blog/0/1932#m1932">has a suggestion</a> for developers out there who get the idea to start messing with the order of the parameters of PHP objects/methods - play nice. His example is specifically with Exceptions.
</p>
<blockquote>
This is just a short follow up to a recent tweet of mine. I have seen this repeatedly happen, even to top notch and usually very careful developers (*). I am not sure why this mistake happens so frequently, but quite often you see code that changes the parameter order for custom Exception constructors. I guess it's mostly because in these cases the developer wants to pass some magic parameters that contain the message (and potentially also the code). 
</blockquote>
<p>
He recommends that, if you really do need to change something like the order of the parameters, use something like a <a href="http://en.wikipedia.org/wiki/Factory_method_pattern">factory</a> to handle the reorganization for you.
</p>]]></description>
      <pubDate>Mon, 30 May 2011 09:48:29 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Ralph Schindler's Blog: PHP Component and Library API Design Overview]]></title>
      <guid>http://www.phpdeveloper.org/news/15766</guid>
      <link>http://www.phpdeveloper.org/news/15766</link>
      <description><![CDATA[<p>
<i>Ralph Schindler</i> has <a href="http://ralphschindler.com/2011/01/18/php-component-and-library-api-design-overview">written up a new post</a> for his blog today looking at APIs and some things to consider when building them. These aren't the web service APIs you're thinking of - this is the interfaces your code uses to talk to it's own parts.
</p>
<blockquote>
It's important to have a common understanding of the actual problem area. When we talk about names, we are really talking about the API. An API is a particular set of rules and specifications that a developer can follow to access and make use of the services and resources provided by another particular software program, component or library. Put another way, it is an interface between various software pieces and facilitates their interaction, similar to the way the user interface facilitates interaction between humans and computers.
</blockquote>
<p>
He talks about the two different APIs you're usually building at the same time - a consumption API that is the method others use to consume it and the extension API, how the feature allows others to improve upon it. He shares his own API philosophy and a three tips he's learned along the way to make his APIs more robust:
</p>
<ul>
<li>Adopt A Common Namespace & Class Naming Scheme
<li>Avoid Doing Too Much In the Constructor
<li>Avoid final And private
</ul>]]></description>
      <pubDate>Wed, 19 Jan 2011 09:19:29 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[AjaxRay.com: Extending Zend Form Element to create customized Phone number field]]></title>
      <guid>http://www.phpdeveloper.org/news/15063</guid>
      <link>http://www.phpdeveloper.org/news/15063</link>
      <description><![CDATA[<p>
On the AjaxRay.com site today there's <a href="http://www.ajaxray.com/blog/2010/08/25/extending-zend-form-element-for-customized-phone-number/">a new tutorial</a> for the Zend Framework users out there with a library they can use to extend Zend_Form for custom phone number fields.
</p>
<blockquote>
When taking Phone number as user input, we can worn users about phone number format by setting a hint/description and can validate using Regular Expression. [...] Now, if we try provide this feature in Zend Form, that's possible. We can create three individual Zend_Form_Element_Text objects and join there value together to make the phone number. But, in this case, validating them together is a hassle.
</blockquote>
<p>
Instead of separate fields, <a href="http://www.ajaxray.com/blog/downloads/Zend_Form_Element_Phone">the library</a> they create makes it simple to handle them as a whole field. It works as a helper for Zend_Form and lets you set things like the separator between the text fields, a "format" string and a validator to apply to their fields (in the example code, it's the "digits" validator). Sample code is included to show you how it fits in your form.
</p>]]></description>
      <pubDate>Thu, 02 Sep 2010 08:05:06 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Andrey Hristov's Blog: Replacing mysqli's Connection, Result and Statement classes]]></title>
      <guid>http://www.phpdeveloper.org/news/14770</guid>
      <link>http://www.phpdeveloper.org/news/14770</link>
      <description><![CDATA[<p>
On his blog today <i>Andrey Hristov</i> has <a href="http://hristov.com/oblog/blog/post/2010/07/08/replacing-mysqlis-connection-result-and-statement-classes/">a quick post</a> that talks about two methods to extend the functionality that the mysqli extension offers in PHP with your own custom code.
</p>
<blockquote>
Have you ever though about extending mysqli's classes. It's pretty simple to subclass the connection class mysqli. However, subclassing mysqli_result and mysqli_stmt is not so obvious, actually I though that it's even not possible. However, never say never! After discussing mysqli's OO interface for an hour yesterday [...] I found out how one can plug his own classes.
</blockquote>
<p>
Two code examples are provided - one for extending the mysqli_result and the other extending the mysql_stmt class. You can find more about these and other classes the mysqli extension has to offer in <a href="http://us3.php.net/manual/en/book.mysqli.php">this section of the PHP manual</a>.
</p>]]></description>
      <pubDate>Fri, 09 Jul 2010 10:31:03 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Richard Thomas' Blog: Solar Framework Shorts - Extending Solar's Page Controller]]></title>
      <guid>http://www.phpdeveloper.org/news/13340</guid>
      <link>http://www.phpdeveloper.org/news/13340</link>
      <description><![CDATA[<p>
<i>Richard Thomas</i> has posted <a href="http://www.phpjack.com/content/solar-framework-shorts-extending-solars-page-controller">another "short"</a> in his series looking at the features of the <a href="http://solarphp.com">Solar Framework</a>. This time he focuses on enhancing the base framework functionality by extending the Solar_Controller_Page class.
</p>
<blockquote>
Solar's manual has a getting started section that walks you through setting up a basic app, This app extends "Solar_Controller_Page" which handles a lot of the backend work for you. As you get into your project you will find that pretty much every controller you have needs access to some basic structures and information, how can you ensure these are always available?
</blockquote>
<p>
His example extends the Solar_Controller_Page to provide two model objects automatically to the rest of his application (as protected objects in the base class).
</p>]]></description>
      <pubDate>Tue, 06 Oct 2009 08:24:32 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Zend Developer Zone: Extending Zend Server GUI '" Data Cache Information]]></title>
      <guid>http://www.phpdeveloper.org/news/13207</guid>
      <link>http://www.phpdeveloper.org/news/13207</link>
      <description><![CDATA[<p>
New in the Zend Developer Zone today is <a href="http://devzone.zend.com/article/9677-Extending-Zend-Server-GUI-Data-Cache-Information">this post</a> looking at the Zend Server GUI and how you can extend it to add in data from the Data Cache API.
</p>
<blockquote>
As the GUI of <a href="http://www.zend.com/products/server/">Zend Server</a> is based on the open-source <a href="http://framework.zend.com/">Zend Framework</a>, you can easily extend it. This article demonstrates how to integrate new functionality to Zend Server which makes it possible see the content and some meta information of cached items. For this example I use the Data Cache API from Zend Server, but in combination with the Zend Framework component Zend_Cache and its Zend_Cache_Backend_ZendServer_Disk backend adapter. 
</blockquote>
<p>
He steps through the creation of a new Zend_Cache object and an implementation of the Zend_Cache_Backend_Interface as well as making the new tab for the data to live under in the GUI. The interface is dropped in place and a view and model is added and your end result can <a href="http://devzone.zend.com/images/articles/9677/1.png">look like this</a>.
</p>]]></description>
      <pubDate>Fri, 11 Sep 2009 10:01:16 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Stubbles Blog: Extending objects with new methods at runtime]]></title>
      <guid>http://www.phpdeveloper.org/news/13141</guid>
      <link>http://www.phpdeveloper.org/news/13141</link>
      <description><![CDATA[<p>
On the Stubbles blog today <i>Frank Kleine</i> <a href="http://www.stubbles.org/archives/65-Extending-objects-with-new-methods-at-runtime.html">looks at</a> a cool trick that the features of PHP 5.3 now make possible - extending objects at runtime by adding in new methods and functionality.
</p>
<blockquote>
With the advent of PHP 5.3 adding new methods to an instance of a class at runtime becomes possible with PHP as well, using anonymous functions and a little bit of __call() magic. 
</blockquote>
<p>
He illustrates with a bit of code - defining the base class and using a __call method to catch any undefined method calls. Using this in conjunction with closures makes it possible to call the method internally, avoiding the usual error that could result from setting it like you would a class property.
</p>]]></description>
      <pubDate>Tue, 01 Sep 2009 09:05:46 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Zend Developer Zone: Zend_Tool for the Developer]]></title>
      <guid>http://www.phpdeveloper.org/news/11746</guid>
      <link>http://www.phpdeveloper.org/news/11746</link>
      <description><![CDATA[<p>
<i>Ralph Schindler</i> has <a href="http://devzone.zend.com/article/4124-Zend_Tool-for-the-Developer">a recent tutorial</a> posted to the Zend Developer Zone site looking at how you can extend the <a href="http://framework.zend.com/svn/framework/standard/incubator/library/Zend/Tool/">Zend_Tool</a> component of the Zend Framework to meet your needs.
</p>
<blockquote>
In order to understand how to extend Zend_Tool, you need to know a few things about its overall structure. The whole of the system was built with extensibility in mind. Each of the major functional parts of the system are abstracted in such a way that its easy to not only extend, but to replace with completely separate implementations. [...] But for our first order of business, we'll demonstrate how to add new commands to the Zend_Tool system. 
</blockquote>
<p>
He dives into the details of the Zend_Tool internals (including the Manifest component, the Provider_Version and the Provider_interface) before getting into the example code of the actual extension. He makes the typical "Hello World" example and shows how, with a simple command line call, you can execute the provider.
</p>]]></description>
      <pubDate>Thu, 15 Jan 2009 10:21:35 -0600</pubDate>
    </item>
  </channel>
</rss>

