-
Notifications
You must be signed in to change notification settings - Fork 29
Use rhumsaa/uuid if available #159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
added ramsey/uuid generator
@lsmith77 what do you think about this ? |
Yeah it might make sense .. then again at this point we might then just consider suggesting people to use this lib directly (ie. also Jackalope Doctrine DBAL) to make it easier to also use something else than uuid4. /cc @dbu @dantleech |
in phpcr-odm we introduced the possibility to specify a closure to generate the UUID. https://github.com/doctrine/phpcr-odm/blob/master/lib/Doctrine/ODM/PHPCR/Configuration.php#L363-L382 its not elegant that the phpcr-utils classes have static methods - but we could add another static method to set a closure that is set to a static property and then used in generateUuid. on the long run, there should be a PSR for uuid generators that we could inject into jackalope and phpcr-odm. but this will take time, if it ever happens. |
yeah I think we should automatically use the library if its available |
@takeit could you update this PR to check for existence of the ramsey uuid library and use that if available, and fallback to our own implementation if not available? but not add ramsey to composer.json. |
composer.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please move this to a suggest
take a look now, please |
great, thanks a lot! |
We were bit by this bug this morning and it took quite a bit of digging to figure out the fix was to install this other package. I am curious as to why this package is not just required and used by default since the existing uuid generation code seems to have a bug in it under certain circumstances? |
i think the reason was that we support php 5.3 and the uuid lib is 5.4 and newer only. but at this point we could just bump our own minimal php version, i'd say to 5.5 and do a new minor version with that. and at that point make the uuid lib a hard dependency and throw out our own implementation. do you want to do such a PR? |
@dbu That makes sense as does bumping minimal version since 5.4 is end of life'd Im on vacation starting tomorrow for a month and traveling so I will not be able to make a PR for this until the end of september. I'll check in when I return to see if you still need it done. |
oh, enjoy. i am currently at web summer camp in croatia :-)
its not super urgent, lets see if you can do it after those holidays.
|
fixes jackalope/jackalope-doctrine-dbal#298
Even better will be to use rhumsaa/uuid library, imho (so I added it).
openssl_random_pseudo_bytes
function was failing on PHP 5.3.3.Thus, this PR also fixes #120