Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documenting adapter options #78

Open
froschdesign opened this issue Dec 13, 2023 · 2 comments
Open

Documenting adapter options #78

froschdesign opened this issue Dec 13, 2023 · 2 comments
Assignees
Labels
Documentation Question Further information is requested

Comments

@froschdesign
Copy link
Member

froschdesign commented Dec 13, 2023

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

/**
* Directory to store cache files
*
* @var string|null The cache directory
*/
private ?string $cacheDir = null;
/**
* Call clearstatcache enabled?
*/
private bool $clearStatCache = true;
/**
* How much sub-directaries should be created?
*/
private int $dirLevel = 1;
/**
* Permission creating new directories
*
* @var false|int
*/
private $dirPermission = 0700;
/**
* Lock files on writing
*/
private bool $fileLocking = true;
/**
* Permission creating new files
*
* @var false|int
*/
private $filePermission = 0600;
/**
* Overwrite default key pattern
*
* @var string
*/
protected $keyPattern = self::KEY_PATTERN;
/**
* Namespace separator
*/
private string $namespaceSeparator = '-';
/**
* Don't get 'fileatime' as 'atime' on metadata
*/
private bool $noAtime = true;
/**
* Don't get 'filectime' as 'ctime' on metadata
*/
private bool $noCtime = true;
/**
* Umask to create files and directories
*
* @var false|int
*/
private $umask = false;
/**
* Suffix for cache files
*/
private string $suffix = 'dat';
/**
* Suffix for tag files
*/
private string $tagSuffix = 'tag';

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

@froschdesign froschdesign added Documentation Question Further information is requested labels Dec 13, 2023
@boesing
Copy link
Member

boesing commented Jan 8, 2024

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
Copy link
Member Author

froschdesign commented Jan 10, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants