<?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, 19 Jun 2013 02:31:40 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Benjamin Eberlei: Doctrine and SOLID]]></title>
      <guid>http://www.phpdeveloper.org/news/19137</guid>
      <link>http://www.phpdeveloper.org/news/19137</link>
      <description><![CDATA[<p>
<i>Benjamin Eberlei</i> has a new post to his site today answering a question he sometimes gets about <a href="http://www.whitewashing.de/2013/02/04/doctrine_and_solid.html">using Doctrine2 in a SOLID context</a> (more on SOLID development <a href="http://en.wikipedia.org/wiki/SOLID_(object-oriented_design)">here</a>) as it seems difficult to follow the Single Responsibility Principle with how the tool is used.
</p>
<blockquote>
These problems are related to the inability to share behavioral code through aggregation and the complexity of state transformations. Combining both, your average entity with 5-15 fields can end up with hundrets or thousands lines of code. The solutions to both problems boil down to <a href="http://www.jbrains.ca/permalink/the-four-elements-of-simple-design">minimizing duplication and maximizing clarity</a>.
</blockquote>
<p>
He looks at two different kinds of objects Doctrine uses in its setup, the value objects and method objects, and "maximize clarity" on them by dividing them up into more functional-related objects, passed into each other via method injection.
</p>]]></description>
      <pubDate>Tue, 05 Feb 2013 11:09:33 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso: Handling several DBALs in Symfony2 through the Dependency Injection with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/19044</guid>
      <link>http://www.phpdeveloper.org/news/19044</link>
      <description><![CDATA[<p>
<i>Gonzalo Ayuso</i> has a second post in his series looking at using the Symfony2 dependency injection container with Doctrine functionality. In his <a href="http://phpdeveloper.org/news/19007">previous post</a> he talked about sharing PDO connections via the DIC. In <a href="http://gonzalo123.com/2013/01/14/handling-several-dbal-database-connections-in-symfony2-through-the-dependency-injection-container-with-php/">this latest one</a> it's focused on the sharing of DBALs from Doctrine.
</p>
<blockquote>
OK. We can handle PDOs connections inside a Symfony2 application, but what happens if we prefer DBAL. As we know DBAL is built over PDO and adds a set of "extra" features to our database connection. It's something like PDO with steroids.
</blockquote>
<p>
He includes the (PHP) configuration to set up the DBAL and the YAML definition to set it up in the DIC's configuration. As an update to the post, he also points out a bundle for Symfony2 that lets Doctrine do this natively - check out <a href="https://github.com/doctrine/DoctrineBundle/blob/master/Resources/doc/configuration.rst#doctrine-dbal-configuration">this documentation</a> on github.
</p>]]></description>
      <pubDate>Wed, 16 Jan 2013 10:47:32 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Michael Nitschinger: Caching Doctrine Entities with Couchbase]]></title>
      <guid>http://www.phpdeveloper.org/news/19006</guid>
      <link>http://www.phpdeveloper.org/news/19006</link>
      <description><![CDATA[<p>
<i>Michael Nitschinger</i> has a new post to his site today showing how you can <a href="http://nitschinger.at/Caching-Doctrine-Entities-with-Couchbase">cache the entities</a> you've created with Doctrine using <a href="http://www.couchbase.com">Couchbase</a> as a simple caching tool.
</p>
<blockquote>
As part of our ongoing efforts to make Couchbase more integrated with frameworks and libraries, we added caching support for the <a href="http://www.doctrine-project.org/">Doctrine ORM</a>. [...] Caching can either be used standalone (through the API provided by <a href="http://www.doctrine-project.org/projects/common.html">doctrine/common</a>) or integrated with the ORM functionality. We'll look at both variants through simple examples, a good documentation can also be found here. Note that at the time of writing, the CouchbaseCache is not mentioned as a caching driver because the documentation still needs to be updated.
</blockquote>
<p>
He walks you through the steps to get everything you need installed, both through Composer and the <a href="http://www.couchbase.com/develop/php/current">Couchbase extension</a> so your PHP installation will support it. He includes sample code that sets up the cache and shows how to check it to see if a key exists. With this base in place, he expands it out to working with the Doctrine ORM. He shows how to create a sample "Person" entity, inject it into the entity manager and perform a query with the Result Cache to locate the object.
</p>]]></description>
      <pubDate>Tue, 08 Jan 2013 10:19:07 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Sending Email with Swift Mailer]]></title>
      <guid>http://www.phpdeveloper.org/news/18840</guid>
      <link>http://www.phpdeveloper.org/news/18840</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a new tutorial showing you <a href="http://phpmaster.com/sending-email-with-swift-mailer/">how to use Swift Mailer</a>, a popular (and well-established) mailing tool.
</p>
<blockquote>
Sending emails programmatically is a common task that programmers must deal with often. Although you can use PHP's native functions, they can be too low-level, especially when you want to attach one or more files to your message. If you don't want to use the native functions, or if you want to send mail using an object-oriented approach, then this is the article for you. I'll introduce you to <a href="http://swiftmailer.org/">Swift Mailer</a>, a powerful component-based library that let's you send emails easily. Started in 2005, Swift Mailer is a library that provides several classes that allow you to send emails from within your PHP scripts or web applications. 
</blockquote>
<p>
Included in the post are a basic example of sending a plain-text email, working with attachments and including a template into the body of the message (with spots to fill text in).
</p>]]></description>
      <pubDate>Tue, 04 Dec 2012 11:34:54 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Jake Bell: PHP Annotations Are a Horrible Idea]]></title>
      <guid>http://www.phpdeveloper.org/news/18623</guid>
      <link>http://www.phpdeveloper.org/news/18623</link>
      <description><![CDATA[<p>
In his latest post <i>Jake Bell</i> talks about why he thinks <a href="http://theunraveler.com/blog/2012/php-annotations-are-a-horrible-idea/">annotations in PHP are a bad idea</a> (not the concept of them, but how developers are currently using them. He's in favor of <a href="https://wiki.php.net/rfc/annotations">officil support</a> though).
</p>
<blockquote>
Both the Symfony 2 and Doctrine 2 libraries and components make liberal use of what have come to be called annotations - special code comments, usually prefixed with an @ that are actually interpreted by the application and affect its functionality. [...] This trend needs to die.
</blockquote>
<p>
He points out that the use of code comments like this isn't a good practice and applications should never have to rely on them for functionality. He mentions issues with syntax/language functionality (can't use "php -l" on them, can't var_dump an annotation) and that it makes it more difficult to read and interpret the code. He includes an example from Ruby of an alternative and a possible solution in PHP involving a static "mapping" variable.
</p>]]></description>
      <pubDate>Thu, 18 Oct 2012 09:45:56 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Rob Allen: Setting up PHP & MySQL on OS X 10.8 Mountain Lion]]></title>
      <guid>http://www.phpdeveloper.org/news/18422</guid>
      <link>http://www.phpdeveloper.org/news/18422</link>
      <description><![CDATA[<p>
<i>Rob Allen</i> has posted some notes to his site helping you get <a href="http://akrabat.com/computing/setting-up-php-mysql-on-os-x-10-8-mountain-lion/">PHP set up on OSX Lion (10.8)</a> successfully.
</p>
<blockquote>
With OS X 10.8, Apple continues to ship PHP 5.3 with Xdebug, PEAR, GD and PDO_MYSQL. This is how to set it up from a clean install of 10.8.
</blockquote>
<p>
He's broken it up into a few sections including the MySQL setup, Apache configuration 
, updating the main php.ini and setting up PHPUnit ("and friends") for your testing. He also includes setup instructions for the mcrypt and the PECL <a href="http://php.net/manual/en/book.oauth.php">OAuth</a> extensions.
</p>]]></description>
      <pubDate>Thu, 30 Aug 2012 09:09:12 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Jeune Asuncion: ZF1.11 + Doctrine 2 + Symfony DI Integration]]></title>
      <guid>http://www.phpdeveloper.org/news/18391</guid>
      <link>http://www.phpdeveloper.org/news/18391</link>
      <description><![CDATA[<p>
In <a href="http://jeunito.me/zf1-11-doctrine-2-symfony-di-integration/">this new post</a> to his site <i>Jeune Asuncion</i> shows how he integrated several technologies to make for a robust system - Zend Framework (1.11), Doctrine 2 and the Symfony dependency injection system.
</p>
<blockquote>
Last week, <a href="http://jeunito.me/choosing-a-new-framework/">I blogged about looking for a new application framework</a> to use and more importantly the key things that I would want in one. After reading about the <a href="http://framework.zend.com/">Zend framework</a>, <a href="http://jeunito.me/zf1-11-doctrine-2-symfony-di-integration/www.symfony-project.org/">Symfony</a> and <a href="http://jeunito.me/zf1-11-doctrine-2-symfony-di-integration/laravel.com/">Laravel</a> and finding myself hesitant to use any one, I thought to myself why not get the best of each framework? So that's what I did.
</blockquote>
<p>
He shows a bit of the code to get them to all play nicely together using the Zend autoloader to register the other namespaces and creating a Symfony DI container inside of the ZF Bootstrap and providing it as a resource. You can find more of the source involved in the integration <a href="https://github.com/jeunito/zf-doctrine2-symfonydi">on his github account</a>.
</p>]]></description>
      <pubDate>Wed, 22 Aug 2012 11:09:21 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Till Klampaeckel: Continuous Integration: Automated database setup with Doctrine on Travis-CI]]></title>
      <guid>http://www.phpdeveloper.org/news/18357</guid>
      <link>http://www.phpdeveloper.org/news/18357</link>
      <description><![CDATA[<p>
<i>Till Klampaeckel</i> has a new post to his site showing how you can use the external continuous integration system <a href="http://travis-ci.org/">Travis-CI</a> to handle <a href="http://till.klampaeckel.de/blog/archives/192-Continuous-Integration-Automated-database-setup-with-Doctrine-on-Travis-CI.html">automated database testing</a> for your PHP app using Doctrine.
</p>
<blockquote>
Testing is important - most people understand that by now. A lot of people write tests for their open source code already, but in-house testing is still hard. [...] While I prefer to run my database tests against a SQLite in memory database, there are these edge cases, where I work with multiple database or I write a direct query (and by-pass the ORM-magic). In these cases I need to have that database server available in my test environment! The following blog posts explains how to solve these things with Travis-CI. I will walk you through the setup on Travis-CI's business service. But most of this applies to their open source offering as well.
</blockquote>
<p>
He's broken it up into a few different steps - the setup and configuration of the ".travis.yml" file, adding in a "composer.json" file with the needed dependencies and the recommendation of a "phpunit.xml" in your project's root. He shows how to use Doctrine's "SchemaTool" utility to generate his schema off of the comments on his entities (instead of checking in SQL). This setup them gives him access to Doctrine's EntityManager object in his tests and he can go from there. If you're thinking about doing something similar, check Travis' <a href="http://about.travis-ci.org/docs/user/database-setup/">list of supported databases</a> before you do anything, just to be sure.
</p>]]></description>
      <pubDate>Tue, 14 Aug 2012 10:55:57 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Lorna Mitchell: Installing PEAR Packages Offline]]></title>
      <guid>http://www.phpdeveloper.org/news/18290</guid>
      <link>http://www.phpdeveloper.org/news/18290</link>
      <description><![CDATA[<p>
Since you can't always be online when you need to install new libraries you'll need for your PHP work, <i>Lorna Mitchell</i> has <a href="http://www.lornajane.net/posts/2012/installing-pear-packages-offline">posted a quick guide</a> to downloading and installing PEAR packages when you're offline.
</p>
<blockquote>
As with most tools that work really well, I know very little about PEAR. I mean, I use it all the time, and I love it for getting all the extensions installed that I need for the work I do. [...] However I'm now in a situation where I might need to install PEAR packages with a connection that may or may not be working, and I'm not sure exactly which packages I might need, so I wanted to know whether I could use PEAR as my packaging tool even when I wasn't able to reach the usual channels. And guess what? I can!
</blockquote>
<p>
The install is a pretty simple two-step process - just download the package(s) you'll need for your development and point the PEAR installer (you'll need this installed first, obviously) at the archive file. It's smart enough to take care of the rest.
</p>]]></description>
      <pubDate>Mon, 30 Jul 2012 12:09:41 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Matthew Weier O'Phinney's Blog: On Visibility in OOP]]></title>
      <guid>http://www.phpdeveloper.org/news/18156</guid>
      <link>http://www.phpdeveloper.org/news/18156</link>
      <description><![CDATA[<p>
<i>Matthew Weier O'Phinney</i> has a new post to his blog today looking at <a href="http://mwop.net/blog/2012-06-28-oop-visibility.html">visibility in OOP in PHP</a> - less about the features the language offers and more about the theory of their use.
</p>
<blockquote>
I'm a big proponent of object oriented programming. OOP done right helps ease code maintenance and enables code re-use. Starting in PHP, OOP enthusiasts got a whole bunch of new tools, and new tools keep coming into the language for us with each minor release. One feature that has had a huge impact on frameworks and libraries has been available since the earliest PHP 5 versions: visibility.
</blockquote>
<p>
He covers a bit of the syntax and features of public, private and protected and mentions a keyword not often seen in PHP applications - <a href="http://us2.php.net/manual/en/language.oop5.final.php">final</a>. The reason all of this came up was work on annotation support in Zend Framework 2 and some difficulty in integrating it with Doctrine support. The "final" status of the class was part of the problem, and after a a lot of copy & pasting he decided on a different tactic - using its public API to try to work around the problem.
</p>
<blockquote>
In sum: because the class in question was marked final and had private members, I found myself forced to think critically about what I wanted to accomplish, and then thoroughly understand the public API to see how I might accomplish that task without the ability to extend.
</blockquote>]]></description>
      <pubDate>Fri, 29 Jun 2012 09:52:03 -0500</pubDate>
    </item>
  </channel>
</rss>
