Actions

API16

JSimpleCrypt/ construct

From Joomla! Documentation

< API16:JSimpleCrypt
Revision as of 17:55, 22 March 2010 by Doxiki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

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.

[Edit Descripton]

Description:JSimpleCrypt/ construct

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'));
        }
}

[Edit See Also] SeeAlso:JSimpleCrypt/ construct

Examples

<CodeExamplesForm />