<?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 10:10:59 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Stuart Herbert's Blog: Getting PEAR Working On Windows 7]]></title>
      <guid>http://www.phpdeveloper.org/news/17940</guid>
      <link>http://www.phpdeveloper.org/news/17940</link>
      <description><![CDATA[<p>
<i>Stuart Herbert</i> has a new post today showing how to get the well-established <a href="http://pear.php.net">PEAR</a> package management system <a href="http://blog.stuartherbert.com/php/2012/05/10/getting-pear-working-on-windows-7/">working on Windows 7</a> so you can easily call "pear install" on whatever your needs might be.
</p>
<blockquote>
So that I don't forget how to do this next time around. Worked for me, your mileage may vary. First step is to get a working install of PHP. [...] At this point, you should be able to open up a Command Prompt, and type 'php -v', and see the response 'PHP v5.4.latest …' appear as expected. Now for PEAR itself.
</blockquote>
<p>
He gives step-by-step instructions on how to get PEAR up and running - downloading and configuring it with the correct Windows-based paths and using the PEAR_ENV.reg file to update your registry.
</p>]]></description>
      <pubDate>Thu, 10 May 2012 10:43:49 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Court Ewing's Blog: A Simple Alternative to Global Registry Dependency]]></title>
      <guid>http://www.phpdeveloper.org/news/15559</guid>
      <link>http://www.phpdeveloper.org/news/15559</link>
      <description><![CDATA[<p>
<i>Court Ewing</i> has <a href="http://epixa.com/2010/12/a-simple-alternative-to-global-registry-dependency">written up a post</a> looking at an alternative to a commonly used bad design pattern - the global registry dependency - a method that uses a singleton to control access to a class-wide instance of an object.
</p>
<blockquote>
This gives you flexibility when configuring and setting your adapter, and it allows you to instantiate a new service without having to explicitly set commonly used dependencies, but you are ultimately just replacing one hardcoded object call with another. This means you are still limited in your ability to unit test the class properly, and you will have a difficult time debugging if you ever need to find out exactly when and where your database adapter was configured.
</blockquote>
<p>
In his simple solution uses static methods to assign the database adapter when the bootstrap process is started instead of when the object is created. This adapter is assigned to an abstract class, so it's created even outside the class instantiations. There's one caveat to doing things this way, though - depending on the needs, you might have to have more than one abstract class and things could get tricky.
</p>]]></description>
      <pubDate>Thu, 09 Dec 2010 15:19:22 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Brandon Savage's Blog: The Registry Pattern Reexamined]]></title>
      <guid>http://www.phpdeveloper.org/news/14256</guid>
      <link>http://www.phpdeveloper.org/news/14256</link>
      <description><![CDATA[<p>
<i>Brandon Savage</i> <a href="http://www.brandonsavage.net/the-registry-pattern-reexamined/">takes another look</a> at a popular design pattern - the registry pattern - and how he's changed his thinking on its use a bit on how (or if) it should be used in your applications.
</p>
<blockquote>
Last July, I wrote about the <a href="http://www.brandonsavage.net/use-registry-to-remember-objects-so-you-dont-have-to/">registry pattern</a> and some of its advantages. These advantages include the ability to access objects across different areas of your application, and the storage of objects for later retrieval. [...] For me, over the last few months, I've discovered two reasons why I advise against the <a href="http://www.phppatterns.com/docs/design/the_registry">Registry Pattern</a>: first and foremost, it discourages unit testing, and secondly, it discourages good design.
</blockquote>
<p>
He goes on to elaborate on why these to things could be so detrimental to your code including the problems it can cause in tests being a point of failure and that it can make you application sloppy by giving you an unpoliced "bucket" to drop things in without any context to where they fit in the site.
</p>
<p>
So what's his suggestion to replace this bit of functionality and make things both easy to test and simpler to keep structured? <a href="http://en.wikipedia.org/wiki/Dependency_injection">Dependency injection</a>.
</p>]]></description>
      <pubDate>Fri, 26 Mar 2010 12:57:04 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Developer.com: Build your own MVC Framework: Making Headway]]></title>
      <guid>http://www.phpdeveloper.org/news/13134</guid>
      <link>http://www.phpdeveloper.org/news/13134</link>
      <description><![CDATA[<p>
Continuing on from the <a href="http://www.developer.com/lang/php/article.php/10941_3829776">first part</a> of the series, <i>Marc Plotz</i> forges ahead in his development of a PHP MVC (Model/View/Controller) framework. This new article gives a more complete overview of how the entire framework is structured.
</p>
<blockquote>
Unlike the previous part, I am not simply giving you the part of the framework that we discuss, but a much more complete version. You will need a MySQL database to run it on, and you will have to setup the connection in application/db.ini.php. My example should guide you. You should not have to do much else than create the database and connect to it.
</blockquote>
<p>
You can <a href="http://www.developer.com/img/2009/08/framework.zip">grab the source here</a> and follow along with the tutorial as it steps through bootstrapping and a registry that replaces a "super global" handling method that could cause trouble.
</p>]]></description>
      <pubDate>Mon, 31 Aug 2009 09:09:06 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Brandon Savage's Blog: Use Registry To Remember Objects (So You Don't Have To)]]></title>
      <guid>http://www.phpdeveloper.org/news/12918</guid>
      <link>http://www.phpdeveloper.org/news/12918</link>
      <description><![CDATA[<p>
<i>Brandon Savage</i> has <a href="http://www.brandonsavage.net/use-registry-to-remember-objects-so-you-dont-have-to/">posted a quick look</a> at using one of the more popular design patterns - Registry - to handle object storage and retrieval.
</p>
<blockquote>
One of the biggest challenges in OOP programming with PHP is the ability to pass around objects and let other objects use them. This challenge can be solved with careful design, however. Here we will discuss the <a href="http://martinfowler.com/eaaCatalog/registry.html">registry pattern</a>, not a member of the <a href="http://en.wikipedia.org/wiki/Design_Patterns_%28book%29">GoF's original patterns</a> but still an important pattern nonetheless.
</blockquote>
<p>
He looks at a few different ways to solve a few different problems - first, sharing a database resource between multiple objects, then making sure that you have a connection no matter where its called from and finally - what the registry is used for - sharing multiple database connections between multiple objects. He uses static methods in an abstract class to handle the set/get of the correct object.
</p>
<p>
There's also a <a href="http://www.brandonsavage.net/use-registry-to-remember-objects-so-you-dont-have-to/">bit of discussion</a> about the registry pattern versus dependency injection and which is better for most instances.
</p>]]></description>
      <pubDate>Wed, 22 Jul 2009 07:52:35 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Justin's Blog:  5 cool things you can do with windows and php]]></title>
      <guid>http://www.phpdeveloper.org/news/12251</guid>
      <link>http://www.phpdeveloper.org/news/12251</link>
      <description><![CDATA[<p>
<i>Justin</i> has <a href="http://www.rawseo.com/news/2009/03/31/5-cool-things-you-can-do-with-windows-and-php/">posted a few cool things</a> that you can do by combining PHP with someof the Windows functionality PHP has access to (either via direct function calls or through the COM object).
</p>
<blockquote>
Many PHP examples out there are designed for a linux/unix operating system. I am going to give some examples of some interesting functionality that only works with php running in a windows environment (IIS or apache).
</blockquote>
<p>
Hist list includes little things like ejecting the CD-ROM and sending things to the printer out to working with the registry and listing the current system processes.
</p>]]></description>
      <pubDate>Wed, 01 Apr 2009 07:57:01 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPFreaks.com: Design Patterns - Strategy/Bridge, Value Object, Singleton (Registry)]]></title>
      <guid>http://www.phpdeveloper.org/news/11183</guid>
      <link>http://www.phpdeveloper.org/news/11183</link>
      <description><![CDATA[<p>
Following up on their <a href="http://www.phpdeveloper.org/news/11174">introduction to design patterns</a>, the PHP Freaks have posted tutorials covering three of the more popular patterns - strategy/bridge, value object and singleton.
</p>
<ul>
<li><a href="http://www.phpfreaks.com/tutorial/design-patterns---strategy-and-bridge">Strategy and Bridge</a> - The Strategy and Bridge patterns provide solutions to apply polymorphism in more flexible way than you can accomplish with only inheritance.
<li><a href="http://www.phpfreaks.com/tutorial/design-patterns---value-object">Value Object</a> - The Value Object pattern has, just like the Singleton, to do with referencing and instances. In a way, the Value Object is the opposite of the Singleton: it's goal is to ensure NOT to use the same instance, under certain conditions.
<li><a href="http://www.phpfreaks.com/tutorial/design-patterns---singleton-and-singleton-registry">Singleton and Singleton Registry</a> - The Singleton pattern ensures that you are always dealing with the same, single instance, wherever in your application. The Registry pattern usually utilizes the Singleton pattern (hence "Singleton Registry") to make the same 'globalness' apply to objects who's classes weren't necessarily designed to
</ul>
<p>
Keep checking back to <a href="http://www.phpfreaks.com/tutorials">their tutorials section</a> for more design pattern tutorials.
</p>]]></description>
      <pubDate>Fri, 10 Oct 2008 09:33:10 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Solar Blog: Using registry_set to auto-register objects]]></title>
      <guid>http://www.phpdeveloper.org/news/11065</guid>
      <link>http://www.phpdeveloper.org/news/11065</link>
      <description><![CDATA[<p>
In <a href="http://solarphp.com/blog/read/8-using-registry-set-to-auto-register-objects">this recent post</a> from the Solar blog, <i>anttih</i> shows how to use the Solar registry to automatically load and register objects when it starts up.
</p>
<blockquote>
<a href="http://solarphp.com/class/Solar_Registry">Solar_Registry</a> is a class for storing singleton objects which are used usually for things like SQL objects and the response and request objects. Now what's interesting, is that in the new version of Solar a new configuration key registry_set was added for the <a href="http://solarphp.com/class/Solar">Solar</a> arch-class. You can use it to tell Solar to automatically add objects to the registry when it starts up.
</blockquote>
<p>
He compares the two methods - manual loading and the automatic version and includes a "real world" example of loading up an SMTP object.
</p>]]></description>
      <pubDate>Tue, 23 Sep 2008 08:47:36 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Debuggable Blog: Testing Models in CakePHP - Now let's get rid of the unnecessary ModelTest classes!]]></title>
      <guid>http://www.phpdeveloper.org/news/10722</guid>
      <link>http://www.phpdeveloper.org/news/10722</link>
      <description><![CDATA[<p>
On the Debuggable blog today <i>Tim Koschutzki</i> <a href="http://www.debuggable.com/posts/testing-models-in-cakephp---now-let%27s-get-rid-of-the-unnecessary-modeltest-classes-!:4890ed55-be28-4d4a-ba4c-7fd64834cda3">looks at</a> another testing topics for the CakePHP framework - a cleaner way for testing models.
</p>
<blockquote>
Up until now there was always a need to create a so-called test model that extends your model-under-test in order to overwrite its $useDbConfig setting to be 'test_suite'. By that you ensured that your models run with the test_suite datasource when the tests are run. [...] Nate proposed ClassRegistry::config(), which allows you to tell the ClassRegistry class which datasource it shall use when
ClassRegistry::init() is used the next time (and thereby a model is instantiated).
</blockquote>
<p>
He includes an example of the new functionality - a test case ensuring that three articles are there and are marked as published. The registry makes it easier to automatically create the ArticleTest instance inside the test case rather than having to manually declare and define it.
</p>]]></description>
      <pubDate>Thu, 31 Jul 2008 07:51:38 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Larry Garfield's Blog: Drupal 7 gets introspective code registry]]></title>
      <guid>http://www.phpdeveloper.org/news/10143</guid>
      <link>http://www.phpdeveloper.org/news/10143</link>
      <description><![CDATA[<p>
<i>Larry Garfield</i> talks about a new feature of Drupal 7 in <a href="http://www.garfieldtech.com/drupal-7-registry">a new post</a> to his blog - the new introspective code registry that's been introduced in this latest version.
</p>
<blockquote>
As a GHOP Task , Cornil did a performance analysis of Drupal and found its two largest performance drains were the bootstrap process and the theming layer. Quite simply, Drupal spends too much time including code. [...] Fortunately, Drupal 7's self-learning <a href="http://drupal.org/node/221964">code registry system</a> has <a href="http://drupal.org/cvs?commit=114916">just</a> <a href="http://drupal.org/cvs?commit=114932">landed</a>, which should obliterate most of the wasted bootstrap cost.
</blockquote>
<p>
<i>Larry</i> <a href="http://www.garfieldtech.com/drupal-7-registry">describes</a> the "heart of it all", the token_get_all call, that parses through an entire PHP file, splitting out things like classes included and functions called. This is passed through a function_exists call to the current script and, if it's already there, the file isn't included repetitively.
</p>]]></description>
      <pubDate>Thu, 08 May 2008 12:53:14 -0500</pubDate>
    </item>
  </channel>
</rss>

