function ctools_uuid_generate

Wrapper function to create UUIDs via ctools, falls back on UUID module if it is enabled. This code is a copy of uuid.inc from the uuid module.

See also

http://php.net/uniqid#65879

1 call to ctools_uuid_generate()
page_manager_handler_get_name in page_manager/page_manager.module
Generate a unique name for a task handler.

File

./ctools.module, line 478

Code

function ctools_uuid_generate() {
    if (!module_exists('uuid')) {
        ctools_include('uuid');
        $callback =& drupal_static(__FUNCTION__);
        if (empty($callback)) {
            if (function_exists('uuid_create') && !function_exists('uuid_make')) {
                $callback = '_ctools_uuid_generate_pecl';
            }
            elseif (function_exists('com_create_guid')) {
                $callback = '_ctools_uuid_generate_com';
            }
            else {
                $callback = '_ctools_uuid_generate_php';
            }
        }
        return $callback();
    }
    else {
        return uuid_generate();
    }
}