<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Zend Framework: module specific frontcontroller plugins</title>
	<atom:link href="http://blog.vandenbos.org/2009/09/03/zend-framework-module-specific-frontcontroller-plugins/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.vandenbos.org/2009/09/03/zend-framework-module-specific-frontcontroller-plugins/</link>
	<description>Matthijs van den Bos&#039; thoughts on web development topics</description>
	<lastBuildDate>Tue, 13 Jul 2010 05:03:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: User_Friendly</title>
		<link>http://blog.vandenbos.org/2009/09/03/zend-framework-module-specific-frontcontroller-plugins/comment-page-1/#comment-1882</link>
		<dc:creator>User_Friendly</dc:creator>
		<pubDate>Wed, 02 Jun 2010 14:47:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vandenbos.org/?p=158#comment-1882</guid>
		<description>My solution, after reading this article and few others, was to subclass Zend_Application_Resource_Modules and override the init() method. Iterate through all modules, getting the options from the config files, merge them to the application&#039;s bootstrap options passing it as an array to setOptions(array($moduleName =&gt; $moduleOptions)). This is done before parent::init() so the bootstrap&#039;s options get updated before each module bootstrap, since all module bootstraps look for their configs inside the application&#039;s bootstrap configuration.</description>
		<content:encoded><![CDATA[<p>My solution, after reading this article and few others, was to subclass Zend_Application_Resource_Modules and override the init() method. Iterate through all modules, getting the options from the config files, merge them to the application&#8217;s bootstrap options passing it as an array to setOptions(array($moduleName =&gt; $moduleOptions)). This is done before parent::init() so the bootstrap&#8217;s options get updated before each module bootstrap, since all module bootstraps look for their configs inside the application&#8217;s bootstrap configuration.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mike</title>
		<link>http://blog.vandenbos.org/2009/09/03/zend-framework-module-specific-frontcontroller-plugins/comment-page-1/#comment-1867</link>
		<dc:creator>mike</dc:creator>
		<pubDate>Thu, 25 Mar 2010 21:14:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vandenbos.org/?p=158#comment-1867</guid>
		<description>This didn&#039;t work for me either until I made the following modifications:

1. Make sure you&#039;ve created a bootstrap class for your module extending from Zend_Application_Module_Bootstrap.

2. Modify Rexus_Application_Resource_Moduleplugins replacing the foreach loop in init() with the following code:

        $bootstrap = $this-&gt;getBootstrap();

        if ($bootstrap instanceof Zend_Application_Module_Bootstrap) {
            foreach ($options as $pluginName) {

                $pluginLoader-&gt;registerFrontControllerPlugin(
                    strtolower($this-&gt;getBootstrap()-&gt;getModuleName()), $pluginName);
            }
        }

The problem is the code is expecting a getModuleName method on all the bootstrap classes (including the default), but this method only exists on Zend_Application_Module_Bootstrap.</description>
		<content:encoded><![CDATA[<p>This didn&#8217;t work for me either until I made the following modifications:</p>
<p>1. Make sure you&#8217;ve created a bootstrap class for your module extending from Zend_Application_Module_Bootstrap.</p>
<p>2. Modify Rexus_Application_Resource_Moduleplugins replacing the foreach loop in init() with the following code:</p>
<p>        $bootstrap = $this-&gt;getBootstrap();</p>
<p>        if ($bootstrap instanceof Zend_Application_Module_Bootstrap) {<br />
            foreach ($options as $pluginName) {</p>
<p>                $pluginLoader-&gt;registerFrontControllerPlugin(<br />
                    strtolower($this-&gt;getBootstrap()-&gt;getModuleName()), $pluginName);<br />
            }<br />
        }</p>
<p>The problem is the code is expecting a getModuleName method on all the bootstrap classes (including the default), but this method only exists on Zend_Application_Module_Bootstrap.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: musca ilie</title>
		<link>http://blog.vandenbos.org/2009/09/03/zend-framework-module-specific-frontcontroller-plugins/comment-page-1/#comment-1861</link>
		<dc:creator>musca ilie</dc:creator>
		<pubDate>Sat, 09 Jan 2010 21:06:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vandenbos.org/?p=158#comment-1861</guid>
		<description>ok, i managed to load the moduleplugins resource.

using ZF 1.9 the class Rexus_Application_Resource_Moduleplugins doesn&#039;t work at all..

php crashes because of this line $this-&gt;getBootstrap()-&gt;getModuleName()</description>
		<content:encoded><![CDATA[<p>ok, i managed to load the moduleplugins resource.</p>
<p>using ZF 1.9 the class Rexus_Application_Resource_Moduleplugins doesn&#8217;t work at all..</p>
<p>php crashes because of this line $this-&gt;getBootstrap()-&gt;getModuleName()</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: musca ilie</title>
		<link>http://blog.vandenbos.org/2009/09/03/zend-framework-module-specific-frontcontroller-plugins/comment-page-1/#comment-1860</link>
		<dc:creator>musca ilie</dc:creator>
		<pubDate>Sat, 09 Jan 2010 20:29:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vandenbos.org/?p=158#comment-1860</guid>
		<description>i subscribe to what leon said.. how do I load the Rexus_Application_Resource_Moduleplugins ?

apache crashes if i use only the code above.. something is missing</description>
		<content:encoded><![CDATA[<p>i subscribe to what leon said.. how do I load the Rexus_Application_Resource_Moduleplugins ?</p>
<p>apache crashes if i use only the code above.. something is missing</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: leon</title>
		<link>http://blog.vandenbos.org/2009/09/03/zend-framework-module-specific-frontcontroller-plugins/comment-page-1/#comment-1848</link>
		<dc:creator>leon</dc:creator>
		<pubDate>Mon, 07 Dec 2009 10:53:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vandenbos.org/?p=158#comment-1848</guid>
		<description>Just in case, this is how I got around the module specific loading of an authentication mechanism:

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
    protected function _initAuth()
    {
        $frontController = $this-&gt;bootstrap(&#039;frontController&#039;)-&gt;frontController;
        $frontController-&gt;registerPlugin(new Cantah_Controller_Plugin_Auth(array(&#039;modules&#039;=&gt;&#039;admin&#039;)));
    }

Then in the preDispatch of the Cantah_Controller_Plugin_Auth plugin I check if a module is set, and if the module is admin, do the appropriate Zend_Auth checking.</description>
		<content:encoded><![CDATA[<p>Just in case, this is how I got around the module specific loading of an authentication mechanism:</p>
<p>class Bootstrap extends Zend_Application_Bootstrap_Bootstrap<br />
{<br />
    protected function _initAuth()<br />
    {<br />
        $frontController = $this-&gt;bootstrap(&#8216;frontController&#8217;)-&gt;frontController;<br />
        $frontController-&gt;registerPlugin(new Cantah_Controller_Plugin_Auth(array(&#8216;modules&#8217;=&gt;&#8217;admin&#8217;)));<br />
    }</p>
<p>Then in the preDispatch of the Cantah_Controller_Plugin_Auth plugin I check if a module is set, and if the module is admin, do the appropriate Zend_Auth checking.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: leon</title>
		<link>http://blog.vandenbos.org/2009/09/03/zend-framework-module-specific-frontcontroller-plugins/comment-page-1/#comment-1847</link>
		<dc:creator>leon</dc:creator>
		<pubDate>Mon, 07 Dec 2009 10:50:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vandenbos.org/?p=158#comment-1847</guid>
		<description>I&#039;m not too sure how you load Rexus_Application_Resource_Moduleplugins, is it in the application.ini?</description>
		<content:encoded><![CDATA[<p>I&#8217;m not too sure how you load Rexus_Application_Resource_Moduleplugins, is it in the application.ini?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ade</title>
		<link>http://blog.vandenbos.org/2009/09/03/zend-framework-module-specific-frontcontroller-plugins/comment-page-1/#comment-1755</link>
		<dc:creator>ade</dc:creator>
		<pubDate>Fri, 02 Oct 2009 12:55:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vandenbos.org/?p=158#comment-1755</guid>
		<description>Where is the class &quot;Rexus_Controller_Plugin_Authentication&quot; ? Thanks.</description>
		<content:encoded><![CDATA[<p>Where is the class &#8220;Rexus_Controller_Plugin_Authentication&#8221; ? Thanks.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
