Files
Xes 73154ae174
Behat tests 1.11.x 🐞 / PHP 7.4 Test on ubuntu-latest (push) Canceled after 0s
PHP-CS-Fixer / composer_install (7.4) (push) Canceled after 0s
Chamilo 1.11.40 (ZIP oficial v1.11.40)
Fuente: https://github.com/chamilo/chamilo-lms/releases/download/v1.11.40/chamilo-1.11.40.zip
sha256: 1cf4bf2cc7bae1ef1a1eff643235db1d552f78ddf4b6dd1e2d2dac9868679439
Snapshot independiente (rama huerfana); diffable vs 1.11.38. vendor incluido.
2026-08-06 17:59:45 +02:00

48 lines
1.4 KiB
ReStructuredText

FOSUserBundle Canonicalization
==============================
FOSUserBundle stores canonicalized versions of the username and the email
which are used when querying and checking for uniqueness.
The default implementation simply makes them case-insensitive to avoid having
users whose username only differs because of the case. It uses :phpfunction:`mb_convert_case`
to achieve this result.
.. caution::
If you do not have the mbstring extension installed you will need to
define your own canonicalizer.
Replacing the canonicalizers
----------------------------
If you want to change the way the canonical fields are populated, simply
create a class implementing ``FOS\UserBundle\Util\CanonicalizerInterface``
and register it as a service:
.. code-block:: yaml
# app/config/services.yml
services:
app.my_canonicalizer:
class: AppBundle\Util\CustomCanonicalizer
public: false
You can now configure FOSUserBundle to use your own implementation:
.. code-block:: yaml
# app/config/config.yml
fos_user:
# ...
service:
email_canonicalizer: app.my_canonicalizer
username_canonicalizer: app.my_canonicalizer
You can of course use different services for each field if you don't want
to use the same logic.
.. note::
The default implementation has the id ``fos_user.util.canonicalizer.default``.