API15

JSimpleCrypt/ construct

From Joomla! Documentation

< API15:JSimpleCrypt
Revision as of 17:25, 22 March 2010 by Doxiki (talk | contribs) (New page: ===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. <span cla...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The "API15" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description[edit]

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.

[Edit Descripton]

Template:Description:JSimpleCrypt/ construct

Syntax[edit]

__construct($key=null)
Parameter Name Default Value Description
$key null $key Optional encryption key

Returns[edit]

void

Defined in[edit]

libraries/joomla/utilities/simplecrypt.php

Importing[edit]

jimport( 'joomla.utilities.simplecrypt' );

Source Body[edit]

function __construct($key = null)
{
        if ($key) {
                $this->_key = (string) $key;
        } else {
                $conf = &JFactory::getConfig();
                $this->_key = md5($conf->getValue('config.secret'));
        }
}

[Edit See Also] Template:SeeAlso:JSimpleCrypt/ construct

Examples[edit]

<CodeExamplesForm />