Prado\Web\UI\WebControls\TCaptcha::getPrivateKey PHP Méthode

getPrivateKey() public méthode

public getPrivateKey ( ) : string
Résultat string the private key used for generating the token. This is randomly generated and kept in a file for persistency.
    public function getPrivateKey()
    {
        if ($this->_privateKey === null) {
            $fileName = $this->generatePrivateKeyFile();
            $content = file_get_contents($fileName);
            $matches = array();
            if (preg_match("/privateKey='(.*?)'/ms", $content, $matches) > 0) {
                $this->_privateKey = $matches[1];
            } else {
                throw new TConfigurationException('captcha_privatekey_unknown');
            }
        }
        return $this->_privateKey;
    }