Skip to content

Questions about Rector's cache #6879

@ondrejmirtes

Description

@ondrejmirtes

Question

Hi, I've seen some mentions about cache in the source code, namely Option::CACHE_DIR and ChangedFilesDetector. I'd like to know what's the purpose of this cache? When does it get hit?

I'm asking because what I'd like to do is to have fast downgrade run when there are very little changes in the code. Because Rector mostly does the same thing over and over again.

So I'd like to have a cache where there's a structure like "path to file" => {original contents, downgraded contents}. When Rector runs, and sees that the file still has the original content, it doesn't have to execute all the expensive and slow logic, it can just replace the contents of the file with downgraded contents from the cache.

I can build it myself, I'd just like to know if there's something like that already in Rector, and how to use it.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions