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

PDP attempts to write to the vendor folder during cache purges #31

Closed
mattgrayisok opened this issue Feb 2, 2021 · 2 comments
Closed
Assignees

Comments

@mattgrayisok
Copy link

Currently PDP is being instantiated with default cache settings which is causing it to try to use the vendor folder as a cache directory. As it is generally best practice for the vendor folder to not be writable by the PHP user (other than during the installation process) this causes some issues when the vendor folder isn't writable. Specifically:

2021-02-02 11:17:34 [-][8596][64d388c3db444aaed528eb691057f9b5][error][InvalidArgumentException] InvalidArgumentException: cache path does not exist or is not writable: /var/www/html/vendor/jeremykendall/php-domain-parser/data in /var/www/html/vendor/jeremykendall/php-domain-parser/src/Cache.php:94

The PDP Cache class accepts a cache path as a parameter:

https://github.com/jeremykendall/php-domain-parser/blob/00000757d769931e876f9f6607b93c3db3464616/src/Cache.php#L82

This could be set to Craft's runtime cache directory in order to avoid the issue, and also it just feels nicer:

https://github.com/workingconcept/cloudflare-craft-plugin/blob/2048e6ac7725d7162f32288db4be6cf10296780f/src/helpers/UrlHelper.php#L99

Thanks 💪

@mattstein
Copy link
Contributor

Good idea, thanks @mattgrayisok! I’ll get this into a new release as soon as I can.

@mattstein mattstein self-assigned this Feb 2, 2021
@mattstein
Copy link
Contributor

Just tagged 1.0.1 which should do the trick!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants