Development

#2098 (sfSQLiteCache cannot take "cacheDir" as an option)

You must first sign up to be able to contribute.

Ticket #2098 (closed defect: fixed)

Opened 1 year ago

Last modified 3 months ago

sfSQLiteCache cannot take "cacheDir" as an option

Reported by: Rihad.Haciyev Assigned to: Symfony crew
Priority: major Milestone:
Component: configuration Version: 1.0.5
Keywords: Cc:
Qualification: Unreviewed

Description

%SF_DATA_DIR%/config/factories.yml has

default:
 view_cache:
    class: sfFileCache
    param:
      automaticCleaningFactor: 0
      cacheDir:                %SF_TEMPLATE_CACHE_DIR%

my config/factories.yml has

all:
  view_cache:
    class: sfSQLiteCache
    param:
      automaticCleaningFactor: 0
#      cacheDir:                %SF_TEMPLATE_CACHE_DIR%

Error: sfSQLiteCache cannot take "cacheDir" as an option

This, and all other bugs, are embarrassing! Why not first take Symfony out of its pre-alpha stage, then advertise it claiming support of its many unrivaled features!! :-(((

Change History

08/15/07 21:53:05 changed by l2k

Hey, it's open and it's free. If you don't like it the way it is, just change it... :)

08/16/07 07:32:29 changed by Rihad.Haciyev

Yeah, understand me as a user too! Symfony's is trying to be very flexible and I really like parts of it, but shortcomings like this (inability to fully override global settings) make you bang your head on the wall in despair.

A second set of configuration files is in the symfony installation directory (in $sf_symfony_ data_dir/config/) and doesn't appear in the configuration directory of your applications. The settings defined there are defaults that seldom need to be modified, or that are global to all projects. However, if you need to modify them, just create an empty file with the same name in your myproject/apps/myapp/config/ directory, and override the settings you want to change.

(taken from here)

08/17/07 08:16:59 changed by fabien

  • status changed from new to closed.
  • resolution set to invalid.

Short answer: RTFM or read the API. Your answer IS in the book (see chapter 18) AND in the API.

Long answer:

    view_cache:
      class: sfSQLiteCache
      param:
        database: %SF_TEMPLATE_CACHE_DIR%/cache.db

The database parameter takes an absolute path, so there is no need for a cacheDir parameter as for the sfFileCache class.

08/17/07 09:05:26 changed by Rihad.Haciyev

  • status changed from closed to reopened.
  • resolution deleted.

I didn't make it clear: there's nothing wrong with sfSqliteCache supporting or not supporting this option or another, it's that the way YAML handling is currently implemented in Syfmony does not allow getting rid of a setting as if it weren't there (cacheDir in my example).

I'm going to once again reopen this ticket. Close it if you must, and I won't touch it again because I think I've now clearly stated the overall YAML handling problem.

08/17/07 10:36:41 changed by l2k

08/17/07 11:33:20 changed by Rihad.Haciyev

Exactly, it would take a newcomer to dig in current handling of YAML configs to realize that they're the same problem, no matter whether dealing with "user" arrays or "sections" - they both end up being PHP arrays, and it's impossible to turn off their keys once set. Of course not unless Fabien takes the patch at the link you gave as the start of handling the bug :-)

l2k: if you feel the different use case doesn't warrant duplicating the report of a bug at its core, please feel free to close it.

06/23/08 06:50:57 changed by dwhittle

  • status changed from reopened to closed.
  • resolution set to fixed.
  • qualification set to Unreviewed.