-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathProxyCacheWarmer.php
More file actions
57 lines (48 loc) · 1.7 KB
/
Copy pathProxyCacheWarmer.php
File metadata and controls
57 lines (48 loc) · 1.7 KB
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
47
48
49
50
51
52
53
54
55
56
57
<?php
/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);
namespace Ibexa\Bundle\Core\Cache\Warmer;
use Ibexa\Contracts\Core\Repository\Values\Content\Content;
use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo;
use Ibexa\Contracts\Core\Repository\Values\Content\Language;
use Ibexa\Contracts\Core\Repository\Values\Content\Location;
use Ibexa\Contracts\Core\Repository\Values\Content\Section;
use Ibexa\Contracts\Core\Repository\Values\Content\Thumbnail;
use Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType;
use Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeGroup;
use Ibexa\Contracts\Core\Repository\Values\User\User;
use Ibexa\Core\Repository\ProxyFactory\ProxyGeneratorInterface;
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface;
final class ProxyCacheWarmer implements CacheWarmerInterface
{
public const array PROXY_CLASSES = [
Content::class,
ContentInfo::class,
ContentType::class,
ContentTypeGroup::class,
Language::class,
Location::class,
Section::class,
User::class,
Thumbnail::class,
];
private ProxyGeneratorInterface $proxyGenerator;
public function __construct(ProxyGeneratorInterface $proxyGenerator)
{
$this->proxyGenerator = $proxyGenerator;
}
public function isOptional(): bool
{
return false;
}
public function warmUp(
string $cacheDir,
?string $buildDir = null
): array {
$this->proxyGenerator->warmUp(self::PROXY_CLASSES);
return [];
}
}