<?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, 17 May 2012 03:58:51 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[DevArticles.com: Singletons in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17218</guid>
      <link>http://www.phpdeveloper.org/news/17218</link>
      <description><![CDATA[<p>
On DevArticles.com today there's <a href="http://www.devarticles.com/c/a/PHP/Singletons-in-PHP/">a new tutorial</a> posted talking about one of the more popular design patterns, the Singleton, and how it can be implemented in PHP.
</p>
<blockquote>
Though in the past they enjoyed both popularity and a certain amount of prestige, without a doubt Singletons have progressively become one of the most evil and despicable villains in object-oriented design. Singletons earned their bad reputation for a reason: bringing them to life requires the programmer to deal at least with a static method. This is simply an elegant masquerade for creating a global access point (which in most cases is mutable as well) throughout an entire application. And we all know that global, mutable access is unquestionably a bad thing that must be avoided at all costs.
</blockquote>
<p>
In this first part (of two) of the series they introduce the Singleton pattern and show how, via an example of using a database adapter interface to work with a MySQL database, in a tightly coupled example. 
 In the second part of the series, they'll show how to break these apart using dependency injection.
</p>]]></description>
      <pubDate>Tue, 06 Dec 2011 10:17:33 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Alberto Viana's Blog: Zend Framework and Oracle XMLType]]></title>
      <guid>http://www.phpdeveloper.org/news/16886</guid>
      <link>http://www.phpdeveloper.org/news/16886</link>
      <description><![CDATA[<p>
<i>Alberto Viana</i> has a new post to his blog about <a href="http://blog.albertoviana.com/2011/09/19/zend-framework-and-oracle-xmltype/">using Oracle ZML Types with a Zend Framework application</a>. He created a custom adapter to create the type and handle the binding/execution on an new OCI8 connection.
</p>
<blockquote>
So few days ago I needed to insert Oracle XMLtype with Zend Framework. I used oracle adapter to wrote it in Zend Framework. I was looking for and I found on Chris Jones Blog.
</blockquote>
<p>
His table has a column defined as an <a href="http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96620/xdb04cre.htm">XMLType</a>, a special data type specifically for working with XML datasets directly in the database. His adapter includes a bit of sample XML and the code needed to bind the data as a CLOB and, using the <a href="http://us.php.net/manual/en/function.oci-lob-writetemporary.php">writeTemporary</a> function.
</p>]]></description>
      <pubDate>Wed, 21 Sep 2011 09:52:04 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Zend Developer Zone: My Favorite Design Patterns]]></title>
      <guid>http://www.phpdeveloper.org/news/16242</guid>
      <link>http://www.phpdeveloper.org/news/16242</link>
      <description><![CDATA[<p>
On the Zend Developer Zone there's a new article from <i>Keith Casey</i> where he talks about some of his <a href="http://devzone.zend.com/article/14003-My-Favorite-Design-Patterns">favorite design patterns</a> he's come across in his time as a developer - adapter, facade and decorator.
</p>
<blockquote>
Within the <a href="http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29">Design Patterns</a> world, there are four main categories: Architectural, Structural, Creational, and Behavioral. Architectural patterns describe the system as a whole, Structural patterns describe the relationships between objects, Creational handle creating objects, and finally Behavioral describe the communication patterns between objects.  Each of the categories is worth discussion on its own, but in this case we'll stick to the Structural patterns of Adapter, Facade, and Decorator.
</blockquote>
<p>
He describes each of the patterns (no code in this one, just descriptions) and for each mentions some of the tools that the <a href="http://framework.zend.com">Zend Framework</a> has to offer that match up. For example, the Adapter pattern is used in quite a few places in the framework including in the Zend_Db component for the connection types to different databases.
</p>]]></description>
      <pubDate>Mon, 25 Apr 2011 10:38:13 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Daniel Cousineau's Blog: Doctrine 1.2 MSSQL Alternative LIMIT/Paging]]></title>
      <guid>http://www.phpdeveloper.org/news/15148</guid>
      <link>http://www.phpdeveloper.org/news/15148</link>
      <description><![CDATA[<p>
<i>Daniel Cousineau</i> has <a href="http://www.toosweettobesour.com/2010/09/16/doctrine-1-2-mssql-alternative-limitpaging">a new post</a> to his blog today looking at an alternative that can be used for pagination in your MSSQL queries than the trick with TOP and reversing the ORDER BY in <a href="http://www.doctrine-project.org">Doctrine</a>.
</p>
<blockquote>
As ugly as this technique is, it works. The problem is it requires an extreme amount of intelligence or an extreme amount of simplicity in the query in order for an automated system like Doctrine to be usable. The biggest caveat with this technique is good goddamned luck paging your query if it doesn't have an ORDER BY. And sometimes queries that are complex enough break the modified Zend_Db code. There exists an <a href="http://varjabedian.net/archive/2008/04/09/paging-made-easy-in-ms-sql-server-2005.aspx">easier MSSQL paging technique</a>. Using features first available in SQL Server 2005, with only 1 subquery you can mimic MySQL's LIMIT clause with ease.
</blockquote>
<p>
He includes the query that will make it happen (the SQL for it) and then the implementation as an adapter you can use to get it to cooperate in your Doctrine queries. 
</p>]]></description>
      <pubDate>Fri, 17 Sep 2010 11:34:03 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[NETTUTS.com: A Beginner's Guide to Design Patterns ]]></title>
      <guid>http://www.phpdeveloper.org/news/14761</guid>
      <link>http://www.phpdeveloper.org/news/14761</link>
      <description><![CDATA[<p>
On NETTUTS.com today there's <a href="http://net.tutsplus.com/articles/general/a-beginners-guide-to-design-patterns">a new tutorial</a> that introduces a bit more advanced concept in the development process - design patterns.
</p>
<blockquote>
Design patterns are optimized, reusable solutions to the programming problems that we encounter every day. A design pattern is not a class or a library that we can simply plug into our system; it's much more than that. It is a template that has to be implemented in the correct situation. It's not language-specific either. A good design pattern should be implementable in most - if not all - languages, depending on the capabilities of the language. 
</blockquote>
<p>
They introduce a few of the more widely used patterns including the strategy pattern, adapter pattern, factory methods, decorator and singleton patterns. Each comes with a bit of code showing how it would work and a "where would I use this?" section with a better example.
</p>]]></description>
      <pubDate>Thu, 08 Jul 2010 08:47:55 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Richard Thomas' Blog: Solar Framework Shorts - Using Multiple auth adapters]]></title>
      <guid>http://www.phpdeveloper.org/news/14316</guid>
      <link>http://www.phpdeveloper.org/news/14316</link>
      <description><![CDATA[<p>
<i>Richard Thomas</i> has posted another "Solar Short" to his PHPJack blog today dealing with a method for using multiple authentication methods in a single <a href="http://solarphp.com">Solar framework</a> installation.
</p>
<blockquote>
What if you want to use multiple methods? OpenID? Facebook Connect? Saml? or one of the other dozen+ solutions that you might use.. What to do? One thing to keep in mind, Auth happens really early in the bootstrapping process so things like SQL may not be available yet unless you specifically loaded it in the config.. Then you need to load the proper auth module and call it as needed..
</blockquote>
<p>
He includes a code example of how it would work - extending the Solar_Auth_Adapter to create a single "multi-adapter" with a <a href="http://php.net/switch">switch</a> to evaluate and load/use the correct authentication method. It uses the Solar_Config object to set the Auth Adapter when it's loaded so you can even use multiples in the same page load if you need it.
</p>]]></description>
      <pubDate>Wed, 07 Apr 2010 15:56:30 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[ZendCasts.com: Writing a Zend_Auth_Adapter with Doctrine]]></title>
      <guid>http://www.phpdeveloper.org/news/13899</guid>
      <link>http://www.phpdeveloper.org/news/13899</link>
      <description><![CDATA[<p>
New from the ZendCasts.com site today there's <a href="http://www.zendcasts.com/writing-a-zend_auth_adapter-with-doctrine/2010/01/">this new screencast</a> looking at the integration of the Zend_Auth_Adapter component of the Zend Framework and the Doctrine ORM library to split out the authentication from the persistence layer.
</p>
<blockquote>
I've been using Doctrine a lot in my own work, and recently found myself itching to have tighter integration between Zend and Doctrine when it comes to user logins. Luckily, Zend provides a very simple interface with regards to Zend_Auth. This way, it's easy to decouple your persistence layer (in my case Doctrine) from the authentication layer.
</blockquote>
<p>
He also recommends checking out <i>Palo Verede</i>'s <a href="http://palo-verde.us/?blog/2009/08/16/zend_auth-adapter-with-doctrine.html">look at the same topic</a>. You can watch the screencast <a href="http://www.zendcasts.com/writing-a-zend_auth_adapter-with-doctrine/2010/01/">here</a.> and grab the code for it <a href="http://zendcasts.googlecode.com/svn/trunk/zc43-writing-a-zend-auth-adapter-for-doctrine/zc43-writing-a-zend-auth-adapter-for-doctrine.zip">here</a>.
</p>]]></description>
      <pubDate>Mon, 25 Jan 2010 09:54:32 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Richard Thomas' Blog: Solar Framework Shorts - Creating your own OpenID Auth Adapter]]></title>
      <guid>http://www.phpdeveloper.org/news/13705</guid>
      <link>http://www.phpdeveloper.org/news/13705</link>
      <description><![CDATA[<p>
<i>Richard Thomas</i> has posted <a href="http://www.phpjack.com/content/solar-framework-shorts-creating-your-own-openid-auth-adapter">another Solar framework short</a> today. This time it's about OpenID and how you cn easily create a custom adapter that integrates directly into the framework to support it.
</p>
<blockquote>
Solar makes heavy use of Adapter based classes, Solar_Auth is one of these. This makes adding additional methods pretty easy and allows you to borrow from other Frameworks without having to Hack in a third party auth setup, You can use the basics provided by Solar.
</blockquote>
<p>
He includes a code example showing how to extend the Solar_Auth_Adapter component to create an OpenID adapter you can use as a part of your authentication process. His Solar component encourages code reuse too by using the Zend Framework native OpenID implementation as its authetication functionality.
</p>]]></description>
      <pubDate>Mon, 21 Dec 2009 10:09:01 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Federico Cargnelutti's Blog: Database Replication Adapter for Zend Framework Applications]]></title>
      <guid>http://www.phpdeveloper.org/news/13332</guid>
      <link>http://www.phpdeveloper.org/news/13332</link>
      <description><![CDATA[<p>
<i>Federico Cargnelutti</i> has <a href="http://blog.fedecarg.com/2009/10/02/database-replication-adapter-for-zend-framework-applications/">added a new post</a> to his blog today looking at a database replication adapter he's created for the Zend Framework - the <a href="http://fedecarg.com/repositories/show/zfreplicationadapter">ReplicationAdapter</a>.
</p>
<blockquote>
In 2008, Paul M. Jones <a href="http://www.solarphp.com/blog/read/19-adapter-for-master-slave-my-sql-setups">announced</a> the release of an SQL adapter that allows Solar users to connect to master/slave database installations. My first reaction was: Great! This will inspire other FOSS developers to create similar components. And guess what, it did. I wrote my own ReplicationAdapter. It's not great, but it's flexible enough to support the most commonly used replication scenarios:
</blockquote>
<p>
He gives examples of how it can be used for single-master replication, multi-master replication and how the adapter can be used to create a distributed caching system for database connections. A brief Zend Framework-based example is also included.
</p>]]></description>
      <pubDate>Mon, 05 Oct 2009 09:33:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Christian Stocker's Blog: A Twitter Adapter for Zend_Auth]]></title>
      <guid>http://www.phpdeveloper.org/news/12831</guid>
      <link>http://www.phpdeveloper.org/news/12831</link>
      <description><![CDATA[<p>
<i>Christian Stocker</i> has <a href="http://blog.liip.ch/archive/2009/07/06/a-twitter-adapter-for-zend_auth.html">posted an adapter</a> he's created to hook the Zend_Auth component of the Zend Framework into Twitter's authentication system.
</p>
<blockquote>
From time to time I write some little scripts for my own needs or just to test out new stuff. And I realised, that I blog about it way too little. So here I start with my latest addition: Zend_Auth_Adapter_Twitter. [...] I came up with a Zend_Auth Adapter for Twitter. The integration was pretty easy, but the code is very basic and rough. Nevertheless, it does the job and alongside the Openid Adapter I can offer a federated login for many people already.
</blockquote>
<p>
You can grab <a href="https://svn.liip.ch/repos/public/zend/contrib/library/Zend/Auth/Adapter/Twitter.php">the code and an example</a> of it in action from their SVN server (as well as <a href="https://svn.liip.ch/repos/public/zend/contrib/library/Zend/Auth/Result/Twitter.php">this library</a>) or just check out <a href="http://im.chregu.tv/oauth.php">the live demo</a>.
</p>]]></description>
      <pubDate>Wed, 08 Jul 2009 11:02:16 -0500</pubDate>
    </item>
  </channel>
</rss>

