-
-
Notifications
You must be signed in to change notification settings - Fork 128
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
Cache throws when cache directory doesn't exists #280
Comments
@nicolasmilville thanks for using the library your issue raises a couple of questions that may lead or not in more complex resolution. First and foremost even if it is not stressed enough in the documentation the cache system shipped with this package is optional . And I'll be honest I'm thinking of removing it from the package and create an optional package just for caching both external databases. Second, the reason the directory was made empty in 5.7 was to force users to either create their own cache strategy but also to avoid the unnecessary security fix to only update the cache when a composer call is made. As a matter of fact I now think that tying the local cache update to composer lifecycle was a bad idea. Last but not least currently I believe the current Cache class does a check on the directory presence and tries to create it if it does not exists see https://github.com/jeremykendall/php-domain-parser/blob/develop/src/Cache.php#L82-L98 So we all that being said I think your real issue "no pun intended" is that in your settings the PHP function I would suggest you implement an alternative caching system like explain in the documentation |
Yes I saw this and have already fixed this issue on my side by replacing your optional cache system by Symfony FileSystem simple cache implementation ;) I just reported this for potential peoples affected by same issue.
Hum, are you sure about this ? When reading manual of Maybe you can transform :
to :
In this case, Thanks for answer ! |
@nicolasmilville indeed that could be a quick/easy fix. I'll try to update that line and release a 5.7.1 |
…alisation #280 bug fix cache throws when default cache directory is not present
I'll close the issue as the patch has landed on the develop branch. Expect a new release later today |
Issue summary
Since 5.7 version we encounter new issue with
Cache
class. In 5.6 version,data
directory was filled with two data files. In new version of package, this directory only contains empty.gitignore
file.This change can impact users who are hosted on AWS and use CodeDeploy. CodeDeploy has an
--ignore-hidden-files
flag which is very usefull to reduce deployment artifacts size... In my case, deployment artifact size is multiplied by 8 without this flag. See https://docs.aws.amazon.com/cli/latest/reference/deploy/push.html for more informations.With this flag,
data
file won't be created and leads to aTypeError
when using Cache. See exception:Proposal
We can maybe test if
data
directory exists and if it's not the case, create it to avoid this exception ?System informations
Expected result
No exception
Actual result
The text was updated successfully, but these errors were encountered: