<?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>gog&#039;s info &#187; Zend Framework</title>
	<atom:link href="http://gogs.info/category/zend-framework/feed/" rel="self" type="application/rss+xml" />
	<link>http://gogs.info</link>
	<description></description>
	<lastBuildDate>Wed, 27 Apr 2011 15:02:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Give your .02$ to the ZF project</title>
		<link>http://gogs.info/2009/12/give-your-02-to-the-zf-project/</link>
		<comments>http://gogs.info/2009/12/give-your-02-to-the-zf-project/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 01:23:35 +0000</pubDate>
		<dc:creator>Goran Jurić</dc:creator>
				<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[zf]]></category>

		<guid isPermaLink="false">http://gogs.info/?p=101</guid>
		<description><![CDATA[Zend Framework project is about to start working on the 2.0 version. If you are using ZF in your projects, but you are not interested in contributing ideas to the project by joining the zf-contributors mailing list, the least you could do is provide feedback about your ZF experience by answering a survey. You can [...]]]></description>
			<content:encoded><![CDATA[<p>Zend Framework project is about to start working on the 2.0 version. If you are using ZF in your projects, but you are not interested in contributing ideas to the project by joining the zf-contributors mailing list, the least you could do is provide feedback about your ZF experience by answering a <a href="http://bit.ly/65khf8">survey</a>.</p>
<p>You can find more info at the <a href="http://devzone.zend.com/article/11485-Zend-Framework-Survey-for-2009">devzone</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://gogs.info/2009/12/give-your-02-to-the-zf-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding filters automatically to your Zend_Form_Element_Text objects</title>
		<link>http://gogs.info/2009/05/adding-filters-automatically-to-your-zend_form_element_text-objects/</link>
		<comments>http://gogs.info/2009/05/adding-filters-automatically-to-your-zend_form_element_text-objects/#comments</comments>
		<pubDate>Mon, 18 May 2009 08:33:59 +0000</pubDate>
		<dc:creator>Goran Jurić</dc:creator>
				<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://gogs.info/?p=58</guid>
		<description><![CDATA[Although you can create a custom form element as described in ZF manual and set the properties for all instances of this element I really did not like this solution since my application already has a lot of already working forms. I wanted to add the Zend_Filter_StringTrim filter to all of my text form elements [...]]]></description>
			<content:encoded><![CDATA[<p>Although you can create a custom form element as described in <a href="http://framework.zend.com/manual/en/zend.form.elements.html#zend.form.elements.custom">ZF manual</a> and set the properties for all instances of this element I really did not like this solution since my application already has a lot of already working forms.</p>
<p>I wanted to add the Zend_Filter_StringTrim filter to all of my text form elements so I decided to just add them on the fly.</p>
<p>Since my forms already extend a custom &#8220;MyApp_Form&#8221; object (MyApp_Form extend Zend_Form) it was just a matter of intercepting the addElement() method.</p>
<p>So, here it goes, in all its glory:</p>
<pre class="php"><span class="kw2">public</span> <span class="kw2">function</span> addElement<span class="br0">&#40;</span><span class="re0">$element</span><span class="sy0">,</span> <span class="re0">$name</span> <span class="sy0">=</span> <span class="kw4">null</span><span class="sy0">,</span> <span class="re0">$options</span> <span class="sy0">=</span> <span class="kw4">null</span><span class="br0">&#41;</span>
<span class="br0">&#123;</span>
    parent<span class="sy0">::</span><span class="me2">addElement</span><span class="br0">&#40;</span><span class="re0">$element</span><span class="sy0">,</span> <span class="re0">$name</span><span class="sy0">,</span> <span class="re0">$options</span><span class="br0">&#41;</span><span class="sy0">;</span>

    <span class="kw1">if</span> <span class="br0">&#40;</span><span class="kw3">is_null</span><span class="br0">&#40;</span><span class="re0">$name</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
        <span class="re0">$name</span> <span class="sy0">=</span> <span class="re0">$element</span><span class="sy0">-&gt;</span><span class="me1">getName</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="br0">&#125;</span>

    <span class="re0">$addedElement</span> <span class="sy0">=</span> <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">getElement</span><span class="br0">&#40;</span><span class="re0">$name</span><span class="br0">&#41;</span><span class="sy0">;</span>

    <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$addedElement</span> instanceof Zend_Form_Element_Text<span class="br0">&#41;</span> <span class="br0">&#123;</span>
        <span class="kw1">if</span> <span class="br0">&#40;</span> <span class="sy0">!</span> <span class="re0">$addedElement</span><span class="sy0">-&gt;</span><span class="me1">getFilter</span><span class="br0">&#40;</span><span class="st_h">'StringTrim'</span><span class="br0">&#41;</span> instanceof Zend_Filter_Interface <span class="br0">&#41;</span> <span class="br0">&#123;</span>
            <span class="re0">$addedElement</span><span class="sy0">-&gt;</span><span class="me1">addFilter</span><span class="br0">&#40;</span><span class="kw2">new</span> Zend_Filter_StringTrim<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
        <span class="br0">&#125;</span>
    <span class="br0">&#125;</span>
<span class="br0">&#125;</span></pre>
<p>Since the element is already added to the form using the parent method I didn&#8217;t have to check if the element is passed as a string, but does not have a name, or if it&#8217;s passed as a Zend_Form_Element object without the name property since the Zend_Form::addElement() already checks for this.</p>
]]></content:encoded>
			<wfw:commentRss>http://gogs.info/2009/05/adding-filters-automatically-to-your-zend_form_element_text-objects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Framework 1.8</title>
		<link>http://gogs.info/2009/05/zend-framework-18/</link>
		<comments>http://gogs.info/2009/05/zend-framework-18/#comments</comments>
		<pubDate>Sat, 02 May 2009 23:03:28 +0000</pubDate>
		<dc:creator>Goran Jurić</dc:creator>
				<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://gogs.info/?p=49</guid>
		<description><![CDATA[Yesterday Zend Framework 1.8 was released and since I was ill and didn&#8217;t have much else to do I decided to have a look and make necessary changes to port our company CMS to the new version. The new autoloader Zend_Loader_Autoloader is just what I was looking for to easily group the forms and models [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday Zend Framework 1.8 was released and since I was ill and didn&#8217;t have much else to do I decided to have a look and make necessary changes to port our company CMS to the new version.</p>
<p>The new autoloader Zend_Loader_Autoloader is just what I was looking for to easily group the forms and models with my application modules. I definitively recommend to read a great article about the new autoloader at <a href="http://devzone.zend.com/article/4525-Developing-a-Comprehensive-Autoloader">Zend Developer Zone</a>.</p>
<p>The whole process of migrating from ZF 1.7.7 was quite painless I just had to replace:</p>
<pre class="phpcode"><span style="color: #0000bb;">Zend_Loader</span><span style="color: #007700;">::</span><span style="color: #0000bb;">registerAutoload();</span></pre>
<p>with</p>
<pre><span style="color: #0000bb;">$loader </span><span style="color: #007700;">= </span><span style="color: #0000bb;">Zend_Loader_Autoloader</span><span style="color: #007700;">::</span><span style="color: #0000bb;">getInstance</span><span style="color: #007700;">();
</span><span style="color: #0000bb;">$loader</span><span style="color: #007700;">-&gt;</span><span style="color: #0000bb;">registerNamespace</span><span style="color: #007700;">(</span><span style="color: #dd0000;">'MyApp_'</span><span style="color: #007700;">);
</span></pre>
<p>Zend_Log_Writer_Mail is finally in the stable distribution and It took only couple of lines of code to add this to our application logger so now when stuff go terribly wrong I at least know I will be getting an email about it.</p>
<p>You can view the full list of changes in the 1.8 release <a href="http://devzone.zend.com/article/4524-Zend-Framework-1.8.0-Released">here</a>.</p>
<p>I look forward to playing with Zend_Navigation and see if we how could we use it to cleanup some of the mumbo-jumbo we are currently doing with ACLs and navigational elements.</p>
<p>Zend_Validate_Db_RecordExists doesn&#8217;t look like much, but it makes me happy to remove some custom code because it is now supported in the framework.</p>
]]></content:encoded>
			<wfw:commentRss>http://gogs.info/2009/05/zend-framework-18/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Removing require_once() calls from Zend Framework</title>
		<link>http://gogs.info/2008/10/removing-require_once-calls-from-zend-framework/</link>
		<comments>http://gogs.info/2008/10/removing-require_once-calls-from-zend-framework/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 22:39:29 +0000</pubDate>
		<dc:creator>Goran Jurić</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Optimization]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://gogs.info/?p=44</guid>
		<description><![CDATA[If you are using Zend_Loader to load your classes in Zend Framework, there is no need for all the require_once() calls that are littered all over ZF files. Some acctually report big improvements in responsiveness of their applications and increase in number of transactions per second their hardware can handle because require_once() is quite an [...]]]></description>
			<content:encoded><![CDATA[<p>If you are using Zend_Loader to load your classes in Zend Framework, there is no need for all the require_once() calls that are littered all over ZF files.</p>
<p><a href="http://www.whitewashing.de/blog/articles/73">Some acctually report big improvements</a> in responsiveness of their applications and increase in number of transactions per second their hardware can handle because require_once() is quite an expensive operation, especially if the required file is already included prior to the call.<span id="more-44"></span></p>
<p>If you are wondering how to comment out all the require_once() calls from your <span><span>Zend</span></span> Framework without doing it by hand here is the solution. Navigate to the folder where your installation of ZF resides on the server and just enter this into your shell:</p>
<pre><span style="text-decoration: line-through;">find ./ -type f -exec <span><span>sed</span></span> -i 's/require_once/\/\/require_once/' {} \;</span></pre>
<p>My box is running PHP 5.2.6 with APC 3.0.19 and Zend Framework 1.7 PR and my include path is optimized for use with ZF. Stripping require_once() calls didn&#8217;t make a drastic impact on my setup and average performance gain was around 3 requests per second (from 63 to 66).</p>
<h3>Update (May 16, 2009)</h3>
<p>Since the release of Zend Framework 1.8 there is a script to strip requre_once calls from ZF in the <a href="http://framework.zend.com/manual/en/performance.classloading.html#performance.classloading.striprequires">ZF Performance guide</a>. This script does not remove require_once calls to the new Zend_Loader_Autoloader component.</p>
<pre>% cd path/to/ZendFramework/library
% <span style="text-decoration: line-through;">find . -name '*.php' -not -wholename '*/Loader/Autoloader.php' -print0 | \
xargs -0 sed --regexp-extended --in-place 's/(require_once)/\/\/ \1/g'</span></pre>
<h3>Update 2 (October 3, 2010)</h3>
<p>Thanks to Tom Anderson for noticing that this does not work since ZF 1.10.8 , the new script for stripping require_once calls is:</p>
<pre>% cd path/to/ZendFramework/library
% find . -name '*.php' -not -wholename '*/Loader/Autoloader.php' \
-not -wholename '*/Application.php' -print0 | \
xargs -0 sed --regexp-extended --in-place 's/(require_once)/\/\/ \1/g'</pre>
<p>Note that you must use autoloading if you strip the require_once from the ZF project.</p>
]]></content:encoded>
			<wfw:commentRss>http://gogs.info/2008/10/removing-require_once-calls-from-zend-framework/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>&#8220;Benchmarking&#8221; PHP frameworks</title>
		<link>http://gogs.info/2008/08/benchmarking-php-frameworks/</link>
		<comments>http://gogs.info/2008/08/benchmarking-php-frameworks/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 13:55:22 +0000</pubDate>
		<dc:creator>Goran Jurić</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[Frameworks]]></category>

		<guid isPermaLink="false">http://gogs.info/?p=7</guid>
		<description><![CDATA[Although I am not a Drupal user, the chance to visit Drupalcon in Szeged (Hungary) appeared and I couldn&#8217;t pass on that one. We got there a little bit late, but just in time to hear Rasmus Lerdorfs keynote speech Simple is Hard. There are some really good ideas for optimizing your applications performance and [...]]]></description>
			<content:encoded><![CDATA[<p>Although I am not a <a href="http://drupal.org">Drupal</a> user, the chance to visit <a href="http://szeged2008.drupalcon.org/">Drupalcon in Szeged</a> (Hungary) appeared and I couldn&#8217;t pass on that one. We got there a little bit late, but just in time to hear <a href="http://lerdorf.com/bio.php">Rasmus Lerdorfs</a> keynote speech <a href="http://talks.php.net/show/drupal08">Simple is Hard</a>. There are some really good ideas for optimizing your applications performance and I strongly recommend it for every PHP developer.</p>
<p>There were also some things I really don&#8217;t agree that much. He showed a small PHP frameworks &#8220;benchmark&#8221; measuring the speed (response time and transactions per second) for each of this frameworks to output the simple HTML page printing out the &#8220;Hello world&#8221; string. <a href="http://framework.zend.com/">Zend Framework</a> (the framework of my choice) didn&#8217;t perform all that bad. <a href="http://www.symfony-project.org/">Symfony</a> was around 30% slower, and <a href="http://solarphp.com/">Solar</a> was about 2 times faster. If you are really interested in the numbers have a look at the <a href="http://talks.php.net/show/drupal08">slides from the session</a>.</p>
<p><span id="more-7"></span></p>
<p>The methodology was a little bit questionable. I believe that frameworks offering a caching solution out of the boxes should have been tested with the caching enabled.</p>
<p>Another thing he talked about was removing unnecessary require_once() and include_once() calls from the applications, and their impact on the frameworks speed, and how those calls are handled in PHP internally and how to set up your include path to minimize the impact).</p>
<p>Zend Framework didn&#8217;t do that well, as you can see on the graphs plotted out for every framework (dashed lines represent require_once() calls). The main reason for this is I guess that ZF is a loosely coupled framework. The other reason is probably that the ZF is still not mature enough to focus on the optimization issues while there is still so much other work to be done.</p>
]]></content:encoded>
			<wfw:commentRss>http://gogs.info/2008/08/benchmarking-php-frameworks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

