Phoenix Business Technologies Group

Phoenix Business Technologies Group

See the construction of the SpringHill Suites Hotel - Mt. Lebanon  

Posts tagged "cache"

Symfony Cache GOTCHA

Posted by Jim Podroskey on 2009-07-15 tagged cache, symfony

If you're using Symfony's cache system, you may run into an issue where getViewCacheManager is returning null. This can represet its self in a few ways.

You might see something like:

Call to a member function remove() on a non-object in ...

if you're attempting to clear the cache from your model objects, for instance.

The reason this is happening is pretty silly, but it took me a few minutes to figure it out. sfContext::getViewCacheManager() will return null if caching isn't enabled in your settings for both your application and your environment.

This can be espicially annoying when you're working on a backend's dev environment and trying to clear the cache for things that happen on the frontend. Something like this is all you need to do. Remember to do it from the environment where you making the call to getViewCacheManager.

  6 dev:
  7   .settings:
  8     error_reporting:                                                         
  9     web_debug:              on
 10     cache:                  on   

Hope this saved someone some time!