API15:JSimpleCrypt/ construct
From Joomla! Documentation
Description
Object Constructor takes an optional key to be used for encryption/decryption. If no key is given then the secret word from the configuration object is used.
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
__construct($key=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $key | null | $key Optional encryption key |
Returns
void
Defined in
libraries/joomla/utilities/simplecrypt.php
Importing
jimport( 'joomla.utilities.simplecrypt' );
Source Body
function __construct($key = null)
{
if ($key) {
$this->_key = (string) $key;
} else {
$conf = &JFactory::getConfig();
$this->_key = md5($conf->getValue('config.secret'));
}
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
Code Examples