Skip to content

[Lock] FlockStore does not create the directory #35697

@nikophil

Description

@nikophil

Symfony version(s) affected: all

Description
The FlockStore does not create the directory if it does not exist.
I don't know if it is made on purpose...

When declaring the lock system with framework bundle:

# /packages/framework.yaml
framework:
    lock:
        file: 'flock://%kernel.project_dir%/var/lock'

This results in The directory "/path/to/var/lock" is not writable. althought the ./var directory is writable.
Why don't we check if the directory exists, and create it if it doesn't?

How to reproduce
Declare the lock with the given yaml, when directory ./var/lock does not exist.

Possible Solution
Create the directory if it doesn't exist, in the FlockStore constructor

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions