Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Once installed Zircon Drupal 8 Theme on Linux with PHP/5.6.17 gets this error:
Fatal error: Call to undefined function Drupal\Component\Uuid\com_create_guid()
Comments
Comment #2
Joefry CreditAttribution: Joefry as a volunteer and commentedThe following is a hack that fixed the get UUID problem for me so I could install demo version of Zircon in D8
Dev platform: Windows XAMPP-PORTABLE 5.5.24 [PHP: 5.5.24].
This is a dev demo core hack and should be treated accordingly.
\zirc8\core\lib\Drupal\Component\Uuid\Com.php
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<?php
/**
* @file
* Contains \Drupal\Component\Uuid\Com.
*/
namespace Drupal\Component\Uuid;
/**
* UUID implementation using the Windows internal GUID extension.
*
* @see http://php.net/com_create_guid
*/
class Com implements UuidInterface {
/**
* {@inheritdoc}
*/
Public function generate(){
if (function_exists('com_create_guid')){
return com_create_guid();
}
else {
mt_srand((double)microtime()*10000);//optional for php 4.2.0 and up.
$charid = strtoupper(md5(uniqid(rand(), true)));
$hyphen = chr(45);// "-"
$uuid = chr(123)// "{"
.substr($charid, 0, 8).$hyphen
.substr($charid, 8, 4).$hyphen
.substr($charid,12, 4).$hyphen
.substr($charid,16, 4).$hyphen
.substr($charid,20,12)
.chr(125);// "}"
return strtolower(trim($uuid, '{}'));
}
}
}
Comment #3
yonglicq CreditAttribution: yonglicq commentedJoefry's solution works! Thank you.
Comment #4
apadernoComment #5
drupal.ninja03 CreditAttribution: drupal.ninja03 commentedThis is working on PHP 7.2 and module version 8.x-0.x-dev, Drupal 8.8.6