<?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>Jon&#039;s Blog &#187; Zend Framework</title>
	<atom:link href="http://bombdiggity.net/blog/tag/zend-framework/feed/" rel="self" type="application/rss+xml" />
	<link>http://bombdiggity.net/blog</link>
	<description>Ramblings of a php coder</description>
	<lastBuildDate>Fri, 14 May 2010 17:36:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Zend Framework 1.8 Released</title>
		<link>http://bombdiggity.net/blog/2009/04/30/zend-framework-18-released/</link>
		<comments>http://bombdiggity.net/blog/2009/04/30/zend-framework-18-released/#comments</comments>
		<pubDate>Fri, 01 May 2009 00:44:27 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[EC2]]></category>

		<guid isPermaLink="false">http://www.bombdiggity.net/blog/?p=137</guid>
		<description><![CDATA[As I&#8217;m sure everyone is almost aware by now Zend Framework 1.8 has been released. This is an extra special release for me as I spend two good weeks back in March writing the Ec2 Component after being pinged by Zend to do it. It was fun writing it and learning more that I ever [...]]]></description>
			<content:encoded><![CDATA[<p>As I&#8217;m sure everyone is almost aware by now Zend Framework 1.8 has been released. This is an extra special release for me as I spend two good weeks back in March writing the Ec2 Component after being pinged by Zend to do it.</p>
<p>It was fun writing it and learning more that I ever wanted to know about the Ec2 API&#8217;s but all it all it was a great expierice and I&#8217;m glad that I got the chance to do it.</p>
<p>Other notable items in the 1.8 release are:</p>
<ul>
<li>Zend_Application</li>
<li>Zend_Tool</li>
<li>Zend_Crypt</li>
<li>Zend_Service_Amazon_S3</li>
<li><a title="Zend Framework 1.8 Released" href="http://devzone.zend.com/article/4524-Zend-Framework-1.8.0-Released">and so much more</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://bombdiggity.net/blog/2009/04/30/zend-framework-18-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Framework Ec2 API</title>
		<link>http://bombdiggity.net/blog/2009/03/27/zend-framework-ec2-api/</link>
		<comments>http://bombdiggity.net/blog/2009/03/27/zend-framework-ec2-api/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 04:33:57 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Amazon AWS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[AWS]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[EC2]]></category>

		<guid isPermaLink="false">http://www.bombdiggity.net/blog/?p=133</guid>
		<description><![CDATA[So about two weeks ago Wil Sinclair from Zend pinged me about creating an Zend Framework API interface for Amazon Ec2. I was coming off of playing around with Ec2 for work and figured I would give it a shot. With the proposal filed I began the task of coding it out. After two weeks [...]]]></description>
			<content:encoded><![CDATA[<p>So about two weeks ago Wil Sinclair from Zend pinged me about creating an<a href="http://framework.zend.com/"> Zend Framework</a> API interface for Amazon Ec2. I was coming off of playing around with Ec2 for work and figured I would give it a shot. With the <a title="Zend_Service_Amazon_Ec2 Proposal" href="http://framework.zend.com/wiki/display/ZFPROP/Zend_Service_Amazon_Ec2+-+Jon+Whitcraft">proposal filed</a> I began the task of coding it out. After two weeks of writing code I had a working interface for the Query API from Amazon.</p>
<p>I do have to say I learned a lot while doing the inital work and I&#8217;m happy that Wil pinged me to do it. If you want to check out the code currently it lives on <a href="http://github.com/sidhighwind/zend_service_amazon_ec2/tree/master">github</a> but it is on track to make the 1.8 release of Zend Framework.</p>
<p>Please leave a commet here or on the proposal for anything that I may have over looked or if you have any ideas on how I could make it better.</p>
]]></content:encoded>
			<wfw:commentRss>http://bombdiggity.net/blog/2009/03/27/zend-framework-ec2-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Browser Caching with Zend Framework</title>
		<link>http://bombdiggity.net/blog/2009/03/27/browser-caching-with-zend-framework/</link>
		<comments>http://bombdiggity.net/blog/2009/03/27/browser-caching-with-zend-framework/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 04:27:34 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://www.bombdiggity.net/blog/?p=130</guid>
		<description><![CDATA[While watching the Zend Devzone RSS feed they posted a link to an article that talks about using the Etag Header to make ZF more cache friendly to the browser. While I was a little hesitant at first about this in my testing on my dev server it seems to have improved page performance in [...]]]></description>
			<content:encoded><![CDATA[<p>While watching the <a title="Zend Developer Zone" href="http://devzone.zend.com">Zend Devzone</a> RSS feed they posted a link to an article that talks about using the Etag Header to make ZF more cache friendly to the browser.</p>
<p><span id="more-130"></span>While I was a little hesitant at first about this in my testing on my dev server it seems to have improved page performance in the form of reduced bandwidth coming off the server which is always a good thing.</p>
<p>All that is required is to create and register a new front controller plugin. <a title="Zend Framework Browser Caching" href="http://smartycode.com/performance/zend-framework-browser-caching/">Click here for the most up to date code</a>.</p>
<p>I personally think it&#8217;s worth checking out if you run a zend framework based site as it&#8217;s only about ~35 lines of code at the time of writing.</p>
]]></content:encoded>
			<wfw:commentRss>http://bombdiggity.net/blog/2009/03/27/browser-caching-with-zend-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Studio for Eclipse &#8211; New Framework Project Problems</title>
		<link>http://bombdiggity.net/blog/2009/01/03/zend-studio-for-eclipse-new-framework-project-problems/</link>
		<comments>http://bombdiggity.net/blog/2009/01/03/zend-studio-for-eclipse-new-framework-project-problems/#comments</comments>
		<pubDate>Sat, 03 Jan 2009 22:11:43 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[project]]></category>

		<guid isPermaLink="false">http://www.bombdiggity.net/blog/?p=64</guid>
		<description><![CDATA[While working on a new project where my base was Zend Framework I desided to give the default layout for new ZF projects in Zend Studio for Eclipse a chance. While it does start a good layout for a project by generating the default code which is a real time saver I did notice some [...]]]></description>
			<content:encoded><![CDATA[<p>While working on a new project where my base was Zend Framework I desided to give the default layout for new ZF projects in Zend Studio for Eclipse a chance. While it does start a good layout for a project by generating the default code which is a real time saver I did notice some problems.<br />
<span id="more-64"></span></p>
<ol>
<li>All of the class files have the closing php tag (?&gt;) on them followed by white space.</li>
<li>Lack of a modules directory in the default project</li>
<li>The Initializer Plug-in does not do some very basic things that should be done.</li>
</ol>
<h3>1. Closing php Tag</h3>
<p>According to the <a title="Zend Framework Wiki" href="http://framework.zend.com/wiki/display/ZFDEV/PHP+Coding+Standard+(draft)#PHPCodingStandard(draft)-PHPFileFormatting" target="_blank">PHP Coding Standard</a> that is on the Zend Framework Wiki:</p>
<p style="padding-left: 30px;">For files that contain only PHP code, the closing tag (&#8220;?&gt;&#8221;) is to be omitted. It is not required by PHP, and omitting it prevents trailing whitespace from being accidentally injected into the output.</p>
<h3>2. Lack of a modules direcory</h3>
<p>I know this is easy to add if you know what you are doing with ZF but someone who is new to the framework they might find it hard to understand how to add support for the modules directory. It&#8217;s part of the <a href="http://framework.zend.com/wiki/display/ZFPROP/Zend+Framework+Default+Project+Structure+-+Wil+Sinclair">proposed project structure</a> in the ZF wiki.</p>
<h3>3. Initializer Plug-in</h3>
<p>This is where I have the biggest problem with the default project that is generated.</p>
<ol>
<li>The basic layout of the file is fine except for all the init*() methods return void where they should return the class object so that you can chain requests together in the routeStartup() method.</li>
<li>It sets the controller directory last so if something throws an exception before before the controller path is set you end up seeing the exception about how ZF can not find the error controller instead of the actually exception thrown.</li>
</ol>
<p>Let me know in the comments if you have any suggestions or additions to this.</p>
<p>Here is my updated Initializer.php file</p>
<pre class="brush: php">&lt; ?php
&lt;?php
/**
 * My new Zend Framework project
 *
 * $LastChangedDate$
 * $LastChangedRevision$
 */

require_once &#039;Zend/Controller/Plugin/Abstract.php&#039;;
require_once &#039;Zend/Controller/Front.php&#039;;
require_once &#039;Zend/Controller/Request/Abstract.php&#039;;
require_once &#039;Zend/Controller/Action/HelperBroker.php&#039;;

/**
 *
 * Initializes configuration depndeing on the type of environment
 * (test, development, production, etc.)
 *
 * This can be used to configure environment variables, databases,
 * layouts, routers, helpers and more
 *
 */
class Initializer extends Zend_Controller_Plugin_Abstract
{
    /**
     * @var Zend_Config
     */
    protected static $_config;

    /**
     * @var string Current environment
     */
    protected $_env;

    /**
     * @var Zend_Controller_Front
     */
    protected $_front;

    /**
     * @var string Path to application root
     */
    protected $_root;

    /**
     * Constructor
     *
     * Initialize environment, root path, and configuration.
     *
     * @param  string $env
     * @param  string|null $root
     * @return void
     */
    public function __construct($env, $root = null)
    {
        $this-&gt;_setEnv($env);
        if (null === $root) {
            $root = realpath(dirname(__FILE__) . &#039;/../&#039;);
        }
        $this-&gt;_root = $root;

        $this-&gt;initPhpConfig();

        $this-&gt;_front = Zend_Controller_Front::getInstance();

        // set the test environment parameters
        if ($env == &#039;test&#039;) {
            // Enable all errors so we&#039;ll know when something goes wrong.
            error_reporting(E_ALL | E_STRICT);
            ini_set(&#039;display_startup_errors&#039;, 1);
            ini_set(&#039;display_errors&#039;, 1);

            $this-&gt;_front-&gt;throwExceptions(true);
        }
    }

    /**
     * Initialize environment
     *
     * @param  string $env
     * @return void
     */
    protected function _setEnv($env)
    {
        $this-&gt;_env = $env;
    }

    /**
     * Initialize Data bases
     *
     * @return Initializer
     */
    public function initPhpConfig()
    {

    }

    /**
     * Route startup
     *
     * @return Initializer
     */
    public function routeStartup(Zend_Controller_Request_Abstract $request)
    {
        $this-&gt;initControllers()
            -&gt;initHelpers()
            -&gt;initView()
            -&gt;initDb()
            -&gt;initPlugins()
            -&gt;initRoutes();

        return $this;
    }

    /**
     * Initialize data bases
     *
     * @return Initializer
     */
    public function initDb()
    {
        return $this;
    }

    /**
     * Initialize action helpers
     *
     * @return Initializer
     */
    public function initHelpers()
    {
        // register the default action helpers
        Zend_Controller_Action_HelperBroker::addPath( $this-&gt;_root . &#039;/application/default/helpers&#039;, &#039;Zend_Controller_Action_Helper&#039;);

        return $this;
    }

    /**
     * Initialize view
     *
     * @return Initializer
     */
    public function initView()
    {
        // Bootstrap layouts
        Zend_Layout::startMvc(array(
            &#039;layoutPath&#039; =&gt; $this-&gt;_root .  &#039;/application/default/layouts&#039;,
            &#039;layout&#039; =&gt; &#039;main&#039;
        ));

        return $this;

    }

    /**
     * Initialize plugins
     *
     * @return Initializer
     */
    public function initPlugins()
    {
        return $this;
    }

    /**
     * Initialize routes
     *
     * @return Initializer
     */
    public function initRoutes()
    {
        return $this;
    }

    /**
     * Initialize Controller and Modules paths
     *
     * @return Initializer
     */
    public function initControllers()
    {
        $this-&gt;_front-&gt;addControllerDirectory($this-&gt;_root . &#039;/application/default/controllers&#039;, &#039;default&#039;);
        $this-&gt;_front-&gt;addModuleDirectory($this-&gt;_root . &#039;/application/modules&#039;);

        return $this;
    }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://bombdiggity.net/blog/2009/01/03/zend-studio-for-eclipse-new-framework-project-problems/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Migrating OOP Libraries and Frameworks to PHP 5.3</title>
		<link>http://bombdiggity.net/blog/2008/06/30/migrating-oop-libraries-and-frameworks-to-php-53/</link>
		<comments>http://bombdiggity.net/blog/2008/06/30/migrating-oop-libraries-and-frameworks-to-php-53/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 16:27:49 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://www.bombdiggity.net/blog/?p=24</guid>
		<description><![CDATA[Over at Phly, boy, phly, Zend Framework coder Matthew Weier O'Phinney, talks about issues with implementation of namespacing in PHP 5.3 and the coding standards of Zend Framework]]></description>
			<content:encoded><![CDATA[<p>Over at <a title="Phly, boy, phly" href="http://weierophinney.net/matthew/">Phly, boy, phly</a>, <a title="Zend Framework" href="http://framework.zend.com">Zend Framework</a> coder Matthew Weier O&#8217;Phinney, talks about issues with implementation of namespacing in PHP 5.3 and the coding standards of Zend Framework.</p>
<p>The issue is, that the <span class="caps">PHP</span> parser does not allow <strong>class Abstract</strong>, neither <strong>interface Interface</strong> as both “abstract” and “interface” are reserved keywords. So Zend suggests prefixing interfaces with “I” and abstract classes with “A”. Hungarian notation for classes and interfaces.</p>
<p>It&#8217;s definitely a good read if you are looking into using namespacing in PHP 5.3 and what issues it may bring up with you code.  <a href="http://weierophinney.net/matthew/archives/181-Migrating-OOP-Libraries-and-Frameworks-to-PHP-5.3.html">Read it now »</a></p>
]]></content:encoded>
			<wfw:commentRss>http://bombdiggity.net/blog/2008/06/30/migrating-oop-libraries-and-frameworks-to-php-53/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
