Download the PHP package phpgears/identity without Composer
On this page you can find all versions of the php package phpgears/identity. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download phpgears/identity
More information about phpgears/identity
Files in phpgears/identity
Package identity
Short Description Identity object for PHP
License MIT
Homepage https://github.com/phpgears/identity
Informations about the package identity
Identity
Identity objects for PHP
Installation
Composer
Usage
Require composer autoload file
By extending Gears\Identity\AbstractIdentity
you can easily have an Identity class
Implementations
Due to its popularity UUID (RFC 4122) based identity implementations are provided
UuidIdentity
If you want a more concise UUID based identities you can use any of the following:
CondensedUuidIdentity
UUID without dashes
HashUuidIdentity
Require https://github.com/ivanakimov/hashids.php
ShortUuidIdentity
Require https://github.com/pascaldevink/shortuuid
Base62UuidIdentity
Require https://github.com/tuupola/base62
Non-UUID based identities
phpgears/identity-extra hosts non UUID based identity implementations, such as Mongo's ObjectId and several others, consider checking it depending on your use case
The Right Identity
There is no point on creating non-unique identities, always use a proven method of ensuring the uniqueness of the identity value. This can basically be stated as: DO NOT implement your own mechanism for creating unique identifiers, ever, period
It's highly discouraged to allow identities with arbitrary string values, or values that cannot be checked against to certify correctness, that is the reason why a general open-value identity class will never be provided in this package and you should never implement such a thing.
If you want to maximize interoperability with other systems on your architecture or others', such as message queues, webhooks, shared messages systems, etc, you most probably should go with plain ol' UUID identities as the format is widely accepted and has support in all mayor languages
If you have full control of your architecture and all the systems it shares data with you may consider using a more concise UUID identifier, or a non-UUID identifier which can have other benefits such as being more user/url friendly, being sortable, etc
Instead of randomly generated unique value, such as a UUID, you may be able to use real life unique identifiers that can be validated, such as IBAN for bank accounts or ISBN for publications. Strive for this kind of identifiers where possible
Contributing
Found a bug or have a feature request? Please open a new issue. Have a look at existing issues before.
See file CONTRIBUTING.md
License
See file LICENSE included with the source code for a copy of the license terms.
All versions of identity with dependencies
ext-json Version *
phpgears/immutability Version ~0.2.2
ramsey/uuid Version ^3.7.3|^4.0