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

Remove fontCachePath from settings model #9

Merged
merged 1 commit into from Feb 4, 2022

Conversation

jakubjo
Copy link
Member

@jakubjo jakubjo commented Feb 4, 2022

The fontCachePath property is being removed from the Settings model.

The default directory where web fonts are cached is Craft::$app->path->getRuntimePath() . '/spfonts', which usually evaluates to storage/runtime/spfonts.

If you want to customize the directory you can do so by listening to the ResolveFontCachePathEvent event.
Set your custom path by setting the path property one the instance of ResolveFontCachePathEvent:

use alps\sharepreviews\events\ResolveFontCachePathEvent;
use alps\sharepreviews\services\FileHandler;
use yii\base\Event;

Event::on(FileHandler::class, FileHandler::EVENT_RESOLVE_FONT_CACHE_PATH, function(ResolveFontCachePathEvent $event) {
    $event->path = 'cache/fonts';
});

Thanks @andypullen for bringing this to my attention.

@jakubjo jakubjo merged commit 788f042 into master Feb 4, 2022
@jakubjo jakubjo deleted the fix-font-cache-path-resolution branch February 4, 2022 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant