Determines the optimal implementation to use for generating UUIDs.
The selection is made based on the enabled PHP extensions with the most performant available option chosen.
string The class name for the optimal UUID generator.
protected function determinePlugin() {
static $plugin;
if (!empty($plugin)) {
return $plugin;
}
$plugin = 'Drupal\\Component\\Uuid\\Php';
// Debian/Ubuntu uses the (broken) OSSP extension as their UUID
// implementation. The OSSP implementation is not compatible with the
// PECL functions.
if (function_exists('uuid_create') && !function_exists('uuid_make')) {
$plugin = 'Drupal\\Component\\Uuid\\Pecl';
}
elseif (function_exists('com_create_guid')) {
$plugin = 'Drupal\\Component\\Uuid\\Com';
}
return $plugin;
}