UUID component for CakePHP
I just uploaded a simple component to generate UUIDs (Universally Unique Identifiers) to the downloads section. It is simply a wrapper for a function found in the comments on php.net.
To use the component add it to the components array in your controller and generate a new UUID in the following way:
$this->Uuid->generate();




Nice.
Just yesterday I built my own Component for generating UUIDs … with the same code from PHP.net ;-)
could you provide an example of using the uuid component to auto generate the pk’s in a model object ?
Thank you !
@jgonzalez: Hm, the usual way to auto generate PKs is to use an auto-increment column in your table. I don’t know how you would use UUIDs as PKs as I always use the default way.
Thank you. This is great. Using it on a site.
@PD: Cool to hear that :)
[...] months ago I presented in “UUID component for CakePHP” a simple component to generate UUIDs (Universally Unique Identifiers). With changeset 5552, this [...]