Download the PHP package boondoc/uuid without Composer

On this page you can find all versions of the php package boondoc/uuid. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package uuid

Boondoc/uuid

Boondoc/uuid is a PHP5.6+ class for handling and generating RFC 4122 versions 1, 3, 4 and 5 (variant 1) Universally Unique Identifiers (UUIDs).

Three string output formats are provided:

UUID variants 0, 3 and 5 are not generated, or accepted as valid input.

Once generated, UUIDs are stored and treated as strings, with no internal structure — timestamp, clock sequence, etc. are ignored. Analysis and rearrangement of component fields for sorting is not supported.

Installation

With Composer:

Manual Installation:

Download the file uuid.php and include it in your code with a require statement.

Usage

Import the class:

A uuid object is assigned its value at creation. Once created, the objectʼs value cannot be altered, although it can be retrieved in multiple formats.

Import value:

Passing a valid UUID as the $uuid parameter will attempt to assign that value to the new uuid object.

Note that another uuid object instance is considered a valid UUID for this purpose:

Generate random value:

Passing no arguments will result in a new version 4 UUID being generated and assigned to the new uuid object.

Generate namespaced value:

If the $uuid parameter is not empty, but is not a valid UUID, a new version 5 UUID will be generated using the $uuid parameter as its “name” input, and assigned to the new uuid object.

If the $namespace parameter is a valid UUID, it will be used as the “namespace” argument of the version 5 generation.

If the $namespace parameter is omitted, or is boolean true, then a default “namespace” argument is used instead. At the start of script execution, the default namespace is initialised to the “nil” UUID, but it can be subsequently set to any valid UUID.

Suppressing namespaced generation:

If the $namespace parameter is boolean false, then namespaced generation is suppressed.

In this case, an empty $uuid parameter still results in generation of a version 4 UUID.

Otherwise, the $uuid parameter is treated strictly as a value to be imported. In the event that $uuid is not empty, but also not a valid UUID, and $namespace is boolean false, either an InvalidString or an InvalidBinary exception is thrown (see below).

Factory notation:

An alternate, factory-style notation is also available:

Factory-style notation also allows access to version 1 and 3 UUIDs; these are not available through direct object instantiation.

Since version 1 UUIDs rely on a MAC address, and PHP has no reliable, platform-agnostic method of obtaining the MAC address of the server, the MAC address must be defined manually. At the start of script execution, the MAC address is initialised to a “nil” value, but it can be subsequently set to any valid MAC address.

Output formats:

The three output formats are all available as read-only properties. The __toString magic method returns the Long format.

Additional properties:

The UUID version and variant are also available as read-only properties.

Exceptions

During normal operation, the following exceptions may be thrown:

These exceptions are for catching only, and should never need to be thrown explicitly.

All of the above exceptions feature a new method, getValue (), which returns the offending value without the rest of the message string.

Examples

Notes:

  1. If the default namespace is never set, it defaults to the “nil” UUID '00000000-0000-0000-0000-000000000000'.
  2. RFC 4122 Appendix C suggests some predefined namespaces. Constants defined by this library are:
    • UUID_NAMESPACE_NIL'00000000-0000-0000-0000-000000000000'
    • UUID_NAMESPACE_DNS'6ba7b810-9dad-11d1-80b4-00c04fd430c8'
    • UUID_NAMESPACE_URL'6ba7b811-9dad-11d1-80b4-00c04fd430c8'
    • UUID_NAMESPACE_OID'6ba7b812-9dad-11d1-80b4-00c04fd430c8'
    • UUID_NAMESPACE_X500'6ba7b814-9dad-11d1-80b4-00c04fd430c8' Note that these constants are actually defined as Binary strings, and will produce unexpected results when passed as the $uuid parameter of a namespaced UUID.
  3. uuid::isValid () returns true if the argument is a uuid object, or if any of ::isValidLong (), ::isValidShort () or ::isValidBinary () would return true.

All versions of uuid with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package boondoc/uuid contains the following files

Loading the files please wait ....