<?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 20:14:16 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[GotoTech.com: Developer Diary: Taming Doctrine's 2000 Flushes]]></title>
      <guid>http://www.phpdeveloper.org/news/17897</guid>
      <link>http://www.phpdeveloper.org/news/17897</link>
      <description><![CDATA[<p>
In <a href="http://gototech.com/?p=221">this new post</a> to the GotoTech.com blog <i>Eric Burns</i> talks about a way he's "tamed Doctrine's 2000 flushes" with a wrapper around the EntityManager to make controlling the database flushes simpler.
</p>
<blockquote>
For my project I decided to use the Doctrine 2 ORM to manage my data layer. We also use this at work, so the biggest reason I chose this was to be able to learn more about Doctrine to help me in my job. But this decision also makes sense for my project because my entity relationships will likely be fairly straightforward for the most part and using an ORM will allow me to make a lot of progress very quickly without (I hope) causing me lots of trouble later on.
</blockquote>
<p>
His handy wrapper (Data Manager) makes it simpler to perform the flush and still take transactions into consideration. His simple class includes "flush", "commit" and "startTransaction" methods that don't actually perform the flush until the commit is called.
</p>]]></description>
      <pubDate>Wed, 02 May 2012 10:19:35 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Liip Blog: Table Inheritance with Doctrine]]></title>
      <guid>http://www.phpdeveloper.org/news/17742</guid>
      <link>http://www.phpdeveloper.org/news/17742</link>
      <description><![CDATA[<p>
On the Liip blog there's a recent post looking at <a href="http://blog.liip.ch/archive/2012/03/27/table-inheritance-with-doctrine.html">table inheritance with Doctrine</a>, the popular <a href="http://www.doctrine-project.org/">PHP ORM tool</a>. In the post, <i>Daniel Barsotti</i> talks about a database model that needed some updating due to their searching needs.
</p>
<blockquote>
Our first idea, and it was not that bad, Drupal does just the same, was to have a database table with the common fields, a field containing the type of item (it's either an event or a blog post) and a data field where we serialized the corresponding PHP object. This approach was ok until we had to filter or search LabLog items based on fields that were contained in the serialized data.
</blockquote>
<p>
To resolve the issue they turned to multiple table inheritance, relating the LabLogItem to both a BlogPost and Event. They also show how it could be modeled with a single table, but opt for the multiple method. Included in the post is the Doctrine-based code showing how to create the parent entity for the LabLogItem and the two child entities for the blog post and event. There's also a brief snippet showing how to use them with the EntityManager. 
</p>]]></description>
      <pubDate>Wed, 28 Mar 2012 09:30:09 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DZone.com: PHP objects in MongoDB with Doctrine]]></title>
      <guid>http://www.phpdeveloper.org/news/17705</guid>
      <link>http://www.phpdeveloper.org/news/17705</link>
      <description><![CDATA[<p>
On DZone.com today <i>Giorgio Sironi</i> has a new post showing how you can <a href="http://css.dzone.com/articles/php-objects-mongodb-doctrine">use Doctrine with MongoDB</a> to work with Document objects from the database.
</p>
<blockquote>
In the PHP world, probably the Doctrine ODM for MongoDB is the most successful. This followes to the opularity of Mongo, which is a transitional product between SQL and NoSQL, still based on some relational concepts like queries. [...] The case for an ODM over a plain Mongo connection object is easy to make: you will still be able to use objects with proper encapsulation (like private fields and associations) and behavior (many methods) instead of extracting just a JSON package from your database.
</blockquote>
<p>
He briefly mentions that the PECL extension for Mongo needs to be installed prior to trying out any of the examples. His first example shows how to create a DocumentManager (similar to the normal EntityManager for those familiar with Doctrine). He also shows an integration with the ORM and shares some of the findings he's made when it comes to versioning the resources (hint: annotations are your friend).
</p>
]]></description>
      <pubDate>Wed, 21 Mar 2012 10:03:59 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Jeremy Cook's Blog: Making PHPUnit, Doctrine & MySQL Play Nicely]]></title>
      <guid>http://www.phpdeveloper.org/news/17620</guid>
      <link>http://www.phpdeveloper.org/news/17620</link>
      <description><![CDATA[<p>
<i>Jeremy Cook</i> has put together a new post showing how he got <a href="http://jeremycook.ca/2012/02/27/making-phpunit-doctrine-mysql-play-nicely/">PUPUnit, Doctrine and MySQL to "play nicely" together</a> when he was writing up some of his tests in a current application.
</p>
<blockquote>
One of the pain points for me though has been in getting Doctrine setup with PHPUnit for testing. One of the main Doctrine contributors, Benjamin Beberlei, has written a package called <a href="https://github.com/beberlei/DoctrineExtensions">DoctrineExtensions</a> which amongst other things adds a class called DoctrineExtensionsPHPUnitOrmTestCase which extends PHPUnit's DbUnit database test case class. This all works well in principle but hits a major snag in reality: MySQL doesn't allow InnoDb tables with foreign keys to be truncated. PHUnit's database extension truncates the database tables before each test run and inserts a fresh set of data to work with.
</blockquote>
<p>
To work around this issue <i>Jeremy</i> by porting over <a href="https://gist.github.com/1319731">a method</a> posted by <i>Mike Lively</i> over to Doctrine as a custom "MySQLTruncate" class (code included in the post). He also includes some sample code showing it in use - a basic ORM test case that calls the truncate method when its set up. 
</p>]]></description>
      <pubDate>Fri, 02 Mar 2012 12:05:48 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Marcelo Gornstein's Blog: Writing PHP applications with Doctrine2 as ORM and Ding as DI container]]></title>
      <guid>http://www.phpdeveloper.org/news/17469</guid>
      <link>http://www.phpdeveloper.org/news/17469</link>
      <description><![CDATA[<p>
In a recent post <i>Marcelo Gornstein</i> takes a look at <a href="http://marcelog.github.com/articles/php_applications_with_doctrine2_orm_and_ding_di_container.html">using dependency injection with Doctrine2</a> using his <a href="http://marcelog.github.com/Ding">Ding</a> container.
</p>
<blockquote>
This article will show how we can develop software in php with a nifty design and architecture, and very much like other languages like java, using an ORM and an AOP, DI, Events container. I will assume you've read (or at least took a quick look) at <a href="http://marcelog.github.com/articles/creating_php_cli_standalone_portable_applications_with_pear_dependencies.html">this article</a> that explains the tree layout used throughout the code, and that you have some basic knowledge of <a href="http://www.doctrine-project.org/">Doctrine2</a> and used it before on your own.
</blockquote>
<p>
He starts with the result - an easy to use, self-contained (and decoupled) system for accessing the Doctrine2 instance. It's event-driven and uses <a href="http://en.wikipedia.org/wiki/Aspect-oriented_programming">Aspect-oriented programming</a> to mange interactions between components (or as he calls them "beans"). Code is included for the entire process for a logger, the User entity, entity manager, user repository and transactional aspect. You can find the complete source for his example <a href="https://github.com/marcelog/Doctrine2-Ding-Example">on his github account</a>.
</p>]]></description>
      <pubDate>Tue, 31 Jan 2012 08:59:18 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Ade Slade's Blog: Integrating Zend Framework 1 and Pimple]]></title>
      <guid>http://www.phpdeveloper.org/news/17414</guid>
      <link>http://www.phpdeveloper.org/news/17414</link>
      <description><![CDATA[<p>
In <a href="http://adeslade.co.uk/post/integrating-zend-framework-1-and-pimple">this new post</a> to his blog <i>Ade Slade</i> shows how to integrate the <a href="http://pimple.sensiolabs.org/">Pimple</a> lightweight dependency injection container with a Zend Framework application.
</p>
<blockquote>
This post will describe a way to integrate Zend Framework 1 and <a href="http://pimple.sensiolabs.org/">Pimple</a>. A complete working version of the code is available on <a href="https://github.com/adeslade/Zend-Framework-Pimple">github</a>. Thankfully, Zend Framework 2 features its own Dependency Injection Container. Happy days. Still, if you're not prepared to wait, you may find this useful.
</blockquote>
<p>
He shows how to add a resource plugin into the Pimple container - an entity manager that's part of <a href="http://doctrine-project.org">Doctrine</a>. He creates his controller, pulling the manager from the Pimple container and includes a unit test for the controller too (using PHPUnit, but he also suggests <a href="https://github.com/padraic/mockery">Mockery</a>).
</p>]]></description>
      <pubDate>Wed, 18 Jan 2012 13:11:56 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[NetTuts.com: Zend Framework from Scratch - Models and Integrating Doctrine ORM]]></title>
      <guid>http://www.phpdeveloper.org/news/17390</guid>
      <link>http://www.phpdeveloper.org/news/17390</link>
      <description><![CDATA[<p>
NetTuts.com has posted a second tutorial in their series focusing on the Zend Framework today. In <a href="http://net.tutsplus.com/tutorials/php/zend-framework-from-scratch-models-and-integrating-doctrine-orm/">this latest article</a> they focus on integrating the powerful <a href="http://doctrine-project.org">Doctrine</a> ORM with a Zend Framework application.
</p>
<blockquote>
Ready to take your PHP skills to the next level? In this new "From Scratch" series, we'll focus exclusively on <a href="http://framework.zend.com/">Zend Framework</a>, a full-stack PHP framework created by Zend Technologies. This second tutorial on our series is entitled "Models and Integrating Doctrine ORM".
</blockquote>
<p>
They continue on from their <a href="http://net.tutsplus.com/tutorials/php/zend-framework-from-scratch/">previous tutorial</a> to talk about what models are (with an example involving "bankers"). They also show how to use the Zend Framework "zf" command line tool to configure your database settings, set up the tables and download/bootstrap the Doctrine code. The include the code to create some simple models and how to use them to create and update records in your database. You can grab all of the sample code for their examples from <a href="https://github.com/nikkobautista/The-Next-Social">The Next Social's github repository</a>.
</p>]]></description>
      <pubDate>Fri, 13 Jan 2012 10:58:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPBuilder.com: An Early Look at Zend Framework 2.0]]></title>
      <guid>http://www.phpdeveloper.org/news/17070</guid>
      <link>http://www.phpdeveloper.org/news/17070</link>
      <description><![CDATA[<p>
On PHPBuilder.com <i>Jason Gilmore</i> has posted a <a href="http://www.phpbuilder.com/columns/zendframework2/zend_framework2_10-27-2011.php3">first peek at Zend Framework 2</a>, an upcoming reworking of the popular framework with PHP 5.3-centric features.
</p>
<blockquote>
Version 2.0 seeks to improve upon the current release in a number of ways, focusing on making it easier to get started using the framework, improving performance, and fully embracing the latest PHP language enhancements made available to version 5.3. [...] Although the official release won't be out for several more months, it never hurts to take an early look at what the future holds for a technology used by countless PHP developers around the globe. In this article I'll present a meandering introduction to the key version 2.0 features that I find particularly compelling.
</blockquote>
<p>
He starts with a brief tutorial on getting the latest version of ZF2 from the <a href="https://github.com/zendframework/">git repository</a> and creating  basic project. The changes in the framework have fallen into a "rewrite only where it makes sense" mentality and changes have really only been made transparently to the backend or as new features/components like module management and Doctrine 2 integration. He also points out a few resources you can use to keep up to date on the latest from the framework including <a href="http://git.zendframework.com/?a=summary&p=zf">the changelog</a>, <a href="http://zend-framework-community.634137.n4.nabble.com/ZF-Contributor-f680267.html">mailing list</a> and the <a href="http://framework.zend.com/zf2/blog">ZF2 blog</a>.
</p>]]></description>
      <pubDate>Tue, 01 Nov 2011 11:40:52 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DZone.com: Hardening PHP: SQL injection - Complete walkthrough]]></title>
      <guid>http://www.phpdeveloper.org/news/16711</guid>
      <link>http://www.phpdeveloper.org/news/16711</link>
      <description><![CDATA[<p>
On DZone.com today there's a new post from <i>Krzysztof Kotowicz</i> sharing a presentation of his about <a href="http://php.dzone.com/news/hardening-php-sql-injection">protecting your application from SQL injection</a>.
</p>
<blockquote>
The materials teach how to use prepared statements, how to escape and write secure stored procedures. Many PHP projects are covered - <a href="http://php.net/manual/en/book.pdo.php">PDO</a>, <a href="http://propel.phpdb.org/trac/">Propel</a>, <a href="http://www.doctrine-project.org/">Doctrine</a>, <a href="http://framework.zend.com/">Zend Framework</a> and <a href="http://pear.php.net/MDB2/">MDB2</a>. Multiple gotchas and caveats are included. I discuss why escaping is usually the wrong choice, which practices to avoid or follow and how stored procedures sometimes offer no protection at all.
</blockquote>
<p>
The presentation (as <a href="http://www.slideshare.net/kkotowicz/sql-injection-complete-walktrough-not-only-for-php-developers">posted to Slideshare</a>) starts with some of the basics - what SQL injection is and an example of how it could be used to bypass security. He covers how to use prepared statements in each of the technologies (with code snippets), methods for escaping data and how to create stored procedures that are protected from the same threats.
</p>]]></description>
      <pubDate>Fri, 12 Aug 2011 09:20:13 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Leaseweb Labs Blog: Tuning Zend framework and Doctrine]]></title>
      <guid>http://www.phpdeveloper.org/news/16635</guid>
      <link>http://www.phpdeveloper.org/news/16635</link>
      <description><![CDATA[<p>
On the Leaseweb Labs blog there's a recent post looking and some of the things you can do to <a href="http://www.leaseweblabs.com/2011/07/tuning-zend-framework-and-doctrine/">optimize Zend Framework and Doctrine</a> when used together for database access.
</p>
<blockquote>
In principle, the combination of Zend Framework with Doctrine is not too difficult. But first let's talk about the preparations. According to the author of Zend Framework, the default file structure of project can be a bit more optimal.
</blockquote>
<p>
They start by describing this optimized file structure (moving the models out of the modules and into the library) and what you'll need to change in Doctrine's configuration to make this work. The post also includes examples of what the larger config should look like when the changes are made. They show how to extend the default Doctrine CLI tool to make a custom "sandbox" instance and show some tuning you can do on the Zend Framework side so it can optimally work with the new models.
</p>]]></description>
      <pubDate>Tue, 26 Jul 2011 12:35:03 -0500</pubDate>
    </item>
  </channel>
</rss>

