nikic / FastRoute

Fast request router for PHP
Other
5.12k stars 445 forks source link

Must specify "cacheKey" option #245

Closed enobrev closed 3 years ago

enobrev commented 3 years ago

It's unclear why a cacheKey is required to the point of throwing an exception. Could there not be a default cacheKey?

https://github.com/nikic/FastRoute/blob/2230b97550f2d18c35c0ab1fc7ba32613381cd05/src/functions.php#L51-L53

Also, this is a regression I noticed from updating the latest version. I'm not sure what I was on previously.

enobrev commented 3 years ago

This requirement also is not expressed in the Caching section of the Readme

lcobucci commented 3 years ago

@enobrev if cache is enabled, you must specify the path to the file you want the cache to be stored.

We can't define a default in the library as it depends on why driver you have configured.

This code hasn't been tagged yet. This is not a regression, just a conscious BC-breakage (the main branch is scheduled to be the next major release).

enobrev commented 3 years ago

@lcobucci Thank you, but this issue is not regarding the cacheFile option, which is documented, but rather the cacheKey option, which is not.

lcobucci commented 3 years ago

@enobrev cacheFile will become cacheKey in the next major release which still not released, migration path to be created, and things to be documented.