<?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; PHP</title>
	<atom:link href="http://bombdiggity.net/blog/tag/php/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>Full Open PHP Tag In JetBrains PhpStorm</title>
		<link>http://bombdiggity.net/blog/2010/03/14/full-open-php-tag-in-jetbrains-php-storm/</link>
		<comments>http://bombdiggity.net/blog/2010/03/14/full-open-php-tag-in-jetbrains-php-storm/#comments</comments>
		<pubDate>Sun, 14 Mar 2010 23:14:01 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[ide]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[phpstorm]]></category>

		<guid isPermaLink="false">http://www.bombdiggity.net/blog/?p=191</guid>
		<description><![CDATA[A little annoyance of mine with PhpStorm is that currently there is no option to turn on auto complete for full open php tag (&#60;?php) when you type in the short open tag (&#60;?).Â  I submitted a bug for this as I see it being a major issue because all the major php IDE do [...]]]></description>
			<content:encoded><![CDATA[<p>A little annoyance of mine with PhpStorm is that currently there is no option to turn on auto complete for full open php tag (&lt;?php) when you type in the short open tag (&lt;?).Â  <span id="more-191"></span></p>
<p>I submitted a <a href="http://youtrack.jetbrains.net/issue/WI-862">bug</a> for this as I see it being a major issue because all the major php IDE do this by default.Â  But come to find out it&#8217;s possible to do with a little bit of work.</p>
<ol>
<li>Start by going to File -&gt; Setting (Ctrl-Alt-S)</li>
<li>On the settings window goto Live Templates</li>
<li>Press the Add Button</li>
<li>Put <strong>&lt;?</strong> in for Abbrevation</li>
<li>Enter <strong>PHP</strong> for Group</li>
<li>Enter a Description</li>
<li>Enter <strong>&lt;?php</strong> for Template Text</li>
<li>Under Options Select <strong>Space</strong> for Expand with</li>
<li>Tick <strong>PHP</strong> for the Context</li>
<li>Press OK<img class="aligncenter size-full wp-image-192" title="PhpStorm Live Template" src="http://www.bombdiggity.net/blog/wp-content/uploads/2010/03/webide-full-phptag.png" alt="" width="536" height="474" /></li>
</ol>
<p>And now you have PhpStorm auto inserting &lt;?php when you type &lt;?&lt;space&gt;.</p>
]]></content:encoded>
			<wfw:commentRss>http://bombdiggity.net/blog/2010/03/14/full-open-php-tag-in-jetbrains-php-storm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accessing ZF Application Resources In Controller</title>
		<link>http://bombdiggity.net/blog/2009/12/09/accessing-zf-application-resources-in-controller/</link>
		<comments>http://bombdiggity.net/blog/2009/12/09/accessing-zf-application-resources-in-controller/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 04:15:35 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[resource]]></category>
		<category><![CDATA[zend_application]]></category>
		<category><![CDATA[zf]]></category>

		<guid isPermaLink="false">http://www.bombdiggity.net/blog/?p=162</guid>
		<description><![CDATA[My friend Rob Allen recently posted a quick how-to on how to access your configuration data in application.ini file while in a controller or action helper. The one part Rob didn&#8217;t touch on was how to get resources back. Resources are set when you return something out of your _init&#60;MethodName&#62;. For example when you use [...]]]></description>
			<content:encoded><![CDATA[<p>My friend Rob Allen recently posted a quick how-to on how to <a href="http://akrabat.com/zend-framework/accessing-your-configuration-data-in-application-ini/">access your configuration data in application.ini</a> file while in a controller or action helper. The one part Rob didn&#8217;t touch on was how to get resources back.</p>
<p><span id="more-162"></span></p>
<p>Resources are set when you return something out of your _init&lt;MethodName&gt;. For example when you use the following source code and return the $_logger, Zend_Application stores the returned value in a registry inside the application.</p>
<pre class="brush: php">
// place in your bootstrap file.
public function _initLogger()
{
    $writer = new Zend_Log_Writer_Firebug();
    $_logger = new Zend_Log($writer);
    return $_logger;
}
</pre>
<p>Now the way you get access to the logger is by doing the following inside your controller or controller helper:</p>
<pre class="brush: php">
class IndexController extends Zend_Controller_Action
{
    public function indexAction()
    {
        // action body
        $logger = $this-&gt;getInvokeArg(&#039;bootstrap&#039;)
                        -&gt;getResource(&#039;logger&#039;);
    }
}
</pre>
<p>The key is the getResource() method.  You pass in the part following the _init from your method name.  This will return the instance of what ever object was returned in the _init method. </p>
<p>Where I got stuck, was since I&#8217;m using the Module Bootstrap for my modules and I only want the logger on specific modules and not the whole application when I used the above code it returned null.  The reason for null was because it was not in the global bootstrap file. To get access to the resources from the module bootstrap you need to use the following code:</p>
<pre class="brush: php">
class Admin_IndexController extends Zend_Controller_Action
{
    public function indexAction()
    {
        // action body
        $logger = $this-&gt;getInvokeArg(&#039;bootstrap&#039;)
                        -&gt;getResource(&#039;modules&#039;)
                        -&gt;offsetGet($this-&gt;getRequest()-&gt;getModuleName())
                        -&gt;getResource(&#039;logger&#039;);
    }
}
</pre>
<p>I hope this helps someone else out there as it was an eye opener to me when I was told about it via the ZF mailing list.</p>
]]></content:encoded>
			<wfw:commentRss>http://bombdiggity.net/blog/2009/12/09/accessing-zf-application-resources-in-controller/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>What the&#8230;?&gt; PHP and unwanted whitespace</title>
		<link>http://bombdiggity.net/blog/2009/02/18/what-the%e2%80%a6-php-and-unwanted-whitespace/</link>
		<comments>http://bombdiggity.net/blog/2009/02/18/what-the%e2%80%a6-php-and-unwanted-whitespace/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 20:34:01 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[IMS]]></category>
		<category><![CDATA[IndyCar Series]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.bombdiggity.net/blog/?p=82</guid>
		<description><![CDATA[Over at BigBlueHat there is an interesting blog post about using the ?&#62; at the end of php files. While personally I don&#8217;t use it on scripts that contain just php code, but I can see where both sides are coming from. Check out the article and leave your feedback!]]></description>
			<content:encoded><![CDATA[<p>Over at <a title="BigBlueHat" href="http://www.bigbluehat.com/blog/">BigBlueHat</a> there is an interesting blog post about using the ?&gt; at the end of php files.  While personally I don&#8217;t use it on scripts that contain just php code, but I can see where both sides are coming from.</p>
<p><a href="http://www.bigbluehat.com/blog/2009/02/18/what-the-php-and-unwanted-whitespace/">Check out the article and leave your feedback!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://bombdiggity.net/blog/2009/02/18/what-the%e2%80%a6-php-and-unwanted-whitespace/feed/</wfw:commentRss>
		<slash:comments>1</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>Twitter Service for Zend Framework</title>
		<link>http://bombdiggity.net/blog/2008/11/16/twitter-service-for-zend-framework/</link>
		<comments>http://bombdiggity.net/blog/2008/11/16/twitter-service-for-zend-framework/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 01:05:01 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[zf]]></category>

		<guid isPermaLink="false">http://www.bombdiggity.net/blog/?p=50</guid>
		<description><![CDATA[After almost 2 months of work I am happy to have Zend_Service_Twitter included into the standard trunk for Zend Framework.  Currently Zend_Service_Twitter is schedule to be included in the 1.7 release.]]></description>
			<content:encoded><![CDATA[<p>Earlier this week I had the extreme pleasure of having my first addition to Zend Framework added to the standard library.  I started working on this component after talking with <a href="http://weierophinney.net/matthew/">Matthew Weier O&#8217;Phinney</a> at ZendCon &#8217;08 where he stated that he didn&#8217;t have time to work on implementing the api for use in with the framework.</p>
<p>Zend_Twitter_Service is currently in the standard trunk for Zend Framework and is scheduled to be released with 1.7.  Please check it out and check back for some examples in the next few days.</p>
]]></content:encoded>
			<wfw:commentRss>http://bombdiggity.net/blog/2008/11/16/twitter-service-for-zend-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP implemented in 100% Java</title>
		<link>http://bombdiggity.net/blog/2008/08/09/php-implemented-in-100-java/</link>
		<comments>http://bombdiggity.net/blog/2008/08/09/php-implemented-in-100-java/#comments</comments>
		<pubDate>Sat, 09 Aug 2008 14:13:45 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.bombdiggity.net/blog/?p=34</guid>
		<description><![CDATA[Quercus allows developers to incorporate Java code into PHP web applications and gives both Java and PHP developers a fast, safe, and powerful alternative to the standard PHP interpreter.]]></description>
			<content:encoded><![CDATA[<div class="entrybody">
<div class="snap_preview">
<p>Thanks to Federico over at <a href="http://phpimpact.wordpress.com/">PHP::Impact ( [str Blog] )</a> for posting this.  I&#8217;m going to test it out and see how well it really works.</p>
<p><a href="http://www.caucho.com/" target="_blank">Quercus</a> allows developers to incorporate Java code into PHP web applications and gives both Java and PHP developers a fast, safe, and powerful alternative to the standard PHP interpreter.</p>
<p>Quercus natively supports Unicode and the new Unicode syntax of the up-and-coming PHP 6, and implements a growing list of PHP extensions (i.e. APC, iconv, GD, gettext, JSON, MySQL, Oracle, PDF, Postgres, etc.). Many popular PHP applications will run as well as, if not better, than the standard PHP interpreter straight out of the box.</p>
<p>Quercus PHP libraries are written entirely in Java, thereby taking the advantages of Java applications and infusing them into PHP.</p>
<h3>Benefits</h3>
<p>Although PHP users and Java users can take advantage of Quercus immediately without modifying their application, the real benefits come from developing mixed Java/PHP applications:</p>
<ul>
<li>PHP libraries written in Java are fast, safe, and relatively easy to develop, compared with C libraries. Since Java is the library language, developers won’t need to be paranoid about third-party libraries having C-memory problems or segvs.</li>
<li>PHP applications can take advantage of Java libraries and capabilities like JMS, SOA frameworks, Hibernate, or Spring. (Or EJB if you really wanted.)</li>
<li>Java application can move presentation code to PHP, leaving behind templating systems, or languages with small libraries, and taking advantage of PHP flexibility and capability.</li>
</ul>
<h3>Links</h3>
<ul>
<li><a href="http://www.caucho.com/" target="_blank">Quercus Webistes</a></li>
<li><a href="http://wiki.caucho.com/" target="_blank">Quercus Wiki</a></li>
</ul>
<p>I&#8217;m going to setup a test box and test this out to see how it compares to the standard LAMP stack.  Check back for more information.</p></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://bombdiggity.net/blog/2008/08/09/php-implemented-in-100-java/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adobe to contribute AMF support to Zend Framework</title>
		<link>http://bombdiggity.net/blog/2008/07/30/adobe-to-contribute-amf-support-to-zend-framework/</link>
		<comments>http://bombdiggity.net/blog/2008/07/30/adobe-to-contribute-amf-support-to-zend-framework/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 23:31:40 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Zend]]></category>

		<guid isPermaLink="false">http://www.bombdiggity.net/blog/?p=31</guid>
		<description><![CDATA[Adobe has made a proposal for an AMF (Action Message Format) component in Zend Framework. This ZF component will allow for client-side applications built with Flex and Adobe AIR to communicate easily and efficiently with PHP on the server-side. Leading the design of the component for Adobe is Wade Arnold. Wade already has a track record of bringing the Adobe RIA technologies to PHP as a result of all of his work on AMFPHP.]]></description>
			<content:encoded><![CDATA[<p>Thanks to the tweet from <a href="http://twitter.com/andigutmans/statuses/873048627">Andi Gutmans</a> and the <a href="http://andigutmans.blogspot.com/2008/07/adobe-to-contribute-amf-support-to-zend.html">blog post</a> for the huge heads up on this one.</p>
<p>Adobe has made a <a href="http://framework.zend.com/wiki/display/ZFPROP/Zend_Amf">proposal</a> for an AMF (Action Message Format) component in <a href="http://framework.zend.com/">Zend Framework</a>. This ZF component will allow for client-side applications built with <a href="http://www.adobe.com/products/flex/">Flex</a> and <a href="http://www.adobe.com/products/air/">Adobe AIR</a> to communicate easily and efficiently with PHP on the server-side. Leading the design of the component for Adobe is <a href="http://wadearnold.com/blog/">Wade Arnold</a>. Wade already has a track record of bringing the Adobe RIA technologies to PHP as a result of all of his work on AMFPHP.</p>
<p>This is going to make things in my life much easier as I&#8217;m becoming a Flex developer (not by choice) at work. Don&#8217;t get me wrong, I am having fun learning Flex but having to work with WebOrb is just a pain in the ass when there are such better tools out there.</p>
<p>Zend_Amf is being targeted for the 1.7 release as the release cycle for 1.6 is under way.</p>
<p>I&#8217;m going to watch this one closely.</p>
]]></content:encoded>
			<wfw:commentRss>http://bombdiggity.net/blog/2008/07/30/adobe-to-contribute-amf-support-to-zend-framework/feed/</wfw:commentRss>
		<slash:comments>0</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>
		<item>
		<title>Building Admin Tools With JavaScript and PHP</title>
		<link>http://bombdiggity.net/blog/2008/06/24/building-admin-tools-with-javascript/</link>
		<comments>http://bombdiggity.net/blog/2008/06/24/building-admin-tools-with-javascript/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 15:29:45 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[ExtJS]]></category>
		<category><![CDATA[IMS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Admin Tool]]></category>

		<guid isPermaLink="false">http://www.bombdiggity.net/blog/?p=22</guid>
		<description><![CDATA[So part of my job at the Indianapolis Motor Speedway is writing Admin Tools for our users to administer the sites with.  There are a mix of older admin tools which don't use any JavaScript and newer admin tools where the front end is completely based on JavaScript.

I was recently asked to build an admin tool to allow one of our users to maintain the drop down portions of the site navigation since they can change with each passing event that happens at the track. ]]></description>
			<content:encoded><![CDATA[<p>So part of my job at the Indianapolis Motor Speedway is writing Admin Tools for our users to administer the sites with.  There are a mix of older admin tools which don&#8217;t use any JavaScript and newer admin tools where the front end is completely based on JavaScript.</p>
<p>I was recently asked to build an admin tool to allow one of our users to maintain the drop down portions of the site navigation since they can change with each passing event that happens at the track. This presented the following problems:</p>
<ul class="arrowtick">
<li>Navigation is stored in a XML file</li>
<li>The navigation XML file is versioned with Subversion</li>
<li>The admin had to be easy to use.</li>
</ul>
<p>What I started with was trying to figure out the whole svn integration thing as I had to figure out a way to make sure that the working copy was always current and that when the user saved the navigation it did a commit on the file to that way it would always be the latest version in the repository.</p>
<p><strong>Problem 1:</strong> SVN does not allow you to checkout a single file to be a working copy.  I found this to be a problem as I didn&#8217;t want the whole directory, I just wanted the navigation.xml file.  I did some searching on the SVN bug tracker and found a <a title="SVN Checkout One File" href="http://subversion.tigris.org/nonav/issues/showattachment.cgi/621/svn-co-one-file" target="_blank">perl script</a> that David Kilzer wrote that allowed me to check out a single file.  Problem 1 is solved.</p>
<p>Once I got the file checked out into the working directory on the server i preceded to write a shell script that updated the file via an <strong>svn up</strong> command that would be ran on my fetch script before I read in the XML file to pass it back to the JavaScript.</p>
<p>Now that I have the XML back in my front end i can display it. Here is what the admin tools looks like when you have selected which site you want to edit.</p>
<p><a href="http://www.bombdiggity.net/blog/wp-content/uploads/2008/06/navigation_screen.jpg" rel="lightbox[22]"><img class="size-full wp-image-23" title="Navigation Admin" src="http://www.bombdiggity.net/blog/wp-content/uploads/2008/06/navigation_screen.jpg" alt="IMS Sites Navigation Admin" width="499" height="306" /></a></p>
<p>As you can see from the screen shot everything is layout in an easy to browse tree view.  You can move the child nodes around to order then or place them in any parent menu that you like.  There is a simple edit and add features.  The adding also incorporates a feature from our Site Pages admin that allows you to select from a page in there so you don&#8217;t have to copy and paste a link from the pages admin to this admin.</p>
<p>Once the user gets done with any changed they may have they can select the save button and that passes it back off to the PHP backend where it writes out the xml file and then does an <strong>svn ci</strong> on the file which places it back in the SVN repository and also promotes it to production via a set of PHP and bash scripts to interface with the SVN repository.</p>
<p>All in all using the <a title="ExtJS Library" href="http://extjs.com/">ExtJS Library</a> and PHP to build the admin tools for the IMS sites has dramiticly cut down on the time it takes to do everything since I have a very good understand of how everything in ExtJS works and when I don&#8217;t there is a great documentation resource out there.</p>
]]></content:encoded>
			<wfw:commentRss>http://bombdiggity.net/blog/2008/06/24/building-admin-tools-with-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
