<?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>Fri, 08 Aug 2008 15:52:17 -0500</pubDate>
    <ttl>30</ttl>
    <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>
    <item>
      <title><![CDATA[Adam Harvey's Blog: $pear->list]]></title>
      <guid>http://www.phpdeveloper.org/news/8833</guid>
      <link>http://www.phpdeveloper.org/news/8833</link>
      <description><![CDATA[<p>
<i>Adam Harvey</i> has a <a href="http://xn--9bi.net/2007/10/13/pear-list/">(very) quick post</a> with a hint for PEAR users out there - how to get a list of installaed packages on the system you're using.
</p>
<blockquote>
I've seen three people ask a variation of how can I get a list of installed PEAR packages from within my PHP script in the last few weeks on IRC, and two just in the last day. Because I'm a helpful sort, here's a little morsel of code that will do just that.
</blockquote>
<p>
<a href="http://xn--9bi.net/2007/10/13/pear-list/">The code</a> loads the PEAR Registry package and loops, via a foreach, through the results from a listPackages() call. It should work with just about any PEAR version.
</p>]]></description>
      <pubDate>Sat, 13 Oct 2007 14:26:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Fernando Bassani's Blog: Avoiding the usage of global variables]]></title>
      <guid>http://www.phpdeveloper.org/news/8353</guid>
      <link>http://www.phpdeveloper.org/news/8353</link>
      <description><![CDATA[<p>
<i>Fernando Bassani</i> has <a href="http://fernandobassani.com/php/design-patterns/avoiding-the-usage-of-global-variables/">posted an alternative</a> to using globals in your scripts - creating "global objects" with the help of the Registry design pattern.
</p>
<blockquote>
For a long time, the "programming good practices" tell us to avoid globals. In fact, this is a point of a large criticism in languages such as PHP. A nice solution to our global's "needs" is the Registry <a href="http://en.wikipedia.org/wiki/Design_patterns">design pattern</a>. With it, we can have a repository with the data that has to be accessible, removing them from the global scope.
</blockquote>
<p>
Included in <a href="http://fernandobassani.com/php/design-patterns/avoiding-the-usage-of-global-variables/">the post</a> is all the code you'll need to get it to work. It uses a Singleton to grab the latest object and allows you to store values and define namespaces to keep data separate.
</p>]]></description>
      <pubDate>Mon, 30 Jul 2007 15:04:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[JSLabs Blog:  5 cool things you can do with Windows and PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/7973</guid>
      <link>http://www.phpdeveloper.org/news/7973</link>
      <description><![CDATA[<p>
On the JSLabs website, <i>Justin Silverton</i> has posted <a href="http://www.whenpenguinsattack.com/2007/06/04/5-cool-things-you-can-do-with-windows-and-php/">five cool things</a> that you can do with PHP in a Windows environment:
</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>
Here's the list:
</p>
<ul>
<li>Eject the CD-ROM
<li>Read and write from/to the registry
<li>Register and un-register phpscripts as a windows service
<li>Print pages/data
<li>List the current system processes
</ul>
<p>
Each item has sample code and a simple explanation to get you started using it.
</p>]]></description>
      <pubDate>Tue, 05 Jun 2007 09:22:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Zend Developer Zone: Zend Framework Hidden Gems: Zend Plumbing]]></title>
      <guid>http://www.phpdeveloper.org/news/6806</guid>
      <link>http://www.phpdeveloper.org/news/6806</link>
      <description><![CDATA[<p>
<i>Aaron Wormus</i> is back today on the Zend Developer Zone with another in his "Hidden Gems" series. This time, he <a href="http://devzone.zend.com/node/view/id/1294">takes a look</a> at the "Zend Plumbing", those bits of connective code that help you make your Zend Framework applications work.
</p>
<p>
The functionality that he covers in this article are some of the min parts that a lot of ZF coders use every day and might not know it:
<ul>
<li>the Zend class (providing a suite of helper methods)
<li>built in Wrapper functions:
<ul>
<li>loadFile
<li>loadClass
<li>loadInterface
<li>isReadable
<li>dump
<li>exception
</ul>
<li>the Zend registry
</ul>
Each of these is briefly described with some sample code for the loadFile, loadClass, exceptions and the Registry to give you an idea of how to use it all. As always, you can check out <a href="http://framework.zend.com/">the Zend Framework website</a> for all the details on each of these functionality bits.

</p>]]></description>
      <pubDate>Fri, 01 Dec 2006 09:04:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPit.net: Using globals in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/5705</guid>
      <link>http://www.phpdeveloper.org/news/5705</link>
      <description><![CDATA[<p>
In <a href="http://www.phpit.net/article/using-globals-php/">this new tutorial</a> from PHPit.net today, <i>Dennis Pallett</i> talks about using globals in PHP, desscribing what they are and how to use them.
</p>
<blockquote>
Whenever you're developing a new large-scale PHP script, you're bound to use global variables, since some data needs to be used by multiple parts of your script. Good examples of global data are script settings, database connections, user credentials and more. There are many ways of making this data global, but the most commonly used way is to use the global keyword, which we will explore later on in this article.
</blockquote>
<p>
It's good that he mentions <a href="http://www.phpit.net/article/using-globals-php/">right from the start</a> that most global data is a bad idea, and can really start to clutter up an application. He does help the reader prevent this, though, through the use of a few handy techniques (and design patterns).
</p>
<p>
He looks first at the "global" keyword and its use, followed by three reasons that it's not all that favorable to use. He gives other options for the "just make it global" thinking, including passing the values in function calls, passing by reference, and using the Singleton and Registry patterns to contain things a bit more. He even includes a wrapper for the registry to handle the only other globals left - the superglobals - with the same registry functionality.
</p>]]></description>
      <pubDate>Tue, 27 Jun 2006 14:53:34 -0500</pubDate>
    </item>
  </channel>
</rss>
