From fcb2b89a2d8592c949f71b5e782b5b3ec438b8f4 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 16 Dec 2019 16:16:46 +0100 Subject: [PATCH] Added the docs for the UUID polyfill --- components/polyfill_uuid.rst | 57 ++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 components/polyfill_uuid.rst diff --git a/components/polyfill_uuid.rst b/components/polyfill_uuid.rst new file mode 100644 index 00000000000..0fd080d39d4 --- /dev/null +++ b/components/polyfill_uuid.rst @@ -0,0 +1,57 @@ +.. index:: + single: Polyfill + single: PHP + single: Components; Polyfill + +The Symfony Polyfill / UUID Component +===================================== + + This component provides ``uuid_*`` functions to users who run PHP versions + without the UUID extension. + +Installation +------------ + +.. code-block:: terminal + + $ composer require symfony/polyfill-uuid + +.. include:: /components/require_autoload.rst.inc + +Usage +----- + +Once this component is installed in your application, you can use the following +functions, no matter if the `PHP UUID extension`_ is installed or not in your +server. + +Provided Constants +~~~~~~~~~~~~~~~~~~ + +* ``UUID_VARIANT_NCS`` (value = 0) +* ``UUID_VARIANT_DCE`` (value = 1) +* ``UUID_VARIANT_MICROSOFT`` (value = 2) +* ``UUID_VARIANT_OTHER`` (value = 3) +* ``UUID_TYPE_DEFAULT`` (value = 0) +* ``UUID_TYPE_TIME`` (value = 1) +* ``UUID_TYPE_DCE`` (value = 4) +* ``UUID_TYPE_NAME`` (value = 1) +* ``UUID_TYPE_RANDOM`` (value = 4) +* ``UUID_TYPE_NULL`` (value = -1) +* ``UUID_TYPE_INVALID`` (value = -42) + +Provided Functions +~~~~~~~~~~~~~~~~~~ + +* :phpfunction:`uuid_create` +* :phpfunction:`uuid_is_valid` +* :phpfunction:`uuid_compare` +* :phpfunction:`uuid_is_null` +* :phpfunction:`uuid_type` +* :phpfunction:`uuid_variant` +* :phpfunction:`uuid_time` +* :phpfunction:`uuid_mac` +* :phpfunction:`uuid_parse` +* :phpfunction:`uuid_unparse` + +.. _`PHP UUID extension`: https://pecl.php.net/package/uuid