<?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, 24 May 2012 18:18:38 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Paul Reinheimer's Blog: Sending Mail]]></title>
      <guid>http://www.phpdeveloper.org/news/17997</guid>
      <link>http://www.phpdeveloper.org/news/17997</link>
      <description><![CDATA[<p>
<i>Paul Reinheimer</i> has <a href="http://blog.preinheimer.com/index.php?/archives/383-Sending-Mail.html">posted about his experiences with sending mail</a>, specifically as it relates to using the <a href="http://framework.zend.com/manual/en/zend.mail.html">Zend_Mail</a> component from the Zend Framework to handle the details.
</p>
<blockquote>
Like every product, Natural Load Testing needs to send some mail, having written and re-written a bunch of different blocks of mail code over the years, I wanted to come up with something that would work now, and continue to serve us well into the future.
</blockquote>
<p>
He chose Zend_Mail to fulfill some of his requirements (multipart emails, sending custom emails, templates for automatic emails) and includes some sample code showing it at work. The result is an object that can be created and, by calling a "basic" method, can send an email based on an HTML template (using the <a href="http://htmlemailboilerplate.com/">HTML Email Boilerplate</a> for the base styling).
</p>]]></description>
      <pubDate>Wed, 23 May 2012 12:58:29 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Lineke Kerckhoffs-Willems' Blog: How to use the Symfony2 SonataAdminBundle]]></title>
      <guid>http://www.phpdeveloper.org/news/17995</guid>
      <link>http://www.phpdeveloper.org/news/17995</link>
      <description><![CDATA[<p>
In <a href="http://www.phpassionate.com/2012/05/22/how-to-use-the-symfony2-sonataadminbundle/">this recent post</a> to her blog <i>Lineke Kerckhoffs-Willems</i> talks about some recent Symfony2 development she's been doing and some of the trials she's come across when trying to implement the <a href="http://sonata-project.org/bundles/admin/2-0/doc/index.html">SonataAdminBundle</a> to build on their pre-existing Doctrine2 entities.
</p>
<blockquote>
I have been doing a lot of Symfony2 development lately for our project ProTalk and one of the things we needed was a backend for our database. This should be a fairly simple backend to start with, just an easy way to get data into the database. So I thought I would use the SonataAdminBundle to easy generate this backend based on the doctrine2 entities that we already have. Eventually, I got it working, but it took me some time to find out exactly how, so I thought I'd share my experiences.
</blockquote>
<p>
Based on some information she found in <a href="http://blog.quadspot.de/wordpress/symfony2/setting-up-a-symfony2-project-with-fosuserbundle-sonatauserbundle-and-sonataadminbundle">this other post</a>, she was able to configure and connect it to a "tag" entity. To make it work, however, she needed an empty controller to move forward.
</p>]]></description>
      <pubDate>Wed, 23 May 2012 10:33:05 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Michael Nitschinger's Blog: A primer on PHP exceptions]]></title>
      <guid>http://www.phpdeveloper.org/news/17994</guid>
      <link>http://www.phpdeveloper.org/news/17994</link>
      <description><![CDATA[<p>
<i>Michael Nitschinger</i> has a new post focusing on one of the more commonly used, but maybe just as commonly misunderstood, part of PHP - <a href="http://nitschinger.at/A-primer-on-PHP-exceptions">exceptions and their handling</a>. His latest post looks at what Exceptions in PHP have to offer and provides some "best practices" in their use.
</p>
<blockquote>
Exceptions are and should be an integral part of any general purpose programming language. PHP introduced them long ago (with the release of PHP 5 or 5.1), but it still seems that many of the concepts are not fully understood or ignored by the community. This post aims to be a solid introduction to exception architecture, handling and testing. At the end of the post you should be able to know when to raise an exception and how it should look like.
</blockquote>
<p>
He talks about situations when (and when not) to use exceptions, normalizing them for easier try/catch-ing and includes the exception class hierarchy, including the types pulled from the <a href="http://php.net/spl">SPL</a>. He shows examples (based on the <a href="http://lithify.me/">Lithium</a> framework's namespacing)  how to create "namespaced exceptions" and how to use these in a bit of sample code. He also mentions the use of the custom <a href="http://us.php.net/manual/en/class.errorexception.php">error handling with the ErrorException</a> as well as a quick look at testing these basic and custom exceptions correctly (PHPUnit-based tests).
</p>]]></description>
      <pubDate>Wed, 23 May 2012 09:17:41 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[9Lessons.info: Login with Instagram OAuth using PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17993</guid>
      <link>http://www.phpdeveloper.org/news/17993</link>
      <description><![CDATA[<p>
On the 9Lessons blog there's a recent tutorial showing you how to <a href="http://www.9lessons.info/2012/05/login-with-instagram-php.html">log into Instagram via OAuth</a> with the help of their <a href="https://www.box.com/s/4b763153ca5d99efa1e3">Instagram class</a>.
</p>
<blockquote>
The very quick registration gives you many users to your web project, we already published login with Facebook, Twitter and Google Plus now time to think about very popular photo sharing portal Instagram. This post explains you how to login with instagram Oauth API and importing user data. Create an instagram account and take a quick look at this demo thanks!
</blockquote>
<p>
The tutorial walks you through the process of setting up an application in the Instagram service, configuring the scripts with the API key/secret and callback as well as the code for a simple login page. They've also included code to grab the user's information and "popular media" from the web service and pull that information into a local MySQL database.
</p>]]></description>
      <pubDate>Wed, 23 May 2012 08:46:46 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Derick Rethans' Blog: MongoDB Cursors with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17990</guid>
      <link>http://www.phpdeveloper.org/news/17990</link>
      <description><![CDATA[<p>
<i>Derick Rethans</i> has a new post to his site today about <a href="http://derickrethans.nl/cursors-in-mongodb.html">MongoDB cursors</a> in PHP when using the <a href="http://php.net/mongodb">PHP driver</a> and how it handles pulling data from the server.
</p>
<blockquote>
Recently I was asked to improve the <a href="http://docs.php.net/manual/en/mongocursor.batchsize.php">MongoCursor::batchSize</a> documentation. This began an indepth investigation in how the PHP <a href="http://php.net/mongodb">driver</a> for <a href="http://mongodb.org/">MongoDB</a> handles pulling data that's been queried from the MongoDB server. Here are my findings.
</blockquote>
<p>
He talks about the cursor that's created when a "find" call is made and how you can add on additional options (via other methods on the cursor) to its execution. He also covers how you can set your own batch size, using limit to only fetch a certain number of results and combining the two to make for more memory efficient, yet complete, returned data sets.
</p>]]></description>
      <pubDate>Tue, 22 May 2012 12:23:16 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Till Klampaeckel's Blog: Zend Framework: CRUD]]></title>
      <guid>http://www.phpdeveloper.org/news/17988</guid>
      <link>http://www.phpdeveloper.org/news/17988</link>
      <description><![CDATA[<p>
In <a href="http://till.klampaeckel.de/blog/archives/183-Zend-Framework-CRUD.html">this new post</a> to his blog <i>Till Klampaeckel</i> shares a Zend Framework "base" controller that makes it easier to do the usual CRUD (Create, Read, Update, Delete) operations in an application.
</p>
<blockquote>
I think it took me (or us) a couple attempts to get this right - let me introduce you to Zf_Crud, a CRUD controller for the Zend Framework. [...] Zf_Crud aims to provide you with an interface for any table possible - think of it as a phpMyAdmin more tailored towards your data and (thanks to Twitter Bootstrap and the <a href="https://github.com/easybib/EasyBib_Form_Decorator">Easybib_Form_Decorator</a>) prettier!
</blockquote>
<p>
He <a href="http://till.klampaeckel.de/blog/archives/183-Zend-Framework-CRUD.html">shows how to install and use it</a> (via PEAR or Composer) and an example of a controller extending it. You can <a href="https://github.com/lagged/Zf_Crud/downloads">find the code here</a> on github, ready to clone and try out.
</p>]]></description>
      <pubDate>Tue, 22 May 2012 10:07:20 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[MaltBlue.com: Zend Form Mastery with Zend_Config - Part 3, Standard Form & Element Options]]></title>
      <guid>http://www.phpdeveloper.org/news/17987</guid>
      <link>http://www.phpdeveloper.org/news/17987</link>
      <description><![CDATA[<p>
On the MaltBlue.com blog they've posted the latest part of their series on using Zend_Config configuration files to <a href="http://www.maltblue.com/zend-form/zend-form-mastery-with-zend-config-part-3-standard-form-element-options">create Zend_Form elements</a>. In this latest article, they show how to set some of the other properties on the elements (like "readonly" or "required").
</p>
<blockquote>
We've looked at custom form filters and we've looked at the core form configuration. But what about the other form properties? What about: setting an element as readonly, an element as required, ignoring an element and love them or hate them, what about decorators.
</blockquote>
<p>
He shows how to update the XML file to add these new attributes into the structure and <a href="http://www.maltblue.com/wp-content/uploads/2012/05/Screen-Shot-2012-05-21-at-14.23.38.png">the resulting form</a>. Also included are a few examples of using <a href="http://framework.zend.com/manual/en/zend.form.elements.html#zend.form.elements.decorators">decorators</a> to configure the look, feel and modify the attributes.
</p>]]></description>
      <pubDate>Tue, 22 May 2012 09:16:31 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Using SPL Iterators, Part 2]]></title>
      <guid>http://www.phpdeveloper.org/news/17986</guid>
      <link>http://www.phpdeveloper.org/news/17986</link>
      <description><![CDATA[<p>
On PHPMaster.com today they've posted the <a href="http://phpmaster.com/using-spl-iterators-2/">second part of the series</a> covering the Iterators that come with PHP as a part of the <a href="http://php.net/spl">SPL</a>.
</p>
<blockquote>
In <a href="http://phpmaster.com/using-spl-iterators-1">part one</a> of this series I introduced you to some of the SPL Iterators and how to use them. There may be times however when the provided iterators are insufficient for your needs and you'll want to roll your own custom iterator. Luckily, SPL provides interfaces that will allow you to do just that. For an object to be traversable in a foreach loop, PHP requires that it be an instance of Traversable. You cannot however implement this interface directly (though you can use it in instaceof checks); instead you'll need to implement either SPL's Iterator or IteratorAggregate interfaces.
</blockquote>
<p>
He shows you how to implement these two interfaces in your own custom classes, looping through a set of books for the Iterator example and a "getIterator" method that creates an <a href="http://php.net/arrayiterator">ArrayIterator</a> when executed. The results of both are used in foreach loops showing how they can be used just like any other iteratable variables.
</p>]]></description>
      <pubDate>Tue, 22 May 2012 08:23:17 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: REST - Can You do More than Spell It? Part 4]]></title>
      <guid>http://www.phpdeveloper.org/news/17981</guid>
      <link>http://www.phpdeveloper.org/news/17981</link>
      <description><![CDATA[<p>
PHPMaster.com has posted the latest tutorial in their series covering RESTful APIS - <a href="http://phpmaster.com/rest-can-you-do-more-than-spell-it-4/">part four</a> of "REST - Can you do More than Spell it?" In this latest part of the series, they focus on something very key to RESTful services, the HTTP spec (and headers).
</p>
<blockquote>
We're getting close to the end now, and the only thing remaining is to discuss a little more about the protocol you'll most likely use in any RESTful application that you write. Because HTTP is so often used with REST, that's the protocol I'd like to focus on.
</blockquote>
<p>
He goes through the structure of a typical (raw) HTTP header and talks about some of the more common headers and what actions/settings they represent. He includes examples of setting headers (with <a href="http://php.net/header">header</a>, naturally) and a <a href="http://php.net/curl">curl</a> example showing how to set the request headers. The tutorial is finished off with a brief mention of custom HTTP headers and the the good and bad that comes with them.
</p>]]></description>
      <pubDate>Mon, 21 May 2012 08:44:26 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Community News: "PHP Tip a Day" Blog]]></title>
      <guid>http://www.phpdeveloper.org/news/17972</guid>
      <link>http://www.phpdeveloper.org/news/17972</link>
      <description><![CDATA[<p>
<i>Greg Bulmash</i> has started up a new site that's dedicated to the "tip of the day" sharing of PHP facts he finds out in the course of his development, <a href="http://www.php-tip-a-day.com/">php-tip-a-day.com</a>.
</p>
<blockquote>
I started a daily PHP tip blog a couple of weeks ago, figuring the daily writing will keep me curious about programming. [...[ I've found that I learn things better when I have to absorb them well enough to explain them to someone else, so this site (and a couple others I'm starting up) are my attempt to just solidify my knowledge and push my skills. The goal of writing five brief tutorials about various functions, methods, or solutions each week is meant to force me to keep expanding my knowledge and to help me burn it into my brain. I hope others might find it useful.
</blockquote>
<p>So far he has posts about things like:</p>
<ul>
<li><a href="http://www.php-tip-a-day.com/php-tutorial-the-raw-post-contents-part-1/">Getting the raw POST contents</a> on a request
<li>A series on creating a "meme" site (like the Cheezburger ones): <a href="http://www.php-tip-a-day.com/php-tutorial-creating-a-memegenerator-cheezburger-clone-part-1/">Part 1</a>, <a href="http://www.php-tip-a-day.com/php-tutorial-creating-a-memegenerator-cheezburger-clone-part-2/">Part 2</a>, <a href="http://www.php-tip-a-day.com/php-tutorial-creating-a-memegenerator-cheezburger-clone-part-3/">Part 3</a> & <a href="http://www.php-tip-a-day.com/php-tutorial-creating-a-memegenerator-cheezburger-clone-part/">Part 4</a>
<li><a href="http://www.php-tip-a-day.com/php-tutorial-rest-for-ajax/">REST and Ajax</a>
<li><a href="http://www.php-tip-a-day.com/php-tutorial-timing-your-code/">Timing</a> (benchmarking) your code
<li><a href="http://www.php-tip-a-day.com/php-tutorial-validating-email-addresses/">Validating email addresses</a>
</ul>
<p>
There's lots of <a href="http://www.php-tip-a-day.com/">good content here</a>, especially if you're a beginning developer and want to discover these helpful hints along with him.
</p>]]></description>
      <pubDate>Thu, 17 May 2012 11:07:58 -0500</pubDate>
    </item>
  </channel>
</rss>

