laminas / laminas-cache-storage-adapter-filesystem

BSD 3-Clause "New" or "Revised" License
7 stars 15 forks source link

Documenting adapter options #78

Open froschdesign opened 10 months ago

froschdesign commented 10 months ago

To document the adapter options, I have tried to extract the properties of the option class via script.

Here is a first result:

Option Name Description Type Default Value
cache_dir Directory to store cache files string The cache directory null
clear_stat_cache Call clearstatcache enabled? bool true
dir_level How much sub-directaries should be created? int 1
dir_permission Permission creating new directories false\|int 0700
file_locking Lock files on writing bool true
file_permission Permission creating new files false\|int 0600
key_pattern Overwrite default key pattern string /^[a-z0-9_\+\-]*$/Di
namespace_separator Namespace separator string -
no_atime Don't get 'fileatime' as 'atime' on metadata bool true
no_ctime Don't get 'filectime' as 'ctime' on metadata bool true
umask Umask to create files and directories false\|int false
suffix Suffix for cache files string dat
tag_suffix Suffix for tag files string tag

https://github.com/laminas/laminas-cache-storage-adapter-filesystem/blob/d78283f47a7d0fd3968c63836ee2805b53bff06f/src/FilesystemOptions.php#L29-L102

@boesing The DocBlocks might need to be extended, but would this be a viable solution? Would all options then be included?

boesing commented 9 months ago

I assume, yes. That would work.

At least all options are listed. How do you detect the options class? There are repositories with more than one option class, i.e.:

https://github.com/laminas/laminas-cache-storage-adapter-redis/blob/2.8.x/src/RedisClusterOptions.php https://github.com/laminas/laminas-cache-storage-adapter-redis/blob/2.8.x/src/RedisOptions.php

froschdesign commented 9 months ago

How do you detect the options class?

At the moment by hand, because the current goal is that the writer does not have to copy and paste the options. But each option must be listed in the documentation. (The goal is not to automate to the entire process!)

There are repositories with more than one option class, i.e.:

Good to know. Thanks for the hint!