2
votes

I am having some problem with cache registry. Here, how I configured cache

resources.cache.frontEnd = core
resources.cache.backEnd = file
resources.cache.frontEndOptions.lifetime = 1200
resources.cache.frontEndOptions.automatic_serialization = true
resources.cache.backEndOptions.lifetime = 3600
resources.cache.backEndOptions.cache_dir = APPLICATION_PATH "/../cache"

After any page I load I am receiving following error message

Fatal error: Uncaught exception 'Zend_Application_Bootstrap_Exception' with message 'Unable to resolve plugin "cache"; no corresponding plugin with that name' in C:\Zend\Apache2\htdocs\hotelrwanda\library\Zend\Application\Bootstrap\BootstrapAbstract.php:330 Stack trace: #0 C:\Zend\Apache2\htdocs\hotelrwanda\library\Zend\Application\Bootstrap\BootstrapAbstract.php(382): Zend_Application_Bootstrap_BootstrapAbstract->getPluginResource('cache')

1 C:\Zend\Apache2\htdocs\hotelrwanda\library\Zend\Application\Bootstrap\BootstrapAbstract.php(394):

Zend_Application_Bootstrap_BootstrapAbstract->getPluginResources() #2 C:\Zend\Apache2\htdocs\hotelrwanda\library\Zend\Application\Bootstrap\BootstrapAbstract.php(625): Zend_Application_Bootstrap_BootstrapAbstract->getPluginResourceNames()

3 C:\Zend\Apache2\htdocs\hotelrwanda\library\Zend\Application\Bootstrap\BootstrapAbstract.php(586):

Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap(NULL) #4 C:\Zend\Apache2\htdocs\hotelrwanda\library\Zend\Application.php(355): Zend_Applicatio in C:\Zend\Apache2\htdocs\hotelrwanda\library\Zend\Application\Bootstrap\BootstrapAbstract.php on line 330

I am sure that this is configuration problem. Can anyone help me to solve this problem?

3

3 Answers

2
votes

Try adding the following line to your config file, before your cache configuration :

pluginPaths.App_Application_Resource_ = App/Application/Resource

The error message means that Zend Framework cannot find a "cache" plugin.

0
votes

Error

The error means no "Cache.php" file can be found under the configured pluginPaths, either under the default directory "/library/Zend/Application/Resource" or the additional paths defined as pluginPaths in your configuration.

Solution

Most probably the pluginPaths in your configuration(application.ini) are not defined correctly or not at all. So the plugin cannot be found.

I have several pluginPaths defined and when I tried to clone the zend app I had to redefine these locations and I made a mistake at one of them which resulted at this error.

Resource plugins

In Zend 1, resource plugins are classes and most are defined in application.ini with their parameters. They are initiated when required by the application.

The default resource plugin path is /library/Zend/Application/Resource, additional plugin paths can be defined using:

pluginPaths.Custom_Resource_Path = "path/to/Resource"

Custom classes can be added under "path/to/Resource":

// path/to/Resource/Custom.php:
class Path_To_Resource_Custom extends Zend_Application_Resource_ResourceAbstract 
{
      public function setParam1($param1) {
          ...
      }
      public function init()
      {
          ...
      }

In application.ini, the configuration is added:

resources.custom.param1 = '...';
resources.custom.param2 = '...';

Also

  • by creating a class with the same name as a default resource in the above directory, e.g. Log.php, the default resource can be overridden.
  • default resources can be changed, e.g. resources.view.encoding = "UTF-8"