<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Bradley Holt &#187; Best Practices</title>
	<atom:link href="http://bradley-holt.com/tag/best-practices/feed/" rel="self" type="application/rss+xml" />
	<link>http://bradley-holt.com</link>
	<description></description>
	<lastBuildDate>Mon, 23 Aug 2010 13:23:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Phing Build Script</title>
		<link>http://bradley-holt.com/2010/01/phing-build-script/</link>
		<comments>http://bradley-holt.com/2010/01/phing-build-script/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 16:03:00 +0000</pubDate>
		<dc:creator>Bradley Holt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Phing]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software Deployment]]></category>

		<guid isPermaLink="false">http://bradley-holt.com/2010/01/phing-build-script/</guid>
		<description><![CDATA[I&#8217;ve been experimenting with using Phing to automate building and deploying web applications. I want to share one of my build scripts and perhaps get some feedback from anyone with more experience using Phing. The requirements for the build script are fairly simple:

It will not handle deployment. This particular web application is deployed by the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been experimenting with using <a href="http://phing.info/">Phing</a> to automate building and deploying web applications. I want to share one of my build scripts and perhaps get some feedback from anyone with more experience using Phing. The requirements for the build script are fairly simple:</p>
<ul>
<li>It will <em>not</em> handle deployment. This particular web application is deployed by the client&#8217;s IT department.</li>
<li>It <em>will</em>  create a ZIP file (it could just as easily create a tar.gz file) that the client&#8217;s IT department can extract and deploy.</li>
<li>It <em>will</em> rename the document root since the document root is a different directory name in the client&#8217;s production environment then it is in our development and testing environments.</li>
</ul>
<p>Next, an outline of what the build does:</p>
<ol>
<li>Prompt for Subversion credentials (I&#8217;d rather not store these in a file).</li>
<li>Prompt for the Subversion tag to build from.</li>
<li>Delete the source directory if it exists.</li>
<li>Export the given tag to the source directory.</li>
<li>Rename the document root.</li>
<li>Create a ZIP file, named after the version, of the source directory&#8217;s contents.</li>
<li>Clean up after itself by deleting the source directory.</li>
</ol>
<p>Both of the build files are in the project&#8217;s root directory (in my project, this is one directory above the document root). The <a href="http://gist.github.com/273555#file_build.properties">build.properties</a> file defines three properties: document root (so we can rename it to this new name), the source directory (the place to export to and then manipulate folders/files), and the URL to the repository&#8217;s tags directory.</p>
<p><script src="http://gist.github.com/273555.js?file=build.properties"></script>
<p>The <a href="http://gist.github.com/273555#file_build.xml">build.xml</a> file is the actual build script, performing the actions outlined above. I&#8217;ve obfuscated the project name to be &#8220;acme&#8221;. I could not find a way to create a prompt that hides the Subversion password as it is entered (anyone?). For renaming the document root, I used the <code>exec</code> task to execute a move (<code>mv</code>) command since the <code>move</code> task failed for me (so this script will not work as-is on Windows).</p>
<p><script src="http://gist.github.com/273555.js?file=build.xml"></script>
<p>Executing this script is as easy as running <code>phing build-tag</code> (once Phing is installed) from within the project&#8217;s root directory. Please let me know if you have any questions or see any room for improvement.</p>
]]></content:encoded>
			<wfw:commentRss>http://bradley-holt.com/2010/01/phing-build-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Design and Web Development</title>
		<link>http://bradley-holt.com/2010/01/web-design-and-web-development/</link>
		<comments>http://bradley-holt.com/2010/01/web-design-and-web-development/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 21:36:00 +0000</pubDate>
		<dc:creator>Bradley Holt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Mobile Computing]]></category>

		<guid isPermaLink="false">http://bradley-holt.com/2010/01/web-design-and-web-development/</guid>
		<description><![CDATA[Back in October, Jeffrey Zeldman tweeted something that I strongly agree with:
Real web designers write code. Always have, always will. #aea

This sparked many conversations including these two tweets from Chris Shiflett:
According to @zeldman, real web designers write code. (I think he means HTML and CSS, not PHP, Perl, and Python.) What do you think?

I’ve now [...]]]></description>
			<content:encoded><![CDATA[<p>Back in October, Jeffrey Zeldman <a href="http://twitter.com/zeldman/statuses/4818978868">tweeted</a> something that I strongly agree with:</p>
<blockquote><p>Real web designers write code. Always have, always will. <a href="http://twitter.com/search?q=%23aea">#aea</a></p>
</blockquote>
<p>This sparked many conversations including these <a href="http://twitter.com/shiflett/status/4819361797">two</a> <a href="http://twitter.com/shiflett/status/4820055234">tweets</a> from Chris Shiflett:</p>
<blockquote><p>According to @<a href="http://twitter.com/zeldman">zeldman</a>, real web designers write code. (I think he means HTML and CSS, not PHP, Perl, and Python.) What do you think?</p>
</blockquote>
<blockquote><p>I’ve now asked, separately, whether developers and designers should know HTML and CSS. In both cases, most think they should. Interesting.</p>
</blockquote>
<p>To which I <a href="http://twitter.com/BradleyHolt/status/4820141311">responded</a> (brackets added):</p>
<blockquote><p>@<a href="http://twitter.com/shiflett">shiflett</a> IMHO, the demarcation between web developers and web designers should be POSH [<a href="http://microformats.org/wiki/posh">Plain Old Semantic HTML</a>]. That&#8217;s what both need to know.</p>
</blockquote>
<p>I have a pretty strong opinion about this. You could say that I have the luxury of working with an <a href="http://foundline.com/people/jason-pelletier">excellent designer</a> who implements all of his own CSS—even tackling much of the JavaScript coding on websites we build. To be clear: he is a designer, not a developer—working in both print (which is more technical than you might think) and web.</p>
<p>The typical process is summarized well in Marco Tabini&#8217;s <a href="http://phpadvent.org/2009">PHP Advent 2009</a> post on <a href="http://phpadvent.org/2009/css-and-other-people-by-marco-tabini">CSS and Other People</a>:</p>
<blockquote><p>From a developer’s perspective, “design work” means having to deal with the often hated, sometimes impossible, and always challenging task of translating a designer’s <em>comp</em> into a combination of HTML and CSS that will render properly on browsers that are often at complete odds with one another.</p>
</blockquote>
<p>In my opinion, that process is broken. Why is it assumed that because HTML and CSS are &#8220;code&#8221; it should be a developer&#8217;s job to implement these? Any decent designer is already familiar with the concept of separating presentation and content with <a href="http://en.wikipedia.org/wiki/Style_sheet_%28desktop_publishing%29">style sheets</a> (which are supported in Adobe InDesign, QuarkXPress, and even PageMaker and Microsoft Word). Is learning HTML and CSS, both <a href="http://en.wikipedia.org/wiki/Declarative_programming">declarative languages</a>, considered too hard for designers?</p>
<p>Let&#8217;s take a look at comps and the dreaded &#8220;s&#8221; word—slicing. As Marco pointed out, trying to &#8220;slice&#8221; a comp into HTML and CSS is &#8220;sometimes impossible&#8221; and &#8220;always challenging.&#8221; If a designer is only providing a comp, and not the HTML and CSS, it is very likely that the designer does not have a solid understanding of things like <a href="http://en.wikipedia.org/wiki/Progressive_enhancement">progressive enhancement</a>, browser compatibility, and even what is possible on the web.</p>
<p>The use of a comp generally assumes that design is purely visual and that all representations of the web page should look exactly like the comp. How should the content be presented to screen readers, to mobile devices, and in print? Sure, you could provide comps for each of these scenarios but this is not scalable and you quickly risk violating the &#8220;<a href="http://www.w3.org/TR/mobile-bp/#OneWeb">One Web</a>&#8221; concept. Thinking of a web page through the lens of only one specific visual representation of that page is very limiting.</p>
<p>Do you agree that the typical process is broken? If so, what are the barriers to fixing this process? Do we need better trained web designers? Do organizations need to be educated on how to better structure their web teams? This problem will eventually self-correct. My prediction is that teams with web designers that know HTML and CSS will create better websites and web applications and be more successful than teams using the old process.</p>
]]></content:encoded>
			<wfw:commentRss>http://bradley-holt.com/2010/01/web-design-and-web-development/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Open (local) Government</title>
		<link>http://bradley-holt.com/2009/04/open-local-government/</link>
		<comments>http://bradley-holt.com/2009/04/open-local-government/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 01:51:00 +0000</pubDate>
		<dc:creator>Bradley Holt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[BTV]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[FOSS]]></category>
		<category><![CDATA[Open Standards]]></category>

		<guid isPermaLink="false">http://bradley-holt.com/2009/04/open-local-government/</guid>
		<description><![CDATA[Last night I went to the Burlington, Vermont City Council meeting to listen to our newly re-elected mayor, Bob Kiss, give his State of the City speech and watch the City Council attempt to elect a new council president. I said &#8220;attempt&#8221; because, after 14 rounds of voting, they were still deadlocked 7-7 for opposing [...]]]></description>
			<content:encoded><![CDATA[<p>Last night I went to the Burlington, Vermont City Council meeting to listen to our newly re-elected mayor, Bob Kiss, give his State of the City speech and watch the City Council attempt to elect a new council president. I said &#8220;attempt&#8221; because, after 14 rounds of voting, they were still deadlocked 7-7 for opposing candidates. However, that&#8217;s not what I want to talk about. In Mayor Bob Kiss&#8217; speech he made the following statement:</p>
<blockquote><p>My administration worked closely with the Open Government Committee formed by resolution of the City Council. In response to committee recommendations, we’ve included more information about public meetings on the City web-site and the Planning Department added a new section about proposed and pending zoning amendments. During the campaign it was clear that people want to know more about the activities of each city department. Over the next year we’ll look closely at how to finance and build a more uniform, responsive and user-friendly City website that will keep you better informed about public meetings and how you can participate in the process of government.</p></blockquote>
<p>I&#8217;m all for open government and the <a href="http://www.ci.burlington.vt.us/">City of Burlington, Vermont</a> could certainly use a better website. I&#8217;d like to give the city some advice on its priorities in building a better website. This blog post is my first round of advice, but I&#8217;d like to hear reactions from other web people in and around Burlington — or anyone else who has an interest in our city having a better website! This advice is based on the goals outlined by Mayor Bob Kiss: that the website is inline with the spirit of Open Government, is responsive, and is user-friendly.</p>
<p>First, the website must be accessible and use open standards. I put these two together because by using open standards the website can be accessible. Specifically, the website should use strictly semantic XHTML. This allows for its use in the widest range of user agents (browsers) by the widest range of user abilities (as opposed to disabilities). Its presentation should be progressively enriched through CSS and its behavior should be progressively enhanced through unobtrusive JavaScript. Progressive enhancement means that the website is useful, at its core, without any CSS or JavaScript. It becomes more useful through the use of CSS and then, perhaps, even more useful through the use of JavaScript. However, neither CSS nor JavaScript should be required to access the website&#8217;s content.</p>
<p>Second, the website should be built using free (as in freedom, not cost) and open source software. It is our government&#8217;s responsibility to use non-proprietary software wherever possible. When it comes to building websites and web applications, there are no excuses for not using free and open source software. The capabilities of the open web platforms available equal, or exceed, the capabilities of proprietary web platforms. Any custom software developed for the city&#8217;s website must be licensed to the city under a free and open source license (this does not mean that the city shouldn&#8217;t pay for this software to be developed).</p>
<p>Third, the city should embrace the concept of open linked data. This means that the city should publish data, not just content. This data should be both human and machine readable. This allows third parties to access raw data and repurpose this data in new and interesting ways. To this end, data and content should be either put in the public domain (which is probably the case already) or use a Creative Commons license. Where possible, the city&#8217;s website should consume open data published by others rather than duplicating effort. There are several technical approaches to publishing and consuming open linked data including Microformats and the Semantic Web.</p>
<p>I hope these recommendations are useful. Once I&#8217;ve heard some feedback from other web people, I&#8217;ll forward these recommendations to my city councilors and the mayor. Hopefully they&#8217;ll find it helpful in improving the city&#8217;s website!</p>
]]></content:encoded>
			<wfw:commentRss>http://bradley-holt.com/2009/04/open-local-government/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>The Web Is Not A Visual Medium</title>
		<link>http://bradley-holt.com/2009/03/the-web-is-not-a-visual-medium/</link>
		<comments>http://bradley-holt.com/2009/03/the-web-is-not-a-visual-medium/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 22:50:00 +0000</pubDate>
		<dc:creator>Bradley Holt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Open Standards]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://bradley-holt.com/2009/03/the-web-is-not-a-visual-medium/</guid>
		<description><![CDATA[A claim you may have heard me make before is that the web is not a visual medium. Some of you know exactly what I mean and some of you probably think I&#8217;m nuts. For those of you who think I&#8217;m crazy, let me elaborate. You, like most people, probably experience the web visually. However, [...]]]></description>
			<content:encoded><![CDATA[<p>A claim you may have heard me make before is that the web is not a visual medium. Some of you know exactly what I mean and some of you probably think I&#8217;m nuts. For those of you who think I&#8217;m crazy, let me elaborate. You, like most people, probably experience the web visually. However, this visual aspect is only one facet of the web. Underneath the visual aspect you will find that the web is a structured, or <em>semantic</em>, medium. This means that people (or even machines) of varying capabilities (as opposed to disabilities), using all sorts of user agents (a fancy way of saying web browsers) can experience this same web non-visually. If built correctly, the same web page should be accessible to you visually as well as to visually impaired people, search engine robots, people that want to use text only web browsers, people using older versions of web browsers (backward compatibility), people using mobile devices, and user agents that weren&#8217;t even invented yet when the web page was first built (<a href="http://en.wikipedia.org/wiki/Forward_compatibility">forward compatibility</a>).</p>
<p>There&#8217;s one catch. There are <em>many</em> web sites and web applications built on the incorrect assumption that the web is a visual medium. The web designers and web developers who build these web sites and web applications <a href="http://store.mozilla.org/product.php?code=14%2013108&amp;catid=0">break the web</a>. In order to not break the web, web designers and web developers need to use open standards starting with <a href="http://bradley-holt.com/2008/03/plain-old-semantic-html-posh/">plain old semantic (X)HTML</a>. This <em>semantic</em> (X)HTML can then be <a href="http://www.alistapart.com/articles/understandingprogressiveenhancement">progressively enriched/enhanced</a> using <abbr title="Cascading Style Sheets">CSS</abbr> (for presentation) and JavaScript (for behavior). This approach works well with the concept of <a href="http://www.w3.org/TR/mobile-bp/#OneWeb">One Web</a> which &#8220;means making, as far as is reasonable, the same information and services available to users irrespective of the device they are using.&#8221;</p>
<p>Craig Cook has a good article about <a href="http://www.alistapart.com/articles/grokwebstandards">How to Grok Web Standards</a> in which he addresses many of these ideas and more. If you still think I&#8217;m crazy, hopefully it&#8217;s not because you think I&#8217;m wrong about the web not being a visual medium. If you don&#8217;t think I&#8217;m crazy then maybe in another blog post I&#8217;ll talk about why I think that content management systems (CMSs) in general, and WYSIWYG editors specifically, break the web.</p>
]]></content:encoded>
			<wfw:commentRss>http://bradley-holt.com/2009/03/the-web-is-not-a-visual-medium/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CSS for Web Developers</title>
		<link>http://bradley-holt.com/2009/01/css-for-web-developers/</link>
		<comments>http://bradley-holt.com/2009/01/css-for-web-developers/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 20:37:00 +0000</pubDate>
		<dc:creator>Bradley Holt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[btvphpug]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Open Standards]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Vermont]]></category>

		<guid isPermaLink="false">http://bradley-holt.com/2009/01/css-for-web-developers/</guid>
		<description><![CDATA[The Burlington, VT PHP Users Group will be meeting Thursday January 22nd from from 6:00 pm to 8:00 pm. Since we (Found Line) recently had some demolition &#8211; I mean renovations &#8211; done we&#8217;ve got a bit more space so thought we&#8217;d finally host the meeting. Here&#8217;s a description of the presentation, &#8220;CSS for Web [...]]]></description>
			<content:encoded><![CDATA[<p>The Burlington, VT PHP Users Group will be <a href="http://groups.google.com/group/Burlington-VT-PHP/web/meeting-2009-01-22">meeting</a> Thursday January 22nd from from 6:00 pm to 8:00 pm. Since we (<a href="http://www.foundline.com/">Found Line</a>) recently had some demolition &#8211; I mean <a href="http://picasaweb.google.com/jason.pelletier/StudioConstruction#">renovations</a> &#8211; done we&#8217;ve got a bit more space so thought we&#8217;d finally host the meeting. Here&#8217;s a description of the presentation, &#8220;CSS for Web Developers&#8221;, that Jason will be giving:</p>
<blockquote><p>Most web developers don&#8217;t consider themselves designers—and shouldn&#8217;t. The reality of working on a website or web app, however, is that developers must either wear the designer hat or must interface with a designer/design team. Having a solid understanding of design best practices makes for a more efficient process and a higher quality product. Come hear more about web design and CSS from a designer&#8217;s perspective. We&#8217;ll cover semantic markup and its influence on CSS implementation, reset and debug stylesheets, tools for creating and debugging CSS, coding standards, and maybe even microformats if time allows. The goal isn&#8217;t to convert developers into design experts, but rather to give an overview of an effective design process that works for designers and developers alike.</p>
<p>Jason Pelletier is Creative Director and Web Designer for Found Line. The Burlington-based creative firm develops standards-based websites, product packaging and marketing strategies for growing businesses. Clients include Seventh Generation, Vermont Public Radio, EatingWell and True Body Products. Prior to co-founding Found Line, he managed creative resources for Seventh Generation, and was a designer for Stonyfield Farm.</p></blockquote>
<p>More details <a href="http://groups.google.com/group/Burlington-VT-PHP/web/meeting-2009-01-22">here</a>. Please pass this on to others you think might be interested. Pizza will be provided and we will be giving away a &#8220;<a href="http://store.mozilla.org/product.php?code=14%2013108&amp;catid=0">please don&#8217;t hurt the web &#8211; use open standards</a>&#8221; t-shirt as well as a copy of Jeffrey Zeldman&#8217;s book &#8220;<a href="http://www.zeldman.com/dwws/">Designing With Web Standards</a>&#8220;. Hope to see you there!</p>
]]></content:encoded>
			<wfw:commentRss>http://bradley-holt.com/2009/01/css-for-web-developers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing Requirements with Unit Tests</title>
		<link>http://bradley-holt.com/2008/09/testing-requirements-with-unit-tests/</link>
		<comments>http://bradley-holt.com/2008/09/testing-requirements-with-unit-tests/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 14:21:00 +0000</pubDate>
		<dc:creator>Bradley Holt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://bradley-holt.com/2008/09/testing-requirements-with-unit-tests/</guid>
		<description><![CDATA[I&#8217;m currently working on a project where the client is running their own web server that I will not have direct access to. This is actually a good thing in that it is a nice way to enforce the separation of the development and integration environments from the staging and production environments. However, how do [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently working on a project where the client is running their own web server that I will not have direct access to. This is actually a good thing in that it is a nice way to enforce the <a href="http://bradley-holt.blogspot.com/2008/07/developmentintegrationstagingproduction.html">separation of the development and integration environments from the staging and production environments</a>. However, how do I be sure that all of the system requirements will be met so that I can address any potential problems early on in the project? Sure, I could just give them a file with phpinfo() in it and have them send me the results. However, I plan on also shipping them unit tests for the application so why not have the requirements tested through unit tests as well?</p>
<p>My first thought was, since the application is being built in Zend Framework, just ship them the Zend Framework unit tests. It turns out there are a <em>lot</em> of unit tests and they have some heavy memory requirements. So, I decided on a simpler approach. I would run unit tests that simply tested for the <a href="http://framework.zend.com/manual/en/requirements.html">requirements</a> outlined in the Zend Framework documentation. Here are the tests:</p>
<pre><code>/**
 * The Requirements test case.
 *
 * @category   Requirements
 * @package    Requirements
 * @copyright  Copyright (c) 2005-2008 Found Line, Inc. (http://www.foundline.com/)
 * @license    http://www.foundline.com/legal/software-license/ New BSD License
 */
class Requirements extends PHPUnit_Framework_TestCase
{

    public function testVersionOfPhpIs5Dot1Dot4OrLater()
    {
        $this-&gt;assertTrue(version_compare(PHP_VERSION, '5.1.4', '&gt;='));
    }

    public function testVersionOfPhpIs5Dot2Dot3OrLater()
    {
        $this-&gt;assertTrue(version_compare(PHP_VERSION, '5.2.3', '&gt;='));    }

    /**
     * @dataProvider requiredExtensions
     * @param string $extensionName the name of the extension for which to test
     */
    public function testExtensionLoaded($extensionName)
    {
        $this-&gt;assertTrue(extension_loaded($extensionName));
    }

    public static function requiredExtensions()
    {
        return array(
            'apc'           =&gt; array('apc'),
            'bcmath'        =&gt; array('bcmath'),
            'bitset'        =&gt; array('bitset'),
            'ctype'         =&gt; array('ctype'),
            'curl'          =&gt; array('curl'),
            'dom'           =&gt; array('dom'),
            'gd'            =&gt; array('gd'),
            'hash'          =&gt; array('hash'),
            'ibm_db2'       =&gt; array('ibm_db2'),
            'iconv'         =&gt; array('iconv'),
            'interbase'     =&gt; array('interbase'),
            'json'          =&gt; array('json'),
            'libxml'        =&gt; array('libxml'),
            'mbstring'      =&gt; array('mbstring'),
            'memcache'      =&gt; array('memcache'),
            'mime_magic'    =&gt; array('mime_magic'),
            'mysqli'        =&gt; array('mysqli'),
            'oci8'          =&gt; array('oci8'),
            'pcre'          =&gt; array('pcre'),
            'pdo'           =&gt; array('pdo'),
            'pdo_mssql'     =&gt; array('pdo_mssql'),
            'pdo_mysql'     =&gt; array('pdo_mysql'),
            'pdo_oci'       =&gt; array('pdo_oci'),
            'pdo_pgsql'     =&gt; array('pdo_pgsql'),
            'pdo_sqlite'    =&gt; array('pdo_sqlite'),
            'posix'         =&gt; array('posix'),
            'reflection'    =&gt; array('Reflection'),
            'session'       =&gt; array('session'),
            'simpleXml'     =&gt; array('SimpleXML'),
            'soap'          =&gt; array('soap'),
            'spl'           =&gt; array('SPL'),
            'sqlite'        =&gt; array('SQLite'),
            'standard'      =&gt; array('standard'),
            'xml'           =&gt; array('xml'),
            'zlib'          =&gt; array('zlib'),
        );
    }

}</code></pre>
<p>Note that I&#8217;ve checked for both the recommended PHP version 5.2.3 and the required PHP version 5.1.4. Also, I&#8217;ve tested for both hard and soft dependencies for all components. This means that many of these tests could fail and my application could still be OK. I wanted as much information as possible so that I can detect any potential problems before I write too much code. As the specific requirements for this application become clearer, I will update the test to add or remove requirements. Of course, once there is real code and unit tests these requirements tests will become irrelevant. The point is to test for the presence of these requirements <em>before</em> I write the code.</p>
<p>Running these tests with the command <code> phpunit --testdox Requirements.php</code> (I&#8217;ve actually wrapped this into a bigger test suite, but that&#8217;s outside the scope of this blog post) gives me the following output on one of my development machines:</p>
<pre><code>PHPUnit 3.3.1 by Sebastian Bergmann.

Requirements
 [x] Version of php is 5 dot 1 dot 4 or later
 [x] Version of php is 5 dot 2 dot 3 or later
 [x] Extension loaded with data set "apc"
 [x] Extension loaded with data set "bcmath"
 [x] Extension loaded with data set "bitset"
 [x] Extension loaded with data set "ctype"
 [x] Extension loaded with data set "curl"
 [x] Extension loaded with data set "dom"
 [x] Extension loaded with data set "gd"
 [x] Extension loaded with data set "hash"
 [ ] Extension loaded with data set "ibm_db 2"
 [x] Extension loaded with data set "iconv"
 [x] Extension loaded with data set "interbase"
 [x] Extension loaded with data set "json"
 [x] Extension loaded with data set "libxml"
 [x] Extension loaded with data set "mbstring"
 [x] Extension loaded with data set "memcache"
 [x] Extension loaded with data set "mime_magic"
 [x] Extension loaded with data set "mysqli"
 [ ] Extension loaded with data set "oci 8"
 [x] Extension loaded with data set "pcre"
 [x] Extension loaded with data set "pdo"
 [ ] Extension loaded with data set "pdo_mssql"
 [x] Extension loaded with data set "pdo_mysql"
 [ ] Extension loaded with data set "pdo_oci"
 [ ] Extension loaded with data set "pdo_pgsql"
 [x] Extension loaded with data set "pdo_sqlite"
 [x] Extension loaded with data set "posix"
 [x] Extension loaded with data set "reflection"
 [x] Extension loaded with data set "session"
 [x] Extension loaded with data set "simple xml"
 [x] Extension loaded with data set "soap"
 [x] Extension loaded with data set "spl"
 [x] Extension loaded with data set "sqlite"
 [x] Extension loaded with data set "standard"
 [x] Extension loaded with data set "xml"
 [x] Extension loaded with data set "zlib"
</code></pre>
<p>There are a couple of potential problems to be aware of. First, PHPUnit will have to be installed on the machine that this will be tested on. This should probably only be done on the staging machine, not the production machine. Second, the CLI version of PHP often uses a different php.ini file then the CGI or ISAPI version. This means that some requirements may actually be available to your web application but they will fail the test when run at the command line.</p>
]]></content:encoded>
			<wfw:commentRss>http://bradley-holt.com/2008/09/testing-requirements-with-unit-tests/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ZendCon 2008</title>
		<link>http://bradley-holt.com/2008/09/zendcon-2008/</link>
		<comments>http://bradley-holt.com/2008/09/zendcon-2008/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 16:18:00 +0000</pubDate>
		<dc:creator>Bradley Holt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[ZendCon]]></category>
		<category><![CDATA[ZendCon08]]></category>

		<guid isPermaLink="false">http://bradley-holt.com/2008/09/zendcon-2008/</guid>
		<description><![CDATA[ZendCon 2008 wrapped up last week. This was my first time going to ZendCon and it was definitely worth it. There were over 650 people and over 60 sessions at the Santa Clara conference. I&#8217;ll try to post summaries and highlights from the sessions I attended.  It was a great opportunity to attended presentations [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.zendcon.com/">ZendCon</a> 2008 wrapped up last week. This was my first time going to ZendCon and it was definitely worth it. There were over 650 people and over 60 sessions at the Santa Clara conference. I&#8217;ll try to post summaries and highlights from the sessions I attended.  It was a great opportunity to attended presentations from some of the most well respected people in the PHP community including Vermont&#8217;s own <a href="http://weierophinney.net/matthew/">Matthew Weier O&#8217;Phinney</a> (Zend Technologies), <a href="http://mikenaberezny.com/">Mike Naberezny</a> (Maintainable Software), <a href="http://sebastian-bergmann.de/">Sebastian Bergmann</a> (eZ Systems), <a href="http://www.derickrethans.nl/">Derick Rethans</a> (eZ Systems),  <a href="http://galbraiths.org/blog/">Ben Galbraith</a> (<a href="http://ajaxian.com/">Ajaxian.com</a>) , <a href="http://marcus-boerger.de/">Marcus Boerger</a> (Google), and <a href="http://benramsey.com/">Ben Ramsey</a> (Schematic).</p>
<p><a href="http://www.zend.com/zce.php?c=ZEND008969&#038;r=227171017"><img style="margin: 0pt 10px 10px 0pt; float: left;" src="http://2.bp.blogspot.com/_OLV-zodnLDg/SNfDyU5TGmI/AAAAAAAAAlc/xofhIR7fuVQ/s400/zf-zce-logo.gif" alt="Zend Certified Engineer (ZCE) in Zend Framework" id="BLOGGER_PHOTO_ID_5248879160093514338" border="0" /></a>Last Tuesday during the opening keynote Zend announced the new Zend Framework certification. I was fortunate enough to get a testing slot on Thursday morning. After reading the 214 page study guide on Wednesday I passed the test, so am now a Zend Certified Engineer (ZCE) in Zend Framework! If you plan on taking the test, I definitely recommend reading the study guide. I&#8217;ve been using Zend Framework since 1.0 and I&#8217;m not sure I would have passed if I hadn&#8217;t read the study guide.</p>
]]></content:encoded>
			<wfw:commentRss>http://bradley-holt.com/2008/09/zendcon-2008/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Development/Integration/Staging/Production</title>
		<link>http://bradley-holt.com/2008/07/developmentintegrationstagingproduction/</link>
		<comments>http://bradley-holt.com/2008/07/developmentintegrationstagingproduction/#comments</comments>
		<pubDate>Thu, 31 Jul 2008 23:53:00 +0000</pubDate>
		<dc:creator>Bradley Holt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Best Practices]]></category>

		<guid isPermaLink="false">http://bradley-holt.com/2008/07/developmentintegrationstagingproduction/</guid>
		<description><![CDATA[I am surprised by how many developers think it&#8217;s OK to do work directly in a production environment or to deploy to production directly from their development environment. I found a good article today that explains the traditional Development/Integration/Staging/Production practice. The specific setup may be different depending on your environment, but the basic ideas are [...]]]></description>
			<content:encoded><![CDATA[<p>I am surprised by how many developers think it&#8217;s OK to do work directly in a production environment or to deploy to production directly from their development environment. I found a good article today that explains the traditional <a href="http://dltj.org/article/software-development-practice/">Development/Integration/Staging/Production practice</a>. The specific setup may be different depending on your environment, but the basic ideas are the same.</p>
]]></content:encoded>
			<wfw:commentRss>http://bradley-holt.com/2008/07/developmentintegrationstagingproduction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy Way to Run Web Applications Locally</title>
		<link>http://bradley-holt.com/2008/07/easy-way-to-run-web-applications-locally/</link>
		<comments>http://bradley-holt.com/2008/07/easy-way-to-run-web-applications-locally/#comments</comments>
		<pubDate>Fri, 25 Jul 2008 15:59:00 +0000</pubDate>
		<dc:creator>Bradley Holt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://bradley-holt.com/2008/07/easy-way-to-run-web-applications-locally/</guid>
		<description><![CDATA[I&#8217;ve been trying out a new way to run web applications on my local machine. Since I work on many different websites I like to be able to run these sites on my local machine. This lets me try out changes locally before committing them to Subversion and rolling them out to a staging or [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been trying out a new way to run web applications on my local machine. Since I work on many different websites I like to be able to run these sites on my local machine. This lets me try out changes locally before committing them to Subversion and rolling them out to a staging or production environment. In the past I&#8217;ve simply created a new virtual host in Apache listening on its own port. The problem with this is that not only do I need to manually setup each new site, I also need to remember which site goes with which port number.</p>
<p>So, I&#8217;ve started using Apache&#8217;s <a href="http://httpd.apache.org/docs/2.0/vhosts/mass.html">dynamically configured mass virtual hosting</a>. This gets me two things. First, I don&#8217;t need to make any changes in Apache&#8217;s configuration file when I want to setup a new local web application. Second, I now have an easy-to-remember naming convention for sites that are running locally. This works really well for me, but your mileage may vary depending on your specific needs. There are also other tools that can help you accomplish similar results, but I like the simplicity of this in that it doesn&#8217;t require anything other than Apache and some DNS settings.</p>
<p>Let me explain the end result first, and then I&#8217;ll explain how I got there. For each website I work on I use the subdomain to indicate the environment it&#8217;s running in. Using the domain <span style="font-family:courier new;">example.org</span> we may have the following environments setup:</p>
<ul>
<li><span style="font-family:courier new;">local.example.org</span> &#8211; the local copy</li>
<li><span style="font-family:courier new;">beta.example.org</span> &#8211; a semi-publicly available beta</li>
<li><span style="font-family:courier new;">www.example.org</span> &#8211; the live site</li>
</ul>
<p>The <span style="font-family:courier new;">beta</span> and <span style="font-family:courier new;">www</span> versions aren&#8217;t anything special, just normal websites. For <span style="font-family:courier new;">local.example.org</span> I need to have a DNS entry that points to the loopback address, 127.0.0.1. This can either be a publicly available DNS entry (which could be a little awkward) or simply set in your hosts file. I&#8217;ve simply made the entry in my hosts file:</p>
<p><span style="font-family:courier new;">127.0.0.1    local.example.org</span></p>
<p>The downside of this is that you would need to update the host file on each machine that you wanted to run the <span style="font-family:courier new;">local.example.org</span> site on. A comprimise would be to run your own recursive DNS service that only your computers used and make the DNS entries there.</p>
<p>This next step only needs to be done once. The <a href="http://httpd.apache.org/docs/2.0/vhosts/mass.html">dynamically configured mass virtual hosting</a> article explains in detail how to set this up. My Apache configuration looks something like this:</p>
<p><span style="font-family:courier new;">VirtualDocumentRoot /path/to/workspace/%2+/public</span><br /><span style="font-family:courier new;"><directory><span style="font-family:courier new;"></span></directory></span><br />Again, your specific configuration may be different. When making a request to <span style="font-family:courier new;">http://local.example.org/</span> the document root would expand to <span style="font-family:courier new;">/path/to/workspace/</span><span style="font-family:courier new;">example.org</span><span style="font-family:courier new;">/public</span>. This assumes that you have placed all of your projects in the same location and they all have a similar directory layout (I&#8217;m using Zend Framework&#8217;s directory layout). I think there&#8217;s a way to do this in a way that&#8217;s more flexible, but I haven&#8217;t had the need. Let me know if you have any questions!</p>
]]></content:encoded>
			<wfw:commentRss>http://bradley-holt.com/2008/07/easy-way-to-run-web-applications-locally/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Burlington, VT PHP Users Group Meeting Last Night</title>
		<link>http://bradley-holt.com/2008/06/burlington-vt-php-users-group-meeting-last-night/</link>
		<comments>http://bradley-holt.com/2008/06/burlington-vt-php-users-group-meeting-last-night/#comments</comments>
		<pubDate>Fri, 27 Jun 2008 15:03:00 +0000</pubDate>
		<dc:creator>Bradley Holt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://bradley-holt.com/2008/06/burlington-vt-php-users-group-meeting-last-night/</guid>
		<description><![CDATA[A big thanks to Bluehouse Group for hosting Last nights Burlington, VT PHP Users Group meeting! Both Matthew Weier O&#8217;Phinney and Rob Riggen provided some great presentations. Matthew&#8217;s presentation was a continuation of his best practices series. This one was on documenation. Rob presented the latest installment of his framework series, this one on Zend [...]]]></description>
			<content:encoded><![CDATA[<p>A big thanks to <a href="http://www.bluehousegroup.com/">Bluehouse Group</a> for hosting Last nights Burlington, VT PHP Users Group meeting! Both <a href="http://weierophinney.net/matthew/">Matthew Weier O&#8217;Phinney</a> and <a href="http://www.riggen.org/">Rob Riggen</a> provided some great presentations. Matthew&#8217;s presentation was a continuation of his best practices series. This one was on <a href="http://www.slideshare.net/weierophinney/best-practices-documentation/">documenation</a>. Rob presented the latest installment of his framework series, this one on <a href="http://framework.zend.com/">Zend Framework</a>. I think we had a decent turnout for a summer users group meeting. Any other web developers out there, put next month&#8217;s meeting on your calendar! We meet the fourth Thursday of every month.</p>
]]></content:encoded>
			<wfw:commentRss>http://bradley-holt.com/2008/06/burlington-vt-php-users-group-meeting-last-night/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
