]> git.mxchange.org Git - friendica.git/commitdiff
Add documentation to DisposableFullTextSearch->idenfier field
authorHypolite Petovan <hypolite@mrpetovan.com>
Fri, 26 Jan 2024 21:48:55 +0000 (16:48 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Fri, 26 Jan 2024 21:48:55 +0000 (16:48 -0500)
src/Database/DisposableFullTextSearch.php

index 9cf6337936e1d2971df9e27d9c4e3e02a8c1b35c..3516080f767c03fb8bdbb2fd0b98b10609827c57 100644 (file)
@@ -30,12 +30,15 @@ namespace Friendica\Database;
 class DisposableFullTextSearch
 {
        private Database $db;
+       /** @var int Unique identifier of the haystack in the database. */
        private int $identifier;
 
        public function __construct(Database $database, string $haystack)
        {
                $this->db = $database;
 
+               // Unique identifier generation. Two DisposableFullTextSearch object should never have the same as the first object destruction
+               // would delete both check-full-text-search rows, before the second object destruction is called, leading to unexpected behavior.
                // Maximum value is indicated by the INT UNSIGNED type of the check-full-text-search.pid field
                $this->identifier = random_int(0, pow(2, 32) - 1);