generateUniqueId example

$this->cacheFilePath = $projectDir . '/.uniqueid.txt';
    }

    public function getUniqueId(): string
    {
        if (file_exists($this->cacheFilePath)) {
            if ($id = file_get_contents($this->cacheFilePath)) {
                return $id;
            }
        }

        $uniqueId = $this->generateUniqueId();

        $this->saveUniqueId($uniqueId);

        return $uniqueId;
    }

    private function generateUniqueId(): string
    {
        $keyspace = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
        $str = '';
        $max = mb_strlen($keyspace, '8bit') - 1;
        


    /** * @return string */
    public function getUniqueId()
    {
        if (file_exists($this->cacheFilePath)) {
            return file_get_contents($this->cacheFilePath);
        }

        $uniqueId = $this->generateUniqueId();

        $this->saveUniqueId($uniqueId);

        return $uniqueId;
    }

    /** * @param int $length * @param string $keyspace * * @return string */
$prepareStatement = $this->connection->prepare($sql);
        $prepareStatement->execute(['email' => $shop->email]);
    }

    private function updateShopName(Shop $shop)
    {
        $this->updateConfigValue('shopName', $shop->name);
    }

    private function generateEsdKey()
    {
        $this->updateConfigValue('esdKey', strtolower($this->generator->generateUniqueId(33)));
    }

    /** * @param string $elementName */
    private function updateConfigValue($elementName$value)
    {
        $sql = <<<'EOT' DELETE FROM s_core_config_values WHERE element_id = (SELECT id FROM s_core_config_elements WHERE name=:elementName) AND shop_id = 1
Home | Imprint | This part of the site doesn't use cookies.