Skip to content

Commit 2026c73

Browse files
[FrameworkBundle][HttpKernel] Introduce $buildDir argument to WarmableInterface::warmup to warm read-only artefacts in build_dir
1 parent 6b9d889 commit 2026c73

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

reference/dic_tags.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ the :class:`Symfony\\Component\\HttpKernel\\CacheWarmer\\CacheWarmerInterface` i
490490

491491
class MyCustomWarmer implements CacheWarmerInterface
492492
{
493-
public function warmUp($cacheDirectory): array
493+
public function warmUp(string $cacheDir, string $buildDir = null): array
494494
{
495495
// ... do some sort of operations to "warm" your cache
496496

@@ -515,7 +515,15 @@ the :class:`Symfony\\Component\\HttpKernel\\CacheWarmer\\CacheWarmerInterface` i
515515
The ``warmUp()`` method must return an array with the files and classes to
516516
preload. Files must be absolute paths and classes must be fully-qualified class
517517
names. The only restriction is that files must be stored in the cache directory.
518-
If you don't need to preload anything, return an empty array.
518+
If you don't need to preload anything, return an empty array. If read-only
519+
artefacts need to be created, you can store them in a different directory
520+
with the ``$buildDir`` parameter of the ``warmUp()`` method.
521+
522+
.. versionadded:: 6.4
523+
524+
The ``$buildDir`` parameter of the
525+
:method:`Symfony\\Component\\HttpKernel\\CacheWarmer\\WarmableInterface::warmUp`
526+
method was introduced in Symfony 6.4.
519527

520528
The ``isOptional()`` method should return true if it's possible to use the
521529
application without calling this cache warmer. In Symfony, optional warmers

0 commit comments

Comments
 (0)