Skip to content

Ability to specify Twig cache directory #1605

@cezarykluczynski

Description

@cezarykluczynski

I would like to request a configurable Twig cache directory.

From what I understand, it's around here:

https://github.com/phpDocumentor/phpDocumentor2/blob/28441646799aee8dfe1d4cf41b670831fd59558f/src/phpDocumentor/Plugin/Twig/Writer/Twig.php#L145

that the Twig is initialized and the cache directory is set to the system directory.

However, I would like to have the ability to store Twig cache not higher than the project root directory, and certainly not in shared /tmp folder.

Would you consider adding this feature? If so, would a pull request be considered? If so, how would you approach the problem? A XML config example and a CLI param name would be enough to get me started.

I would go with something like

<?xml version="1.0" encoding="UTF-8" ?>
<phpdoc>
  <twig>
    <cache_folder>tmp/twig/cache</cache_folder>
  </twig>
</phpdoc>

And CLI:

vendor/bin/phpdoc --twig-cache-folder="tmp/twig/cache"

I assume folder should be created if it does not exist.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions