Here is a first baby step towards UUID support in core. This patch adds uuid.inc with tests for validation and generation of UUIDs.
We are intentionally waiting for the Entity API to be completed before we make use of this API in core.
Everything is lazy-loadable by providing a factory class that takes care of generating and validating UUIDs. The implementation used for generating UUIDs is pluggable through an interface, thus also lazy-loadable.
For now the implementation is auto-detected. It first checks for an available C implementation with fallback on a PHP implementation. We agreed on intentionally avoiding a
variable_get()-type of pluggablity while waiting for a real plugin system in core. It will probably be a small task to convert it later. This decision was based on:
* We can then use real unit tests (
* The three implementation that it auto-detects on will cover 99.9% of all use-cases
Most of the code and tests are taken from the reboot branch of the UUID module, that dixon_ been working on, with help from various people including skwashd, davereid, heyrocker and more.