PHPackages                             symftony/identifier - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. symftony/identifier

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

symftony/identifier
===================

A simple library to generate simple or complex identifier.

05PHP

Since Jun 25Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Symftony/Identifier)[ Packagist](https://packagist.org/packages/symftony/identifier)[ RSS](/packages/symftony-identifier/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Identifier
----------

[](#identifier)

A simple library to generate simple or complex identifier.

Installation
------------

[](#installation)

The recommended way to install **Identifier** is through [Composer](http://getcomposer.org).

```
# Install Composer
curl -sS https://getcomposer.org/installer | php
```

```
php composer require symftony/identifier
```

After installing, you need to require Composer's autoloader:

```
require 'vendor/autoload.php';
```

Documentation
-------------

[](#documentation)

This library provide:

- a lot of simple identifiers
- a composite identifier
- many formatter

Identifiers
-----------

[](#identifiers)

- Machine identifiers
    - [HostByNameIdentifier](src/Identifier/HostByNameIdentifier.php) (base on [gethostbyname](http://php.net/gethostbyname))
    - [HostnameIdentifier](src/Identifier/HostnameIdentifier.php) (base on [gethostname](http://php.net/gethostname))
    - [MyPidIdentifier](src/Identifier/MyPidIdentifier.php) (base on [getmypid](http://php.net/getmypid))
    - [PHPOSIdentifier](src/Identifier/PHPOSIdentifier.php) (base on [PHP\_OS](http://php.net/manual/fr/reserved.constants.php#constant.php-os))
    - [PHPUnameIdentifier](src/Identifier/PHPUnameIdentifier.php) (base on [php\_uname](http://php.net/php_uname))
- Configuration identifiers
    - [PHPSapiNameIdentifier](src/Identifier/PHPSapiNameIdentifier.php) (base on [php\_sapi\_name](http://php.net/php_sapi_name))
    - [PHPVersionIdentifier](src/Identifier/PHPVersionIdentifier.php) (base on [php\_version](http://php.net/php_version))
    - [PHPVersionIdIdentifier](src/Identifier/PHPVersionIdIdentifier.php) (base on [PHP\_VERSION\_ID](http://php.net/manual/fr/reserved.constants.php#constant.php-version-id))
- Filesystem identifiers
    - [MyGidIdentifier](src/Identifier/MyGidIdentifier.php) (base on [getmygid](http://php.net/getmygid))
    - [MyUidIdentifier](src/Identifier/MyUidIdentifier.php) (base on [getmyuid](http://php.net/getmyuid))
- Unique identifiers
    - [SecureRandomStringIdentifier](src/Identifier/SecureRandomStringIdentifier.php)
    - [TimeIdentifier](src/Identifier/TimeIdentifier.php) (base on [time](http://php.net/time))
    - [UniqidIdentifier](src/Identifier/UniqidIdentifier.php) (base on [uniqid](http://php.net/uniqid))
    - [Uuid1Identifier](src/Identifier/Uuid1Identifier.php) (base on [ramsey/uuid](https://github.com/ramsey/uuid) V1)
    - [Uuid3Identifier](src/Identifier/Uuid3Identifier.php) (base on [ramsey/uuid](https://github.com/ramsey/uuid) V3)
    - [Uuid4Identifier](src/Identifier/Uuid4Identifier.php) (base on [ramsey/uuid](https://github.com/ramsey/uuid) V4)
    - [Uuid5Identifier](src/Identifier/Uuid5Identifier.php) (base on [ramsey/uuid](https://github.com/ramsey/uuid) V5)
- other
    - [StringIdentifier](src/Identifier/String.php) (inject your own string as identifier)
    - [CompositeIdentifier](src/Identifier/CompositeIdentifier.php) (compose with other identifiers)

Formatters
----------

[](#formatters)

- [ImplodeFormatter](src/Identifier/Formatter/ImplodeFormatter.php) (base on [implode](http://php.net/implode))
- [StrReplaceFormatter](src/Identifier/Formatter/StrReplaceFormatter.php) (base on [str\_replace](http://php.net/str_replace))
- [VsprintfFormatter](src/Identifier/Formatter/VsprintfFormatter.php) (base on [vsprintf](http://php.net/vsprintf))

Usage
-----

[](#usage)

If you want to identify the machine with the sapi and phpversion and a uniqID

```
