Skip to content

Added the docs for the UUID polyfill #12820

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 17, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions components/polyfill_uuid.rst
Original file line number Diff line number Diff line change
@@ -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