Skip to content

Settings are not available when using sfNoCache #7

@petrica

Description

@petrica

The problem arose when I tried to call csSettings::get('particular_setting') from a symfony task that was not bind to any application. Because of this, the cache settings for the plugin where not loaded, the cache fall back to sfNoCache class.

The problem is related to the way the cache is build:

  • All the available settings are fetch from database
  • Settings are iterated and added to the cache object: $cache_handler->set('option', 'value'); And here is the problem, for sfNoCache object, the set method doesn't actually do anything and the $cache_handler object ends up empty.

Solution:
Provide a csStaticCache object that will cache (you've guessed it) statically all the available settings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions