title: How do you register Zend Framework plugins in application.ini?
body: <p>Currently plugins I write seem to work or not in random ways. Some do work, some don't, and some of them work part of the time, again with no obvious pattern. Even if all of the same are written and registered (apparently) in the same way. And I fail to find a proper documentation on where to put your plugins and how to register them in application.ini so I need to rely on examples I find in BLOGs or here. And chances are some of these examples assume things that may not be true in my code.</p>
  
  <p>So I just give a simple example, and if you could suggest how to make it work, and give links to good articles on ZF plugins, I'd highly appreciate that...</p>
  
  <p>Here's how I currently do things:</p>
  
  <p>Directory structure:</p>
  
  <pre><code>/library
     /Zend
     /Plugins
         Myplugin.php
  /applications
      /myApp
         /configs
            application.ini
         /modules
            /default
               /controllers
               /configs
               /views, etc
            /admin
               /controllers
               /configs
               /views, etc
         Bootstrap.php
  /public_html
     index.php
  </code></pre>
  
  <p>Myplugin.php contains one class:</p>
  
  <pre><code>Class Plugins_Myplugin extends Zend_Controller_Plugin_Abstract
  {
       public function init()
       {
            print 'If I can see this, it's finally working!';
       }
  }
  </code></pre>
  
  <p>application.ini relevant stuff looks like this:</p>
  
  <pre><code>includePaths.library = APPLICATION_PATH "/../../library"
  bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
  pluginpaths.plugins = "Plugins"
  resources.myplugin =
  resources.frontController.plugins.myplugin = Plugins_Myplugin
  ;//I assume Plugins_Myplugin should be resolved into library/Plugins/Myplugin.php with    class Plugins_Myplugin inside, given present configuration. Most likely I am wrong somewhere
  </code></pre>
  
  <p>And the most common error usually is:</p>
  
  <p><strong>Fatal error: Class 'Plugins_Myplugin' not found in /whatever/nevermind/domains/mydomain/library/Zend/Application/Resource/Frontcontroller.php on line 117</strong></p>
  
  <p>Sometimes it <em>is</em> found if I "register" it with just <em>resources.myplugin =</em>, omitting whole *resources.frontController.plugins.myplugin = Plugins_Myplugin* line. </p>
  
  <p>So apparently this is not the right way to register your plugins. What is wrong with this way, and what would be the good way (using application.ini)?</p>