sunspikes / php-ratelimiter

A framework independent rate limiter for PHP
MIT License
66 stars 12 forks source link

Colons in filenames #15

Open noahheck opened 2 years ago

noahheck commented 2 years ago

We have a development team hosting VMs on a Windows system with source files shared across a VirtualBox shared folder. The naming convention for cache files across that share are not valid because they contain the colon (:) character as part of the filename key (e.g., :hits or :time ). Keys are established as Class Constants (e.g., https://github.com/sunspikes/php-ratelimiter/blob/master/src/Throttle/Throttler/FixedWindowThrottler.php#L32).

Microsoft docs (https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file) show a set of invalid filename characters, including the following:

Can we update the key names to not include any reserved characters? My suggestion would be to use the _ (underscore) character for separation of the filename components, but I'm open for suggestions.

I'm happy to do this work and submit it back if it will be accepted.

sunspikes commented 2 years ago

Hello @noahheck really sorry that i missed this issue, sure you can submit a PR if you still have those changes