PMA\libraries\config\ServerConfigChecks::performConfigChecksServersSetBlowfishSecret PHP Метод

performConfigChecksServersSetBlowfishSecret() защищенный Метод

Set blowfish secret
protected performConfigChecksServersSetBlowfishSecret ( string $blowfishSecret, boolean $cookieAuthServer, boolean $blowfishSecretSet ) : array
$blowfishSecret string Blowfish secret
$cookieAuthServer boolean Cookie auth is used
$blowfishSecretSet boolean Blowfish secret set
Результат array
    protected function performConfigChecksServersSetBlowfishSecret($blowfishSecret, $cookieAuthServer, $blowfishSecretSet)
    {
        if ($cookieAuthServer && $blowfishSecret === null) {
            $blowfishSecret = '';
            if (!function_exists('openssl_random_pseudo_bytes')) {
                $random_func = 'phpseclib\\Crypt\\Random::string';
            } else {
                $random_func = 'openssl_random_pseudo_bytes';
            }
            while (strlen($blowfishSecret) < 32) {
                $byte = $random_func(1);
                // We want only ASCII chars
                if (ord($byte) > 32 && ord($byte) < 127) {
                    $blowfishSecret .= $byte;
                }
            }
            $blowfishSecretSet = true;
            $this->cfg->set('blowfish_secret', $blowfishSecret);
        }
        return array($blowfishSecret, $blowfishSecretSet);
    }