Skip to content

Commit

Permalink
Use COM to generate GUID on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
derekcdw committed Nov 28, 2013
1 parent a958e5a commit 8acfdb2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/CrEOF/PhpUuidGenerator/PhpUuidGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ class PhpUuidGenerator extends AbstractIdGenerator
*/
public function generate(EntityManager $em, $entity)
{
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
return com_create_guid();
}

return uuid_create(UUID_TYPE_RANDOM);
}
}

0 comments on commit 8acfdb2

Please sign in to comment.