-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathomnipedia_pwa.module
46 lines (35 loc) · 985 Bytes
/
omnipedia_pwa.module
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php declare(strict_types=1);
use Drupal\Core\Cache\CacheableMetadata;
/**
* Implements \hook_pwa_cache_urls_alter().
*/
function omnipedia_pwa_pwa_cache_urls_alter(
array &$urls, CacheableMetadata &$cacheableMetadata
): void {
\Drupal::service('omnipedia_pwa.content')->alterCacheUrls(
$urls, $cacheableMetadata
);
\Drupal::service('omnipedia_pwa.media')->alterCacheUrls(
$urls, $cacheableMetadata
);
}
/**
* Implements \hook_pwa_exclude_urls_alter().
*/
function omnipedia_pwa_pwa_exclude_urls_alter(
array &$urls, CacheableMetadata &$cacheableMetadata
): void {
\Drupal::service('omnipedia_pwa.content')->alterExcludeUrls(
$urls, $cacheableMetadata
);
}
/**
* Implements \hook_pwa_cache_urls_assets_page_alter().
*/
function omnipedia_pwa_pwa_cache_urls_assets_page_alter(
array &$urls, string $pageUrl, \DOMXPath $xpath
): void {
\Drupal::service('omnipedia_pwa.media')->alterPageAssetCacheUrls(
$urls, $pageUrl, $xpath
);
}