<?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>Sun, 19 May 2013 06:26:54 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[MaltBlue.com: Zend Framework 2 Core Concepts - Dependency Injection]]></title>
      <guid>http://www.phpdeveloper.org/news/18902</guid>
      <link>http://www.phpdeveloper.org/news/18902</link>
      <description><![CDATA[<p>
In <a href="http://www.maltblue.com/articles-2/zend-framework-2-core-concepts-understanding-dependency-injection">this new post</a> <i>Matthew Setter</i> has posted about one of the core concepts behind the structure and use of Zend Framework 2, its use of dependency injection to handy object relationships and access (via Zend/Di).
</p>
<blockquote>
As Zend Framework 2 is well and truly here, before some of us who are new to it dive right on in, whether you're completely new or, like me, migrating from Zend Framework 1, it's really important to ensure that we understand the core concepts on which it's based. [...] In this, the first part in the series, I'm going to go through what dependency injection (DI) is. However, as there are a number of great posts already available on the topic by some very experienced developers, [...] I'm not going to rehash them.
</blockquote>
<p>
Instead he extracts out useful tips from posts of a few other sources on ZF2 and dependency injection in general: <a href="http://mwop.net/blog/260-Dependency-Injection-An-analogy.html">Matthew Weier O'Phinny</a>, the <a href="http://framework.zend.com/manual/2.0/en/modules/zend.di.introduction.html">ZF2 manual</a>, <i>Martin Fowler</i> on <a href="http://martinfowler.com/articles/injection.html"> dependency injection</a>, <a href="http://en.wikipedia.org/wiki/Dependency_injection">Wikipedia</a> and more. He also includes lots of links to more great articles on the subject, both ZF2-specific and for DI iin general.
</p>]]></description>
      <pubDate>Mon, 17 Dec 2012 10:09:53 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Evan Coury's Blog: Sharing a database connection across modules in Zend Framework 2]]></title>
      <guid>http://www.phpdeveloper.org/news/17876</guid>
      <link>http://www.phpdeveloper.org/news/17876</link>
      <description><![CDATA[<p>
<i>Evan Coury</i> has a new post to his site about a handy method for <a href="http://blog.evan.pro/sharing-a-database-connection-across-modules-in-zend-framework-2">sharing database connections across modules</a> in a Zend Framework application.
</p>
<blockquote>
With the new modular infrastructure in Zend Framework 2, one of the most common questions will indoubitably be how to share a database connection across modules. Here's a quick explanation of how to share your database connection across multiple modules in a way that can even allow you to use a single connection between ZendDb, Doctrine2, and possibly even other database libraries / ORMs.
</blockquote>
<p>
He includes the code in the post to configure this application-wide database resource, a "masterdb_pdo" that uses a MySQL backend. This configuration is used to set up the connection in a dependency injection container for later (globalish) use. He also mentions something similar about sharing Doctrine connections with the ZendDb components (using the same DI container approach).
</p>]]></description>
      <pubDate>Fri, 27 Apr 2012 09:54:56 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Rob Allen's Blog: An introduction to ZendDi]]></title>
      <guid>http://www.phpdeveloper.org/news/17603</guid>
      <link>http://www.phpdeveloper.org/news/17603</link>
      <description><![CDATA[<p>
<i>Rob Allen</i>, Zend Framework guru extraordinaire, has <a href="http://akrabat.com/zend-framework-2/an-introduction-to-zenddi/">posted an introduction</a> to the Dependency Injection container that's a part of Zend Framework 2 - ZendDi.
</p>
<blockquote>
Zend Framework 2 provides its own dependency injection container, ZendDi which is a key underpinning of the entire framework and especially the MVC system. I have <a href="http://akrabat.com/zend-framework-2/what-problem-does-dependency-injection-solve/">covered before</a>, my thoughts on the reasons for using dependency injection, so this article looks at the fundamentals of using ZendDi.
</blockquote>
<p>
He includes some sample code showing a current setup involving constructor injection and how it can be refactored to use the new DI container. With the new version, the resource is assigned to the container and that is referenced when a new object type needs to be created. He also briefly touches on setter injections, noting that he prefers them more for optional dependencies and shows how to enable their use in the container as well.
</p>]]></description>
      <pubDate>Wed, 29 Feb 2012 09:16:20 -0600</pubDate>
    </item>
  </channel>
</rss>
