ProfessionalWiki / ExternalContent

MediaWiki extension that allows embedding external content
https://professional.wiki/en/news/external-content
GNU General Public License v2.0
7 stars 4 forks source link

Use a directory outside vendor for caching #63

Open kghbln opened 6 months ago

kghbln commented 6 months ago

Setup

Issue

On https://sandbox.semantic-mediawiki.net/wiki/README_-_Semantic_MediaWiki I got:

 Warning: Directory /../w/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer not writable. in /../w/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer.php on line 298

The issue disappears when the directory is made writable for the webserver. For caching, a directory outside of the vendor is preferable.

Is this an upstream issue?

malberts commented 6 months ago

It's documented upstream: https://github.com/ezyang/htmlpurifier/blob/d9fbef8e27f6a0848a8987a8534351de98eb0fa1/INSTALL#L265-L299

There is a documented way to change the cache directory and it can probably be done here: https://github.com/ProfessionalWiki/ExternalContent/blob/81b5c99bc76f1c2ee0ba46d9e9053e39f2515a92/src/Domain/ContentRenderer/ContentPurifier.php#L29-L36

kghbln commented 6 months ago

It will be beneficial to tell External Content where to place the cache files via a config parameter.