Merge "auth: Follow up on e907d4328dc3e"
[lhc/web/wiklou.git] / includes / utils / UIDGenerator.php
index bcf74df..15c0cf9 100644 (file)
@@ -30,17 +30,22 @@ use MediaWiki\MediaWikiServices;
 class UIDGenerator {
        /** @var UIDGenerator */
        protected static $instance = null;
-
-       protected $nodeIdFile; // string; local file path
-       protected $nodeId32; // string; node ID in binary (32 bits)
-       protected $nodeId48; // string; node ID in binary (48 bits)
-
-       protected $lockFile88; // string; local file path
-       protected $lockFile128; // string; local file path
-       protected $lockFileUUID; // string; local file path
-
-       /** @var array */
-       protected $fileHandles = []; // cache file handles
+       /** @var string Local file path */
+       protected $nodeIdFile;
+       /** @var string Node ID in binary (32 bits) */
+       protected $nodeId32;
+       /** @var string Node ID in binary (48 bits) */
+       protected $nodeId48;
+
+       /** @var string Local file path */
+       protected $lockFile88;
+       /** @var string Local file path */
+       protected $lockFile128;
+       /** @var string Local file path */
+       protected $lockFileUUID;
+
+       /** @var array Cached file handles */
+       protected $fileHandles = []; // cached file handles
 
        const QUICK_RAND = 1; // get randomness from fast and insecure sources
        const QUICK_VOLATILE = 2; // use an APC like in-memory counter if available
@@ -69,7 +74,7 @@ class UIDGenerator {
                        }
                        Wikimedia\restoreWarnings();
                        if ( !preg_match( '/^[0-9a-f]{12}$/i', $nodeId ) ) {
-                               $nodeId = MWCryptRand::generateHex( 12, true );
+                               $nodeId = MWCryptRand::generateHex( 12 );
                                $nodeId[1] = dechex( hexdec( $nodeId[1] ) | 0x1 ); // set multicast bit
                        }
                        file_put_contents( $this->nodeIdFile, $nodeId ); // cache