8000 How to get the modification/creation time from a cache entry? · Issue #21275 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content 10000
How to get the modification/creation time from a cache entry? #21275
Closed
@stephan-v

Description

@stephan-v
Q A
Bug report? no
Feature request? no
BC Break report? no
RFC? no
Symfony version x.y.z

Hi,

I have a question about using the symfony cache component in a project of mine.

I am using the YAML decoder to decode a YAML file of mine to a PHP array. In turn, this php array is being used as the value for a cache entry with the Symfony cache component.

It all works perfectly fine. The problem is that I need update the cache entry when my YAML file has been changed. To do this I need to get the last modification time from the cache entry and compare it to that of my YAML file.

Currently I don't see any method to get a creation of modification timestamp. I however do see a creation timestamp on my cache entry, similar to this:

1515867059
<CacheEntryName>
<SerializedData>

Getting a modification time would be something that could prove extremely helpful. Is there any way to solve my problem with the current Symfony cache implemtation?

If I could get the absolute cache path from the cache item I could also get the modification time myself, but I also do not see any method for this.

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

      0