base\Theme $basePath

$basePath public property The root path of this theme. All resources of this theme are located under this directory. public string getBasePath ( )public void setBasePath ( $path )

base\Theme $baseUrl

$baseUrl public property The base URL (without ending slash) for this theme. All resources of this theme are considered to be under this base URL. public string getBaseUrl ( )public void setBaseUrl ( $url )

base\Security hkdf()

hkdf() public method Derives a key from the given input key using the standard HKDF algorithm. Implements HKDF specified in RFC 5869. Recommend use one of the SHA-2 hash algorithms: sha224, sha256, sha384 or sha512. public string hkdf ( $algo, $inputKey, $salt = null, $info = null, $length = 0 )$algo string A hash algorithm supported by hash_hmac(), e.g. 'SHA-256' $inputKey string The source key $salt string The random salt $info string Optional info to bind the derived key materia

base\Security pbkdf2()

pbkdf2() public method Derives a key from the given password using the standard PBKDF2 algorithm. Implements HKDF2 specified in RFC 2898 Recommend use one of the SHA-2 hash algorithms: sha224, sha256, sha384 or sha512. public string pbkdf2 ( $algo, $password, $salt, $iterations, $length = 0 )$algo string A hash algorithm supported by hash_hmac(), e.g. 'SHA-256' $password string The source password $salt string The random salt $iterations integer The number of iterations of the hash

base\Security validateData()

validateData() public method Validates if the given data is tampered. See also hashData(). public string validateData ( $data, $key, $rawHash = false )$data string The data to be validated. The data must be previously generated by hashData(). $key string The secret key that was previously used to generate the hash for the data in hashData(). function to see the supported hashing algorithms on your system. This must be the same as the value passed to hashData() when generating the hash

base\Security hashData()

hashData() public method Prefixes data with a keyed hash value so that it can later be detected if it is tampered. There is no need to hash inputs or outputs of encryptByKey() or encryptByPassword() as those methods perform the task. See also: validateData() generateRandomKey() hkdf() pbkdf2() public string hashData ( $data, $key, $rawHash = false )$data string The data to be protected $key string The secret key to be used for generating hash. Should be a secure cryptographic key. $ra

base\Security generateRandomKey()

generateRandomKey() public method Generates specified number of random bytes. Note that output may not be ASCII. See also generateRandomString() if you need a string. public string generateRandomKey ( $length = 32 )$length integer The number of bytes to generate return string The generated random bytes throws yii\base\InvalidParamException if wrong length is specified throws yii\base\Exception on failure.

base\Security generateRandomString()

generateRandomString() public method Generates a random string of specified length. The string generated matches [A-Za-z0-9_-]+ and is transparent to URL-encoding. public string generateRandomString ( $length = 32 )$length integer The length of the key in characters return string The generated random key throws yii\base\Exception on failure.

base\Security generateSalt()

generateSalt() protected method Generates a salt that can be used to generate a password hash. The PHP crypt() built-in function requires, for the Blowfish hash algorithm, a salt string in a specific format: "$2a$", "$2x$" or "$2y$", a two digit cost parameter, "$", and 22 characters from the alphabet "./0-9A-Za-z". protected string generateSalt ( $cost = 13 )$cost integer The cost parameter return string The random salt value. throws yii\base\InvalidParamException if the cost parame

base\Security encryptByPassword()

encryptByPassword() public method Encrypts data using a password. Derives keys for encryption and authentication from the password using PBKDF2 and a random salt, which is deliberately slow to protect against dictionary attacks. Use encryptByKey() to encrypt fast using a cryptographic key rather than a password. Key derivation time is determined by $derivationIterations, which should be set as high as possible. The encrypted data includes a keyed message authentication code (MAC) so there i