Skip to content

Commit c3b6b2e

Browse files
[HttpKernel] Add parameters kernel.runtime_mode and kernel.runtime_mode.*, all set from env var APP_RUNTIME_MODE
1 parent c931bb0 commit c3b6b2e

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

reference/configuration/kernel.rst

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,56 @@ the configuration options used to run the application. This allows for example
308308
to run an application with the ``prod`` config (``kernel.environment``) in different
309309
scenarios like ``staging`` or ``production`` (``kernel.runtime_environment``).
310310

311+
``kernel.runtime_mode``
312+
-----------------------
313+
314+
**type**: ``string`` **default**: ``%env(query_string:default:container.runtime_mode:APP_RUNTIME_MODE)%``
315+
316+
This parameter stores a query string of the current runtime mode used by the
317+
application. For example, the query string looks like ``web=1&worker=0`` when
318+
the application is running in web mode and ``web=1&worker=1`` when running in
319+
a long-running web server. This parameter can be set by using the
320+
``APP_RUNTIME_MODE`` env var.
321+
322+
.. versionadded:: 6.4
323+
324+
The ``kernel.runtime_mode`` parameter was introduced in Symfony 6.4.
325+
326+
``kernel.runtime_mode.web``
327+
---------------------------
328+
329+
**type**: ``boolean`` **default**: ``%env(bool:default::key:web:default:kernel.runtime_mode:)%``
330+
331+
Whether the application is running in a web environment.
332+
333+
.. versionadded:: 6.4
334+
335+
The ``kernel.runtime_mode.web`` parameter was introduced in Symfony 6.4.
336+
337+
``kernel.runtime_mode.cli``
338+
---------------------------
339+
340+
**type**: ``boolean`` **default**: ``%env(not:default:kernel.runtime_mode.web:)%``
341+
342+
Whether the application is running in a CLI environment. By default,
343+
this value is the opposite of the ``kernel.runtime_mode.web`` parameter.
344+
345+
.. versionadded:: 6.4
346+
347+
The ``kernel.runtime_mode.cli`` parameter was introduced in Symfony 6.4.
348+
349+
``kernel.runtime_mode.worker``
350+
------------------------------
351+
352+
**type**: ``boolean`` **default**: ``%env(bool:default::key:worker:default:kernel.runtime_mode:)%``
353+
354+
Whether the application is running in a worker/long-running environment. Not all web
355+
servers support it, and you have to use a long-running web server like `FrankenPHP`_.
356+
357+
.. versionadded:: 6.4
358+
359+
The ``kernel.runtime_mode.worker`` parameter was introduced in Symfony 6.4.
360+
311361
``kernel.secret``
312362
-----------------
313363

@@ -336,3 +386,4 @@ This parameter stores the value of
336386

337387
.. _`character encoding`: https://en.wikipedia.org/wiki/Character_encoding
338388
.. _`reproducible builds`: https://en.wikipedia.org/wiki/Reproducible_builds
389+
.. _`FrankenPHP`: https://frankenphp.dev

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy