mirror of
https://github.com/symfony/symfony-docs.git
synced 2026-03-23 16:22:10 +01:00
Merge remote-tracking branch 'origin/7.1' into 7.2
* origin/7.1: Replaced `caution` directive by `warning` Replaced caution blocks with warning
This commit is contained in:
@@ -23,6 +23,7 @@ rules:
|
||||
forbidden_directives:
|
||||
directives:
|
||||
- '.. index::'
|
||||
- '.. caution::'
|
||||
indention: ~
|
||||
lowercase_as_in_use_statements: ~
|
||||
max_blank_lines:
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
The Bundle System
|
||||
=================
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
In Symfony versions prior to 4.0, it was recommended to organize your own
|
||||
application code using bundles. This is :ref:`no longer recommended <best-practice-no-application-bundles>` and bundles
|
||||
@@ -58,7 +58,7 @@ Start by creating a new class called ``AcmeBlogBundle``::
|
||||
{
|
||||
}
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
If your bundle must be compatible with previous Symfony versions you have to
|
||||
extend from the :class:`Symfony\\Component\\HttpKernel\\Bundle\\Bundle` instead.
|
||||
@@ -118,7 +118,7 @@ to be adjusted if needed:
|
||||
|
||||
.. _bundles-legacy-directory-structure:
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
The recommended bundle structure was changed in Symfony 5, read the
|
||||
`Symfony 4.4 bundle documentation`_ for information about the old
|
||||
|
||||
@@ -246,7 +246,7 @@ with Symfony Flex to install a specific Symfony version:
|
||||
# recommended to have a better output and faster download time)
|
||||
composer update --prefer-dist --no-progress
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
If you want to cache your Composer dependencies, **do not** cache the
|
||||
``vendor/`` directory as this has side-effects. Instead cache
|
||||
|
||||
@@ -200,7 +200,7 @@ Patterns are transformed into the actual class namespaces using the classmap
|
||||
generated by Composer. Therefore, before using these patterns, you must generate
|
||||
the full classmap executing the ``dump-autoload`` command of Composer.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
This technique can't be used when the classes to compile use the ``__DIR__``
|
||||
or ``__FILE__`` constants, because their values will change when loading
|
||||
|
||||
@@ -19,7 +19,7 @@ For example, to override the ``templates/registration/confirmed.html.twig``
|
||||
template from the AcmeUserBundle, create this template:
|
||||
``<your-project>/templates/bundles/AcmeUserBundle/registration/confirmed.html.twig``
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
If you add a template in a new location, you *may* need to clear your
|
||||
cache (``php bin/console cache:clear``), even if you are in debug mode.
|
||||
|
||||
@@ -829,7 +829,7 @@ Then, register the ``SodiumMarshaller`` service using this key:
|
||||
//->addArgument(['env(base64:CACHE_DECRYPTION_KEY)', 'env(base64:OLD_CACHE_DECRYPTION_KEY)'])
|
||||
->addArgument(new Reference('.inner'));
|
||||
|
||||
.. caution::
|
||||
.. danger::
|
||||
|
||||
This will encrypt the values of the cache items, but not the cache keys. Be
|
||||
careful not to leak sensitive data in the keys.
|
||||
|
||||
4
components/cache/adapters/apcu_adapter.rst
vendored
4
components/cache/adapters/apcu_adapter.rst
vendored
@@ -5,7 +5,7 @@ This adapter is a high-performance, shared memory cache. It can *significantly*
|
||||
increase an application's performance, as its cache contents are stored in shared
|
||||
memory, a component appreciably faster than many others, such as the filesystem.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
**Requirement:** The `APCu extension`_ must be installed and active to use
|
||||
this adapter.
|
||||
@@ -30,7 +30,7 @@ and cache items version string as constructor arguments::
|
||||
$version = null
|
||||
);
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Use of this adapter is discouraged in write/delete heavy workloads, as these
|
||||
operations cause memory fragmentation that results in significantly degraded performance.
|
||||
|
||||
@@ -14,7 +14,7 @@ shared memory; you can store contents independent of your PHP environment.
|
||||
The ability to utilize a cluster of servers to provide redundancy and/or fail-over
|
||||
is also available.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
**Requirements:** The `Couchbase PHP extension`_ as well as a `Couchbase server`_
|
||||
must be installed, active, and running to use this adapter. Version ``2.6`` or
|
||||
|
||||
@@ -8,7 +8,7 @@ shared memory; you can store contents independent of your PHP environment.
|
||||
The ability to utilize a cluster of servers to provide redundancy and/or fail-over
|
||||
is also available.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
**Requirements:** The `Couchbase PHP extension`_ as well as a `Couchbase server`_
|
||||
must be installed, active, and running to use this adapter. Version ``3.0`` or
|
||||
|
||||
@@ -33,7 +33,7 @@ and cache root path as constructor parameters::
|
||||
$directory = null
|
||||
);
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
The overhead of filesystem IO often makes this adapter one of the *slower*
|
||||
choices. If throughput is paramount, the in-memory adapters
|
||||
|
||||
@@ -8,7 +8,7 @@ shared memory; you can store contents independent of your PHP environment.
|
||||
The ability to utilize a cluster of servers to provide redundancy and/or fail-over
|
||||
is also available.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
**Requirements:** The `Memcached PHP extension`_ as well as a `Memcached server`_
|
||||
must be installed, active, and running to use this adapter. Version ``2.2`` or
|
||||
@@ -256,7 +256,7 @@ Available Options
|
||||
executed in a "fire-and-forget" manner; no attempt to ensure the operation
|
||||
has been received or acted on will be made once the client has executed it.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Not all library operations are tested in this mode. Mixed TCP and UDP
|
||||
servers are not allowed.
|
||||
|
||||
@@ -28,7 +28,7 @@ file similar to the following::
|
||||
handles file includes, this adapter has the potential to be much faster than other
|
||||
filesystem-based caches.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
While it supports updates and because it is using OPcache as a backend, this adapter is
|
||||
better suited for append-mostly needs. Using it in other scenarios might lead to
|
||||
|
||||
2
components/cache/adapters/redis_adapter.rst
vendored
2
components/cache/adapters/redis_adapter.rst
vendored
@@ -15,7 +15,7 @@ Unlike the :doc:`APCu adapter </components/cache/adapters/apcu_adapter>`, and si
|
||||
shared memory; you can store contents independent of your PHP environment. The ability
|
||||
to utilize a cluster of servers to provide redundancy and/or fail-over is also available.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
**Requirements:** At least one `Redis server`_ must be installed and running to use this
|
||||
adapter. Additionally, this adapter requires a compatible extension or library that implements
|
||||
|
||||
@@ -685,7 +685,7 @@ The separator used in keys is typically ``_`` in YAML and ``-`` in XML.
|
||||
For example, ``auto_connect`` in YAML and ``auto-connect`` in XML. The
|
||||
normalization would make both of these ``auto_connect``.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
The target key will not be altered if it's mixed like
|
||||
``foo-bar_moo`` or if it already exists.
|
||||
@@ -904,7 +904,7 @@ Otherwise the result is a clean array of configuration values::
|
||||
$configs
|
||||
);
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
When processing the configuration tree, the processor assumes that the top
|
||||
level array key (which matches the extension name) is already stripped off.
|
||||
|
||||
@@ -52,7 +52,7 @@ This will print the following to the command line:
|
||||
|
||||
Hello World
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
This feature has a limitation: you cannot pass any argument or option to
|
||||
the default command because they are ignored.
|
||||
|
||||
@@ -14,7 +14,7 @@ the wheel, it uses the Symfony EventDispatcher component to do the work::
|
||||
$application->setDispatcher($dispatcher);
|
||||
$application->run();
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Console events are only triggered by the main command being executed.
|
||||
Commands called by the main command will not trigger any event, unless
|
||||
|
||||
@@ -323,7 +323,7 @@ to display it can be customized::
|
||||
// the bar width
|
||||
$progressBar->setBarWidth(50);
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
For performance reasons, Symfony redraws the screen once every 100ms. If this is too
|
||||
fast or too slow for your application, use the methods
|
||||
|
||||
@@ -329,7 +329,7 @@ convenient for passwords::
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
When you ask for a hidden response, Symfony will use either a binary, change
|
||||
``stty`` mode or use another trick to hide the response. If none is available,
|
||||
@@ -392,7 +392,7 @@ method::
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
The normalizer is called first and the returned value is used as the input
|
||||
of the validator. If the answer is invalid, don't throw exceptions in the
|
||||
@@ -540,7 +540,7 @@ This way you can test any user interaction (even complex ones) by passing the ap
|
||||
simulates a user hitting ``ENTER`` after each input, no need for passing
|
||||
an additional input.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
On Windows systems Symfony uses a special binary to implement hidden
|
||||
questions. This means that those questions don't use the default ``Input``
|
||||
|
||||
@@ -41,7 +41,7 @@ The ``$file`` variable is an instance of
|
||||
:class:`Symfony\\Component\\Finder\\SplFileInfo` which extends PHP's own
|
||||
:phpclass:`SplFileInfo` to provide methods to work with relative paths.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
The ``Finder`` object doesn't reset its internal state automatically.
|
||||
This means that you need to create a new instance if you do not want
|
||||
|
||||
@@ -644,7 +644,7 @@ method:
|
||||
|
||||
// ...
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
The form's ``createView()`` method should be called *after* ``handleRequest()`` is
|
||||
called. Otherwise, when using :doc:`form events </form/events>`, changes done
|
||||
|
||||
@@ -471,7 +471,7 @@ you will trigger the ``kernel.terminate`` event where you can perform certain
|
||||
actions that you may have delayed in order to return the response as quickly
|
||||
as possible to the client (e.g. sending emails).
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Internally, the HttpKernel makes use of the :phpfunction:`fastcgi_finish_request`
|
||||
PHP function. This means that at the moment, only the `PHP FPM`_ server
|
||||
|
||||
@@ -70,7 +70,7 @@ distinguished name (DN) and the password of a user::
|
||||
|
||||
$ldap->bind($dn, $password);
|
||||
|
||||
.. caution::
|
||||
.. danger::
|
||||
|
||||
When the LDAP server allows unauthenticated binds, a blank password will always be valid.
|
||||
|
||||
|
||||
@@ -359,7 +359,7 @@ lose the lock it acquired automatically::
|
||||
throw new \Exception('Process failed');
|
||||
}
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
A common pitfall might be to use the ``isAcquired()`` method to check if
|
||||
a lock has already been acquired by any process. As you can see in this example
|
||||
@@ -427,7 +427,7 @@ when the PHP process ends)::
|
||||
// if none is given, sys_get_temp_dir() is used internally.
|
||||
$store = new FlockStore('/var/stores');
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Beware that some file systems (such as some types of NFS) do not support
|
||||
locking. In those cases, it's better to use a directory on a local disk
|
||||
@@ -668,7 +668,7 @@ the stores::
|
||||
|
||||
$store = new CombinedStore($stores, new UnanimousStrategy());
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
In order to get high availability when using the ``ConsensusStrategy``, the
|
||||
minimum cluster size must be three servers. This allows the cluster to keep
|
||||
@@ -720,7 +720,7 @@ the ``Lock``.
|
||||
Every concurrent process must store the ``Lock`` on the same server. Otherwise two
|
||||
different machines may allow two different processes to acquire the same ``Lock``.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
To guarantee that the same server will always be safe, do not use Memcached
|
||||
behind a LoadBalancer, a cluster or round-robin DNS. Even if the main server
|
||||
@@ -762,12 +762,12 @@ Using the above methods, a robust code would be::
|
||||
// Perform the task whose duration MUST be less than 5 seconds
|
||||
}
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Choose wisely the lifetime of the ``Lock`` and check whether its remaining
|
||||
time to live is enough to perform the task.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Storing a ``Lock`` usually takes a few milliseconds, but network conditions
|
||||
may increase that time a lot (up to a few seconds). Take that into account
|
||||
@@ -776,7 +776,7 @@ Using the above methods, a robust code would be::
|
||||
By design, locks are stored on servers with a defined lifetime. If the date or
|
||||
time of the machine changes, a lock could be released sooner than expected.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
To guarantee that date won't change, the NTP service should be disabled
|
||||
and the date should be updated when the service is stopped.
|
||||
@@ -798,7 +798,7 @@ deployments.
|
||||
|
||||
Some file systems (such as some types of NFS) do not support locking.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
All concurrent processes must use the same physical file system by running
|
||||
on the same machine and using the same absolute path to the lock directory.
|
||||
@@ -827,7 +827,7 @@ and may disappear by mistake at any time.
|
||||
If the Memcached service or the machine hosting it restarts, every lock would
|
||||
be lost without notifying the running processes.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
To avoid that someone else acquires a lock after a restart, it's recommended
|
||||
to delay service start and wait at least as long as the longest lock TTL.
|
||||
@@ -835,7 +835,7 @@ be lost without notifying the running processes.
|
||||
By default Memcached uses a LRU mechanism to remove old entries when the service
|
||||
needs space to add new items.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
The number of items stored in Memcached must be under control. If it's not
|
||||
possible, LRU should be disabled and Lock should be stored in a dedicated
|
||||
@@ -853,7 +853,7 @@ method uses the Memcached's ``flush()`` method which purges and removes everythi
|
||||
MongoDbStore
|
||||
~~~~~~~~~~~~
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
The locked resource name is indexed in the ``_id`` field of the lock
|
||||
collection. Beware that an indexed field's value in MongoDB can be
|
||||
@@ -879,7 +879,7 @@ about `Expire Data from Collections by Setting TTL`_ in MongoDB.
|
||||
recommended to set constructor option ``gcProbability`` to ``0.0`` to
|
||||
disable this behavior if you have manually dealt with TTL index creation.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
This store relies on all PHP application and database nodes to have
|
||||
synchronized clocks for lock expiry to occur at the correct time. To ensure
|
||||
@@ -896,12 +896,12 @@ PdoStore
|
||||
|
||||
The PdoStore relies on the `ACID`_ properties of the SQL engine.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
In a cluster configured with multiple primaries, ensure writes are
|
||||
synchronously propagated to every node, or always use the same node.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Some SQL engines like MySQL allow to disable the unique constraint check.
|
||||
Ensure that this is not the case ``SET unique_checks=1;``.
|
||||
@@ -910,7 +910,7 @@ In order to purge old locks, this store uses a current datetime to define an
|
||||
expiration date reference. This mechanism relies on all server nodes to
|
||||
have synchronized clocks.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
To ensure locks don't expire prematurely; the TTLs should be set with
|
||||
enough extra time to account for any clock drift between nodes.
|
||||
@@ -939,7 +939,7 @@ and may disappear by mistake at any time.
|
||||
If the Redis service or the machine hosting it restarts, every locks would
|
||||
be lost without notifying the running processes.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
To avoid that someone else acquires a lock after a restart, it's recommended
|
||||
to delay service start and wait at least as long as the longest lock TTL.
|
||||
@@ -967,7 +967,7 @@ The ``CombinedStore`` will be, at best, as reliable as the least reliable of
|
||||
all managed stores. As soon as one managed store returns erroneous information,
|
||||
the ``CombinedStore`` won't be reliable.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
All concurrent processes must use the same configuration, with the same
|
||||
amount of managed stored and the same endpoint.
|
||||
@@ -985,13 +985,13 @@ must run on the same machine, virtual machine or container. Be careful when
|
||||
updating a Kubernetes or Swarm service because for a short period of time, there
|
||||
can be two running containers in parallel.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
All concurrent processes must use the same machine. Before starting a
|
||||
concurrent process on a new machine, check that other processes are stopped
|
||||
on the old one.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
When running on systemd with non-system user and option ``RemoveIPC=yes``
|
||||
(default value), locks are deleted by systemd when that user logs out.
|
||||
|
||||
@@ -485,7 +485,7 @@ these options, you can return the desired default value::
|
||||
}
|
||||
}
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
The argument of the callable must be type hinted as ``Options``. Otherwise,
|
||||
the callable itself is considered as the default value of the option.
|
||||
@@ -699,7 +699,7 @@ to the closure to access to them::
|
||||
}
|
||||
}
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
The arguments of the closure must be type hinted as ``OptionsResolver`` and
|
||||
``Options`` respectively. Otherwise, the closure itself is considered as the
|
||||
|
||||
@@ -621,7 +621,7 @@ test::
|
||||
|
||||
And that's all!
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Time-based function mocking follows the `PHP namespace resolutions rules`_
|
||||
so "fully qualified function calls" (e.g ``\time()``) cannot be mocked.
|
||||
|
||||
@@ -108,7 +108,7 @@ You can configure the options passed to the ``other_options`` argument of
|
||||
// this option allows a subprocess to continue running after the main script exited
|
||||
$process->setOptions(['create_new_console' => true]);
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Most of the options defined by ``proc_open()`` (such as ``create_new_console``
|
||||
and ``suppress_errors``) are only supported on Windows operating systems.
|
||||
@@ -552,7 +552,7 @@ Use :method:`Symfony\\Component\\Process\\Process::disableOutput` and
|
||||
$process->disableOutput();
|
||||
$process->run();
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
You cannot enable or disable the output while the process is running.
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ To read from properties, use the "dot" notation::
|
||||
|
||||
var_dump($propertyAccessor->getValue($person, 'children[0].firstName')); // 'Bar'
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Accessing public properties is the last option used by ``PropertyAccessor``.
|
||||
It tries to access the value using the below methods first before using
|
||||
@@ -262,7 +262,7 @@ The ``getValue()`` method can also use the magic ``__get()`` method::
|
||||
|
||||
var_dump($propertyAccessor->getValue($person, 'Wouter')); // [...]
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
When implementing the magic ``__get()`` method, you also need to implement
|
||||
``__isset()``.
|
||||
@@ -303,7 +303,7 @@ enable this feature by using :class:`Symfony\\Component\\PropertyAccess\\Propert
|
||||
|
||||
var_dump($propertyAccessor->getValue($person, 'wouter')); // [...]
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
The ``__call()`` feature is disabled by default, you can enable it by calling
|
||||
:method:`Symfony\\Component\\PropertyAccess\\PropertyAccessorBuilder::enableMagicCall`
|
||||
|
||||
@@ -42,7 +42,7 @@ the component. This file runs the following logic:
|
||||
#. At last, the Runtime is used to run the application (i.e. calling
|
||||
``$kernel->handle(Request::createFromGlobals())->send()``).
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
If you use the Composer ``--no-plugins`` option, the ``autoload_runtime.php``
|
||||
file won't be created.
|
||||
|
||||
@@ -386,7 +386,7 @@ entity primary keys::
|
||||
// ...
|
||||
}
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Using UUIDs as primary keys is usually not recommended for performance reasons:
|
||||
indexes are slower and take more space (because UUIDs in binary format take
|
||||
@@ -574,7 +574,7 @@ entity primary keys::
|
||||
// ...
|
||||
}
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Using ULIDs as primary keys is usually not recommended for performance reasons.
|
||||
Although ULIDs don't suffer from index fragmentation issues (because the values
|
||||
|
||||
@@ -171,7 +171,7 @@ You can set this custom implementation using
|
||||
->setMetadataFactory(new CustomMetadataFactory(...))
|
||||
->getValidator();
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Since you are using a custom metadata factory, you can't configure loaders
|
||||
and caches using the ``add*Mapping()`` methods anymore. You now have to
|
||||
|
||||
@@ -267,7 +267,7 @@ reusable configuration value. By convention, parameters are defined under the
|
||||
|
||||
// ...
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
By default and when using XML configuration, the values between ``<parameter>``
|
||||
tags are not trimmed. This means that the value of the following parameter will be
|
||||
@@ -809,7 +809,7 @@ Use environment variables in values by prefixing variables with ``$``:
|
||||
DB_USER=root
|
||||
DB_PASS=${DB_USER}pass # include the user as a password prefix
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
The order is important when some env var depends on the value of other env
|
||||
vars. In the above example, ``DB_PASS`` must be defined after ``DB_USER``.
|
||||
@@ -830,7 +830,7 @@ Embed commands via ``$()`` (not supported on Windows):
|
||||
|
||||
START_TIME=$(date)
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Using ``$()`` might not work depending on your shell.
|
||||
|
||||
|
||||
@@ -687,7 +687,7 @@ Symfony provides the following env var processors:
|
||||
],
|
||||
]);
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
In order to ease extraction of the resource from the URL, the leading
|
||||
``/`` is trimmed from the ``path`` component.
|
||||
|
||||
@@ -229,7 +229,7 @@ but it should typically be added to your web server configuration.
|
||||
# .env
|
||||
APP_ID=api
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
The value of this variable must match the application directory within
|
||||
``apps/`` as it is used in the Kernel to load the specific application
|
||||
|
||||
@@ -111,7 +111,7 @@ In this case you have changed the location of the cache directory to
|
||||
You can also change the cache directory by defining an environment variable
|
||||
named ``APP_CACHE_DIR`` whose value is the full path of the cache folder.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
You should keep the cache directory different for each environment,
|
||||
otherwise some unexpected behavior may happen. Each environment generates
|
||||
|
||||
10
console.rst
10
console.rst
@@ -366,7 +366,7 @@ Output sections let you manipulate the Console output in advanced ways, such as
|
||||
are updated independently and :ref:`appending rows to tables <console-modify-rendered-tables>`
|
||||
that have already been rendered.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Terminals only allow overwriting the visible content, so you must take into
|
||||
account the console height when trying to write/overwrite section contents.
|
||||
@@ -531,13 +531,13 @@ call ``setAutoExit(false)`` on it to get the command result in ``CommandTester``
|
||||
You can also test a whole console application by using
|
||||
:class:`Symfony\\Component\\Console\\Tester\\ApplicationTester`.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
When testing commands using the ``CommandTester`` class, console events are
|
||||
not dispatched. If you need to test those events, use the
|
||||
:class:`Symfony\\Component\\Console\\Tester\\ApplicationTester` instead.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
When testing commands using the :class:`Symfony\\Component\\Console\\Tester\\ApplicationTester`
|
||||
class, don't forget to disable the auto exit flag::
|
||||
@@ -547,7 +547,7 @@ call ``setAutoExit(false)`` on it to get the command result in ``CommandTester``
|
||||
|
||||
$tester = new ApplicationTester($application);
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
When testing ``InputOption::VALUE_NONE`` command options, you must pass ``true``
|
||||
to them::
|
||||
@@ -619,7 +619,7 @@ profile is accessible through the web page of the profiler.
|
||||
terminal supports links). If you run it in debug verbosity (``-vvv``) you'll
|
||||
also see the time and memory consumed by the command.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
When profiling the ``messenger:consume`` command from the :doc:`Messenger </messenger>`
|
||||
component, add the ``--no-reset`` option to the command or you won't get any
|
||||
|
||||
@@ -57,7 +57,7 @@ method)::
|
||||
``$this->getApplication()->find('demo:greet')->run()`` will allow proper
|
||||
events to be dispatched for that inner command as well.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Note that all the commands will run in the same process and some of Symfony's
|
||||
built-in commands may not work well this way. For instance, the ``cache:clear``
|
||||
|
||||
@@ -11,7 +11,7 @@ service that can be reused in the controller. However, when the command is part
|
||||
of a third-party library, you don't want to modify or duplicate their code.
|
||||
Instead, you can run the command directly from the controller.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
In comparison with a direct call from the console, calling a command from
|
||||
a controller has a slight performance impact because of the request stack
|
||||
|
||||
@@ -51,7 +51,7 @@ argument (thanks to autowiring). In other words, you only need to create this
|
||||
class and everything works automatically! You can call the ``app:sunshine``
|
||||
command and start logging.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
You *do* have access to services in ``configure()``. However, if your command is
|
||||
not :ref:`lazy <console-command-service-lazy-loading>`, try to avoid doing any
|
||||
@@ -130,7 +130,7 @@ only when the ``app:sunshine`` command is actually called.
|
||||
|
||||
You don't need to call ``setName()`` for configuring the command when it is lazy.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Calling the ``list`` command will instantiate all commands, including lazy commands.
|
||||
However, if the command is a ``Symfony\Component\Console\Command\LazyCommand``, then
|
||||
|
||||
@@ -197,7 +197,7 @@ values after a whitespace or an ``=`` sign (e.g. ``--iterations 5`` or
|
||||
``--iterations=5``), but short options can only use whitespaces or no
|
||||
separation at all (e.g. ``-i 5`` or ``-i5``).
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
While it is possible to separate an option from its value with a whitespace,
|
||||
using this form leads to an ambiguity should the option appear before the
|
||||
|
||||
@@ -30,7 +30,7 @@ The second section, "Working on Symfony Code", is targeted at Symfony
|
||||
contributors. This section lists detailed rules that every contributor needs to
|
||||
follow to ensure smooth upgrades for our users.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
:doc:`Experimental Features </contributing/code/experimental>` and code
|
||||
marked with the ``@internal`` tags are excluded from our Backward
|
||||
@@ -53,7 +53,7 @@ All interfaces shipped with Symfony can be used in type hints. You can also call
|
||||
any of the methods that they declare. We guarantee that we won't break code that
|
||||
sticks to these rules.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
The exception to this rule are interfaces tagged with ``@internal``. Such
|
||||
interfaces should not be used or implemented.
|
||||
@@ -89,7 +89,7 @@ Using our Classes
|
||||
All classes provided by Symfony may be instantiated and accessed through their
|
||||
public methods and properties.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Classes, properties and methods that bear the tag ``@internal`` as well as
|
||||
the classes located in the various ``*\Tests\`` namespaces are an
|
||||
@@ -146,7 +146,7 @@ Using our Traits
|
||||
|
||||
All traits provided by Symfony may be used in your classes.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
The exception to this rule are traits tagged with ``@internal``. Such
|
||||
traits should not be used.
|
||||
|
||||
@@ -4,7 +4,7 @@ Reporting a Bug
|
||||
Whenever you find a bug in Symfony, we kindly ask you to report it. It helps
|
||||
us make a better Symfony.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
If you think you've found a security issue, please use the special
|
||||
:doc:`procedure <security>` instead.
|
||||
|
||||
@@ -16,7 +16,7 @@ source code.
|
||||
If you want to learn more about this format, check out the `reStructuredText Primer`_
|
||||
tutorial and the `reStructuredText Reference`_.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
If you are familiar with Markdown, be careful as things are sometimes very
|
||||
similar but different:
|
||||
|
||||
@@ -122,7 +122,7 @@ Example
|
||||
}
|
||||
}
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
In YAML you should put a space after ``{`` and before ``}`` (e.g. ``{ _controller: ... }``),
|
||||
but this should not be done in Twig (e.g. ``{'hello' : 'value'}``).
|
||||
|
||||
@@ -184,7 +184,7 @@ as you normally do:
|
||||
significantly by building a "class map". The ``--no-dev`` flag ensures that
|
||||
development packages are not installed in the production environment.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
If you get a "class not found" error during this step, you may need to
|
||||
run ``export APP_ENV=prod`` (or ``export SYMFONY_ENV=prod`` if you're not
|
||||
|
||||
@@ -102,7 +102,7 @@ using the following configuration options:
|
||||
Support for the ``SYMFONY_TRUSTED_PROXIES`` and ``SYMFONY_TRUSTED_HEADERS``
|
||||
environment variables was introduced in Symfony 7.2.
|
||||
|
||||
.. caution::
|
||||
.. danger::
|
||||
|
||||
Enabling the ``Request::HEADER_X_FORWARDED_HOST`` option exposes the
|
||||
application to `HTTP Host header attacks`_. Make sure the proxy really
|
||||
|
||||
@@ -58,7 +58,7 @@ The database connection information is stored as an environment variable called
|
||||
# to use oracle:
|
||||
# DATABASE_URL="oci8://db_user:db_password@127.0.0.1:1521/db_name"
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
If the username, password, host or database name contain any character considered
|
||||
special in a URI (such as ``: / ? # [ ] @ ! $ & ' ( ) * + , ; =``),
|
||||
@@ -174,7 +174,7 @@ Whoa! You now have a new ``src/Entity/Product.php`` file::
|
||||
Confused why the price is an integer? Don't worry: this is just an example.
|
||||
But, storing prices as integers (e.g. 100 = $1 USD) can avoid rounding issues.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
There is a `limit of 767 bytes for the index key prefix`_ when using
|
||||
InnoDB tables in MySQL 5.6 and earlier versions. String columns with 255
|
||||
@@ -204,7 +204,7 @@ If you want to use XML instead of attributes, add ``type: xml`` and
|
||||
``dir: '%kernel.project_dir%/config/doctrine'`` to the entity mappings in your
|
||||
``config/packages/doctrine.yaml`` file.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Be careful not to use reserved SQL keywords as your table or column names
|
||||
(e.g. ``GROUP`` or ``USER``). See Doctrine's `Reserved SQL keywords documentation`_
|
||||
@@ -320,7 +320,7 @@ before, execute your migrations:
|
||||
|
||||
$ php bin/console doctrine:migrations:migrate
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
If you are using an SQLite database, you'll see the following error:
|
||||
*PDOException: SQLSTATE[HY000]: General error: 1 Cannot add a NOT NULL
|
||||
|
||||
@@ -132,7 +132,7 @@ In Symfony, you can register your custom DQL functions as follows:
|
||||
->datetimeFunction('test_datetime', DatetimeFunction::class);
|
||||
};
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
DQL functions are instantiated by Doctrine outside of the Symfony
|
||||
:doc:`service container </service_container>` so you can't inject services
|
||||
|
||||
@@ -15,7 +15,7 @@ entities, each with their own database connection strings or separate cache conf
|
||||
advanced and not usually required. Be sure you actually need multiple
|
||||
entity managers before adding in this layer of complexity.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Entities cannot define associations across different entity managers. If you
|
||||
need that, there are `several alternatives`_ that require some custom setup.
|
||||
@@ -142,7 +142,7 @@ and ``customer``. The ``default`` entity manager manages entities in the
|
||||
entities in ``src/Entity/Customer``. You've also defined two connections, one
|
||||
for each entity manager, but you are free to define the same connection for both.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
When working with multiple connections and entity managers, you should be
|
||||
explicit about which configuration you want. If you *do* omit the name of
|
||||
@@ -251,7 +251,7 @@ The same applies to repository calls::
|
||||
}
|
||||
}
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
One entity can be managed by more than one entity manager. This however
|
||||
results in unexpected behavior when extending from ``ServiceEntityRepository``
|
||||
|
||||
@@ -171,7 +171,7 @@ class to the label:
|
||||
],
|
||||
// ...
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Switches only work with **checkbox**.
|
||||
|
||||
@@ -201,7 +201,7 @@ class to the ``row_attr`` option.
|
||||
}
|
||||
}) }}
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
If you fill the ``help`` option of your form, it will also be rendered
|
||||
as part of the group.
|
||||
@@ -239,7 +239,7 @@ of your form type.
|
||||
}
|
||||
}) }}
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
You **must** provide a ``label`` and a ``placeholder`` to make floating
|
||||
labels work properly.
|
||||
|
||||
@@ -449,7 +449,7 @@ are some examples of Twig block names for the postal address type:
|
||||
``postal_address_zipCode_label``
|
||||
The label block of the ZIP Code field.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
When the name of your form class matches any of the built-in field types,
|
||||
your form might not be rendered correctly. A form type named
|
||||
|
||||
@@ -126,7 +126,7 @@ in your form type::
|
||||
}
|
||||
}
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
The data passed to the mapper is *not yet validated*. This means that your
|
||||
objects should allow being created in an invalid state in order to produce
|
||||
@@ -215,7 +215,7 @@ If available, these options have priority over the property path accessor and
|
||||
the default data mapper will still use the :doc:`PropertyAccess component </components/property_access>`
|
||||
for the other form fields.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
When a form has the ``inherit_data`` option set to ``true``, it does not use the data mapper and
|
||||
lets its parent map inner values.
|
||||
|
||||
@@ -8,7 +8,7 @@ can be rendered as a ``yyyy-MM-dd``-formatted input text box. Internally, a data
|
||||
converts the ``DateTime`` value of the field to a ``yyyy-MM-dd`` formatted string
|
||||
when rendering the form, and then back to a ``DateTime`` object on submit.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
When a form field has the ``inherit_data`` option set to ``true``, data transformers
|
||||
are not applied to that field.
|
||||
@@ -340,7 +340,7 @@ that, after a successful submission, the Form component will pass a real
|
||||
If the issue isn't found, a form error will be created for that field and
|
||||
its error message can be controlled with the ``invalid_message`` field option.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Be careful when adding your transformers. For example, the following is **wrong**,
|
||||
as the transformer would be applied to the entire form, instead of just this
|
||||
@@ -472,7 +472,7 @@ Which transformer you need depends on your situation.
|
||||
|
||||
To use the view transformer, call ``addViewTransformer()``.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Be careful with model transformers and
|
||||
:doc:`Collection </reference/forms/types/collection>` field types.
|
||||
|
||||
@@ -65,7 +65,7 @@ the fields defined by the form class. Otherwise, you'll see a form validation er
|
||||
argument to ``submit()``. Passing ``false`` will remove any missing fields
|
||||
within the form object. Otherwise, the missing fields will be set to ``null``.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
When the second parameter ``$clearMissing`` is ``false``, like with the
|
||||
"PATCH" method, the validation will only apply to the submitted fields. If
|
||||
|
||||
@@ -192,7 +192,7 @@ Form view data Same as in ``FormEvents::POST_SET_DATA``
|
||||
See all form events at a glance in the
|
||||
:ref:`Form Events Information Table <component-form-event-table>`.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
At this point, you cannot add or remove fields to the form.
|
||||
|
||||
@@ -225,7 +225,7 @@ Form view data Normalized data transformed using a view transformer
|
||||
See all form events at a glance in the
|
||||
:ref:`Form Events Information Table <component-form-event-table>`.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
At this point, you cannot add or remove fields to the current form and its
|
||||
children.
|
||||
|
||||
@@ -195,7 +195,7 @@ then set on the ``tag`` field of the ``Task`` and can be accessed via ``$task->g
|
||||
So far, this works great, but only to edit *existing* tags. It doesn't allow us
|
||||
yet to add new tags or delete existing ones.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
You can embed nested collections as many levels down as you like. However,
|
||||
if you use Xdebug, you may receive a ``Maximum function nesting level of '100'
|
||||
@@ -427,13 +427,13 @@ That was fine, but forcing the use of the "adder" method makes handling
|
||||
these new ``Tag`` objects easier (especially if you're using Doctrine, which
|
||||
you will learn about next!).
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
You have to create **both** ``addTag()`` and ``removeTag()`` methods,
|
||||
otherwise the form will still use ``setTag()`` even if ``by_reference`` is ``false``.
|
||||
You'll learn more about the ``removeTag()`` method later in this article.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Symfony can only make the plural-to-singular conversion (e.g. from the
|
||||
``tags`` property to the ``addTag()`` method) for English words. Code
|
||||
|
||||
@@ -74,7 +74,7 @@ control over how each form field is rendered, so you can fully customize them:
|
||||
</div>
|
||||
</div>
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
If you're rendering each field manually, make sure you don't forget the
|
||||
``_token`` field that is automatically added for CSRF protection.
|
||||
@@ -305,7 +305,7 @@ Renders any errors for the given field.
|
||||
{# render any "global" errors not associated to any form field #}
|
||||
{{ form_errors(form) }}
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
In the Bootstrap 4 form theme, ``form_errors()`` is already included in
|
||||
``form_label()``. Read more about this in the
|
||||
|
||||
@@ -177,7 +177,7 @@ of form themes:
|
||||
|
||||
{# ... #}
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
When using the ``only`` keyword, none of Symfony's built-in form themes
|
||||
(``form_div_layout.html.twig``, etc.) will be applied. In order to render
|
||||
|
||||
@@ -165,6 +165,6 @@ Finally, make this work by adding the location form to your two original forms::
|
||||
That's it! You have extracted duplicated field definitions to a separate
|
||||
location form that you can reuse wherever you need it.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Forms with the ``inherit_data`` option set cannot have ``*_SET_DATA`` event listeners.
|
||||
|
||||
@@ -162,7 +162,7 @@ instance with the value of the option. This constructor has 2 arguments:
|
||||
``null`` is guessed when you believe the value of the option should not be
|
||||
set.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
You should be very careful using the ``guessMaxLength()`` method. When the
|
||||
type is a float, you cannot determine a length (e.g. you want a float to be
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
How to Unit Test your Forms
|
||||
===========================
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
This article is intended for developers who create
|
||||
:doc:`custom form types </form/create_custom_field_type>`. If you are using
|
||||
@@ -121,7 +121,7 @@ variable exists and will be available in your form themes::
|
||||
Use `PHPUnit data providers`_ to test multiple form conditions using
|
||||
the same test code.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
When your type relies on the ``EntityType``, you should register the
|
||||
:class:`Symfony\\Bridge\\Doctrine\\Form\\DoctrineOrmExtension`, which will
|
||||
|
||||
@@ -121,7 +121,7 @@ but here's a short example::
|
||||
submitted data is validated using the ``Symfony\Component\Validator\Constraints\Valid``
|
||||
constraint, unless you :doc:`disable validation </form/disabling_validation>`.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
When a form is only partially submitted (for example, in an HTTP PATCH
|
||||
request), only the constraints from the submitted form fields will be
|
||||
|
||||
@@ -869,7 +869,7 @@ pass ``null`` to it::
|
||||
}
|
||||
}
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
When using a specific :doc:`form validation group </form/validation_groups>`,
|
||||
the field type guesser will still consider *all* validation constraints when
|
||||
|
||||
@@ -91,7 +91,7 @@ This will physically copy all the files from your mapped directories to
|
||||
``public/assets/`` so that they're served directly by your web server.
|
||||
See :ref:`Deployment <asset-mapper-deployment>` for more details.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
If you run the ``asset-map:compile`` command on your development machine,
|
||||
you won't see any changes made to your assets when reloading the page.
|
||||
|
||||
@@ -200,7 +200,7 @@ You'll customize and learn more about these files in :doc:`/frontend/encore/simp
|
||||
When you execute Encore, it will ask you to install a few more dependencies based
|
||||
on which features of Encore you have enabled.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Some of the documentation will use features that are specific to Symfony or
|
||||
Symfony's `WebpackEncoreBundle`_. These are optional, and are special ways
|
||||
|
||||
@@ -82,7 +82,7 @@ in your ``package.json`` file.
|
||||
in the :ref:`Symfony CLI Workers <symfony-server_configuring-workers>`
|
||||
documentation.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Whenever you make changes in your ``webpack.config.js`` file, you must
|
||||
stop and restart ``encore``.
|
||||
@@ -434,7 +434,7 @@ Your app now supports Sass. Encore also supports LESS and Stylus. See
|
||||
Compiling Only a CSS File
|
||||
-------------------------
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Using ``addStyleEntry()`` is supported, but not recommended. A better option
|
||||
is to follow the pattern above: use ``addEntry()`` to point to a JavaScript
|
||||
|
||||
@@ -87,7 +87,7 @@ connections:
|
||||
}
|
||||
}
|
||||
|
||||
.. caution::
|
||||
.. danger::
|
||||
|
||||
Make sure to run the development server inside your virtual machine only;
|
||||
otherwise other computers can have access to it.
|
||||
@@ -110,7 +110,7 @@ the dev-server. To fix this, set the ``allowedHosts`` option:
|
||||
options.allowedHosts = all;
|
||||
})
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Beware that `it's not recommended to set allowedHosts to all`_ in general, but
|
||||
here it's required to solve the issue when using Encore in a virtual machine.
|
||||
|
||||
@@ -14,7 +14,7 @@ cache lifetimes, but to actively notify the gateway cache when content
|
||||
changes. Reverse proxies usually provide a channel to receive such
|
||||
notifications, typically through special HTTP requests.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
While cache invalidation is powerful, avoid it when possible. If you fail
|
||||
to invalidate something, outdated caches will be served for a potentially
|
||||
|
||||
@@ -259,7 +259,7 @@ One great advantage of the ESI renderer is that you can make your application
|
||||
as dynamic as needed and at the same time, hit the application as little as
|
||||
possible.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
The fragment listener only responds to signed requests. Requests are only
|
||||
signed when using the fragment renderer and the ``render_esi`` Twig
|
||||
|
||||
@@ -1064,7 +1064,7 @@ To disable HTTP compression, send an ``Accept-Encoding: identity`` HTTP header.
|
||||
Chunked transfer encoding is enabled automatically if both your PHP runtime and
|
||||
the remote server support it.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
If you set ``Accept-Encoding`` to e.g. ``gzip``, you will need to handle the
|
||||
decompression yourself.
|
||||
|
||||
2
lock.rst
2
lock.rst
@@ -189,7 +189,7 @@ To lock the default resource, autowire the lock factory using
|
||||
}
|
||||
}
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
The same instance of ``LockInterface`` won't block when calling ``acquire``
|
||||
multiple times inside the same process. When several services use the
|
||||
|
||||
@@ -95,7 +95,7 @@ from the ``security`` channel. The following example does that only in the
|
||||
}
|
||||
};
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
The ``channels`` configuration only works for top-level handlers. Handlers
|
||||
that are nested inside a group, buffer, filter, fingers crossed or other
|
||||
|
||||
@@ -57,7 +57,7 @@ logging these HTTP codes based on the MonologBundle configuration:
|
||||
$mainHandler->excludedHttpCode()->code(404);
|
||||
};
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Combining ``excluded_http_codes`` with a ``passthru_level`` lower than
|
||||
``error`` (i.e. ``debug``, ``info``, ``notice`` or ``warning``) will not
|
||||
|
||||
18
mailer.rst
18
mailer.rst
@@ -61,7 +61,7 @@ over SMTP by configuring the DSN in your ``.env`` file (the ``user``,
|
||||
$framework->mailer()->dsn(env('MAILER_DSN'));
|
||||
};
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
If the username, password or host contain any character considered special in a
|
||||
URI (such as ``: / ? # [ ] @ ! $ & ' ( ) * + , ; =``), you must
|
||||
@@ -82,7 +82,7 @@ native ``native://default`` Mailer uses the sendmail
|
||||
``php.ini`` settings when ``sendmail_path`` is not configured.
|
||||
============ ======================================== ==============================================================
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
When using ``native://default``, if ``php.ini`` uses the ``sendmail -t``
|
||||
command, you won't have error reporting and ``Bcc`` headers won't be removed.
|
||||
@@ -246,20 +246,20 @@ party provider:
|
||||
| | - API ``sweego+api://API_KEY@default`` |
|
||||
+------------------------+---------------------------------------------------------+
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
If your credentials contain special characters, you must URL-encode them.
|
||||
For example, the DSN ``ses+smtp://ABC1234:abc+12/345@default`` should be
|
||||
configured as ``ses+smtp://ABC1234:abc%2B12%2F345@default``
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
If you want to use the ``ses+smtp`` transport together with :doc:`Messenger </messenger>`
|
||||
to :ref:`send messages in background <mailer-sending-messages-async>`,
|
||||
you need to add the ``ping_threshold`` parameter to your ``MAILER_DSN`` with
|
||||
a value lower than ``10``: ``ses+smtp://USERNAME:PASSWORD@default?ping_threshold=9``
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
If you send custom headers when using the `Amazon SES`_ transport (to receive
|
||||
them later via a webhook), make sure to use the ``ses+https`` provider because
|
||||
@@ -385,7 +385,7 @@ setting the ``auto_tls`` option to ``false`` in the DSN::
|
||||
|
||||
$dsn = 'smtp://user:pass@10.0.0.25?auto_tls=false';
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
It's not recommended to disable TLS while connecting to an SMTP server over
|
||||
the Internet, but it can be useful when both the application and the SMTP
|
||||
@@ -795,7 +795,7 @@ and headers.
|
||||
$mailer->header('X-Custom-Header')->value('foobar');
|
||||
};
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Some third-party providers don't support the usage of keywords like ``from``
|
||||
in the ``headers``. Check out your provider's documentation before setting
|
||||
@@ -1218,7 +1218,7 @@ Before signing/encrypting messages, make sure to have:
|
||||
When using OpenSSL to generate certificates, make sure to add the
|
||||
``-addtrust emailProtection`` command option.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Signing and encrypting messages require their contents to be fully rendered.
|
||||
For example, the content of :ref:`templated emails <mailer-twig>` is rendered
|
||||
@@ -1243,7 +1243,7 @@ using for example OpenSSL or obtained at an official Certificate Authority (CA).
|
||||
The email recipient must have the CA certificate in the list of trusted issuers
|
||||
in order to verify the signature.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
If you use message signature, sending to ``Bcc`` will be removed from the
|
||||
message. If you need to send a message to multiple recipients, you need
|
||||
|
||||
@@ -442,7 +442,7 @@ Using cookies is the most secure and preferred way when the client is a web
|
||||
browser. If the client is not a web browser, then using an authorization header
|
||||
is the way to go.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
To use the cookie authentication method, the Symfony app and the Hub
|
||||
must be served from the same domain (can be different sub-domains).
|
||||
|
||||
@@ -783,7 +783,7 @@ times:
|
||||
Change the ``async`` argument to use the name of your transport (or transports)
|
||||
and ``user`` to the Unix user on your server.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
During a deployment, something might be unavailable (e.g. the
|
||||
database) causing the consumer to fail to start. In this situation,
|
||||
@@ -1005,7 +1005,7 @@ by setting its ``rate_limiter`` option:
|
||||
;
|
||||
};
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
When a rate limiter is configured on a transport, it will block the whole
|
||||
worker when the limit is hit. You should make sure you configure a dedicated
|
||||
@@ -1585,7 +1585,7 @@ your Envelope::
|
||||
new AmqpStamp('custom-routing-key', AMQP_NOPARAM, $attributes),
|
||||
]);
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
The consumers do not show up in an admin panel as this transport does not rely on
|
||||
``\AmqpQueue::consume()`` which is blocking. Having a blocking receiver makes
|
||||
@@ -1636,7 +1636,7 @@ DSN by using the ``table_name`` option:
|
||||
Or, to create the table yourself, set the ``auto_setup`` option to ``false`` and
|
||||
:ref:`generate a migration <doctrine-creating-the-database-tables-schema>`.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
The datetime property of the messages stored in the database uses the
|
||||
timezone of the current system. This may cause issues if multiple machines
|
||||
@@ -1830,7 +1830,7 @@ under the transport in ``messenger.yaml``:
|
||||
verify_peer: true
|
||||
verify_peer_name: true
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
There should never be more than one ``messenger:consume`` command running with the same
|
||||
combination of ``stream``, ``group`` and ``consumer``, or messages could end up being
|
||||
@@ -2696,7 +2696,7 @@ That's it! You can now consume each transport:
|
||||
|
||||
$ php bin/console messenger:consume async_priority_normal -vv
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
If a handler does *not* have ``from_transport`` config, it will be executed
|
||||
on *every* transport that the message is received from.
|
||||
|
||||
@@ -52,7 +52,7 @@ to send SMS messages to mobile phones. This feature requires subscribing to
|
||||
a third-party service that sends SMS messages. Symfony provides integration
|
||||
with a couple popular SMS services:
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
If any of the DSN values contains any character considered special in a
|
||||
URI (such as ``: / ? # [ ] @ ! $ & ' ( ) * + , ; =``), you must
|
||||
@@ -339,7 +339,7 @@ information such as the message ID and the original message contents.
|
||||
Chat Channel
|
||||
~~~~~~~~~~~~
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
If any of the DSN values contains any character considered special in a
|
||||
URI (such as ``: / ? # [ ] @ ! $ & ' ( ) * + , ; =``), you must
|
||||
@@ -388,7 +388,7 @@ Service Package D
|
||||
The ``Gitter`` integration was removed in Symfony 7.2 because that service
|
||||
no longer provides an API.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
By default, if you have the :doc:`Messenger component </messenger>` installed,
|
||||
the notifications will be sent through the MessageBus. If you don't have a
|
||||
@@ -558,7 +558,7 @@ notification emails:
|
||||
Push Channel
|
||||
~~~~~~~~~~~~
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
If any of the DSN values contains any character considered special in a
|
||||
URI (such as ``: / ? # [ ] @ ! $ & ' ( ) * + , ; =``), you must
|
||||
|
||||
@@ -303,13 +303,13 @@ These are the method that you can define in the data collector class:
|
||||
from ``AbstractDataCollector``). If you need some services to collect the
|
||||
data, inject those services in the data collector constructor.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
The ``collect()`` method is only called once. It is not used to "gather"
|
||||
data but is there to "pick up" the data that has been stored by your
|
||||
service.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
As the profiler serializes data collector instances, you should not
|
||||
store objects that cannot be serialized (like PDO objects) or you need
|
||||
|
||||
@@ -175,7 +175,7 @@ named ``kernel.http_method_override``.
|
||||
:ref:`Changing the Action and HTTP Method <forms-change-action-method>` of
|
||||
Symfony forms.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
If you're using the :ref:`HttpCache Reverse Proxy <symfony2-reverse-proxy>`
|
||||
with this option, the kernel will ignore the ``_method`` parameter,
|
||||
|
||||
@@ -20,7 +20,7 @@ under the ``web_profiler`` key in your application configuration.
|
||||
namespace and the related XSD schema is available at:
|
||||
``https://symfony.com/schema/dic/webprofiler/webprofiler-1.0.xsd``
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
The web debug toolbar is not available for responses of type ``StreamedResponse``.
|
||||
|
||||
|
||||
@@ -245,7 +245,7 @@ constructor of the Callback constraint::
|
||||
}
|
||||
}
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Using a ``Closure`` together with attribute configuration will disable the
|
||||
attribute cache for that class/property/method because ``Closure`` cannot
|
||||
|
||||
@@ -4,7 +4,7 @@ EqualTo
|
||||
Validates that a value is equal to another value, defined in the options.
|
||||
To force that a value is *not* equal, see :doc:`/reference/constraints/NotEqualTo`.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
This constraint compares using ``==``, so ``3`` and ``"3"`` are considered
|
||||
equal. Use :doc:`/reference/constraints/IdenticalTo` to compare with
|
||||
|
||||
@@ -242,7 +242,7 @@ Parameter Description
|
||||
|
||||
**type**: ``array`` or ``string``
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
You should always use the ``extensions`` option instead of ``mimeTypes``
|
||||
except if you explicitly don't want to check that the extension of the file
|
||||
|
||||
@@ -5,7 +5,7 @@ Validates that a value is identical to another value, defined in the options.
|
||||
To force that a value is *not* identical, see
|
||||
:doc:`/reference/constraints/NotIdenticalTo`.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
This constraint compares using ``===``, so ``3`` and ``"3"`` are *not*
|
||||
considered equal. Use :doc:`/reference/constraints/EqualTo` to compare
|
||||
|
||||
@@ -5,7 +5,7 @@ Validates that a value is **not** equal to another value, defined in the
|
||||
options. To force that a value is equal, see
|
||||
:doc:`/reference/constraints/EqualTo`.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
This constraint compares using ``!=``, so ``3`` and ``"3"`` are considered
|
||||
equal. Use :doc:`/reference/constraints/NotIdenticalTo` to compare with
|
||||
|
||||
@@ -5,7 +5,7 @@ Validates that a value is **not** identical to another value, defined in
|
||||
the options. To force that a value is identical, see
|
||||
:doc:`/reference/constraints/IdenticalTo`.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
This constraint compares using ``!==``, so ``3`` and ``"3"`` are
|
||||
considered not equal. Use :doc:`/reference/constraints/NotEqualTo` to
|
||||
|
||||
@@ -126,14 +126,14 @@ between all of the rows in your user table:
|
||||
}
|
||||
}
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
This constraint doesn't provide any protection against `race conditions`_.
|
||||
They may occur when another entity is persisted by an external process after
|
||||
this validation has passed and before this entity is actually persisted in
|
||||
the database.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
This constraint cannot deal with duplicates found in a collection of items
|
||||
that haven't been persisted as entities yet. You'll need to create your own
|
||||
@@ -355,7 +355,7 @@ this option to specify one or more fields to only ignore ``null`` values on them
|
||||
}
|
||||
}
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
If you ``ignoreNull`` on fields that are part of a unique index in your
|
||||
database, you might see insertion errors when your application attempts to
|
||||
|
||||
@@ -560,7 +560,7 @@ can also register it manually:
|
||||
that defaults to ``0``. The higher the number, the earlier that warmers are
|
||||
executed.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
If your cache warmer fails its execution because of any exception, Symfony
|
||||
won't try to execute it again for the next requests. Therefore, your
|
||||
|
||||
@@ -26,7 +26,7 @@ The component supports:
|
||||
|
||||
The support for comments inside expressions was introduced in Symfony 7.2.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
A backslash (``\``) must be escaped by 3 backslashes (``\\\\``) in a string
|
||||
and 7 backslashes (``\\\\\\\\``) in a regex::
|
||||
|
||||
@@ -64,7 +64,7 @@ The basic usage of the MessageFormat allows you to use placeholders (called
|
||||
'say_hello' => "Hello {name}!",
|
||||
];
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
In the previous translation format, placeholders were often wrapped in ``%``
|
||||
(e.g. ``%name%``). This ``%`` character is no longer valid with the ICU
|
||||
|
||||
@@ -93,7 +93,7 @@ method::
|
||||
You can also customize the `choice_name`_ of each choice. You can learn more
|
||||
about all of these options in the sections below.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
The *placeholder* is a specific field, when the choices are optional the
|
||||
first item in the list must be empty, so the user can unselect.
|
||||
|
||||
@@ -99,7 +99,7 @@ can be used - with JavaScript - to create new form items dynamically on
|
||||
the client side. For more information, see the above example and
|
||||
:ref:`form-collections-new-prototype`.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
If you're embedding entire other forms to reflect a one-to-many database
|
||||
relationship, you may need to manually ensure that the foreign key of
|
||||
@@ -119,7 +119,7 @@ submitted data will mean that it's removed from the final array.
|
||||
|
||||
For more information, see :ref:`form-collections-remove`.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
Be careful when using this option when you're embedding a collection
|
||||
of objects. In this case, if any embedded forms are removed, they *will*
|
||||
@@ -139,7 +139,7 @@ form you have to set this option to ``true``. However, existing collection entri
|
||||
will only be deleted if you have the allow_delete_ option enabled. Otherwise
|
||||
the empty values will be kept.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
The ``delete_empty`` option only removes items when the normalized value is
|
||||
``null``. If the nested `entry_type`_ is a compound form type, you must
|
||||
|
||||
@@ -52,7 +52,7 @@ Overridden Options
|
||||
The country type defaults the ``choices`` option to the whole list of countries.
|
||||
The locale is used to translate the countries names.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
If you want to override the built-in choices of the country type, you
|
||||
will also have to set the ``choice_loader`` option to ``null``.
|
||||
|
||||
@@ -35,7 +35,7 @@ Overridden Options
|
||||
|
||||
The choices option defaults to all currencies.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
If you want to override the built-in choices of the currency type, you
|
||||
will also have to set the ``choice_loader`` option to ``null``.
|
||||
|
||||
@@ -101,7 +101,7 @@ This can be tricky: if the date picker is misconfigured, Symfony won't understan
|
||||
the format and will throw a validation error. You can also configure the format
|
||||
that Symfony should expect via the `format`_ option.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
The string used by a JavaScript date picker to describe its format (e.g. ``yyyy-mm-dd``)
|
||||
may not match the string that Symfony uses (e.g. ``yyyy-MM-dd``). This is because
|
||||
|
||||
@@ -221,7 +221,7 @@ following:
|
||||
Whether or not to include days in the input. This will result in an additional
|
||||
input to capture days.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
This can not be used when `with_weeks`_ is enabled.
|
||||
|
||||
@@ -274,7 +274,7 @@ input to capture seconds.
|
||||
Whether or not to include weeks in the input. This will result in an additional
|
||||
input to capture weeks.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
This can not be used when `with_days`_ is enabled.
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ passed the ``EntityRepository`` of the entity as the only argument and should
|
||||
return a ``QueryBuilder``. Returning ``null`` in the Closure will result in
|
||||
loading all entities.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
The entity used in the ``FROM`` clause of the ``query_builder`` option
|
||||
will always be validated against the class which you have specified at the
|
||||
|
||||
@@ -69,7 +69,7 @@ Overridden Options
|
||||
The choices option defaults to all languages.
|
||||
The default locale is used to translate the languages names.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
If you want to override the built-in choices of the language type, you
|
||||
will also have to set the ``choice_loader`` option to ``null``.
|
||||
|
||||
@@ -46,7 +46,7 @@ Overridden Options
|
||||
The choices option defaults to all locales. It uses the default locale to
|
||||
specify the language.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
If you want to override the built-in choices of the locale type, you
|
||||
will also have to set the ``choice_loader`` option to ``null``.
|
||||
|
||||
@@ -70,9 +70,10 @@ html5
|
||||
If set to ``true``, the HTML input will be rendered as a native HTML5
|
||||
``<input type="number">`` element.
|
||||
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
As HTML5 number format is normalized, it is incompatible with ``grouping`` option.
|
||||
As HTML5 number format is normalized, it is incompatible with the ``grouping``
|
||||
option.
|
||||
|
||||
input
|
||||
~~~~~
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.. caution::
|
||||
.. warning::
|
||||
|
||||
If ``timestamp`` is used, ``DateType`` is limited to dates between
|
||||
Fri, 13 Dec 1901 20:45:54 UTC and Tue, 19 Jan 2038 03:14:07 UTC on 32bit
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user