Config_cache_enabled errors

Using Zend Framework 2.1

When I installed 'config_cache_enabled' => true

inside myapplication.config.php

It returns the following error:

Warning: var_export does not handle circular references in /usr/local/apache/vhosts/otwebsoft_admin/vendor/Zend/ModuleManager/Listener/AbstractListener.php on line 67

After several page refreshes, I get the following:

Fatal error: Call to undefined method Zend\Cache\Storage\Adapter\Apc::__set_state() in /usr/local/apache/vhosts/otwebsoft_admin/data/cache/module-config-cache.otwebsoft.php on line 181

Now I can see that the file is being generated on the server. Of course, setting the value back to false in the configuration removes all errors. But now we have a loss of caching functionality.

Yes, I am using an APC adapter for my cache.

Reading the PHP documentation recommends using serialization. So I looked at the source code and changed var_export to serialize and removed this error, but it returns the second error listed here.

Any ideas?

+3


source to share


1 answer


I finally figured it out. I don't know why it took me so long, but now it makes sense.

So the closure would be something like this:

'example' => factory()
{
    return new Example();
}

      

Where - how should I use (for example):



'example' => 'Module/Service/Example'

      

After I removed all locks, I can now use

'config_cache_enabled' => true

      

+2


source







All Articles