Keychain

Extends Registry

Keychain Class

since

1.0

package

Joomla Framework

Methods

__clone

Magic function to clone the registry object.

__clone() : 
inherited
since

1.0.0

Response

void

__construct

Constructor

__construct(\Joomla\Crypt\Crypt crypt,  data = null) : 
since

2.0.0

Arguments

crypt

CryptThe encryption handler.

data

mixedThe data to bind to the new Keychain.

Response

mixed

__get

Magic method to access separator property.

__get( name) : string|null
inherited deprecated
since

2.0.0

deprecated

3.0 This is a B/C proxy for deprecated read accesses

Arguments

name

stringThe name of the property.

Response

string|nullA value if the property name is valid, null otherwise.

__set

Magic method to access separator property.

__set( name,  value) : 
inherited deprecated
since

2.0.0

deprecated

3.0 This is a B/C proxy for deprecated read accesses

Arguments

name

stringThe name of the property.

value

mixedThe value of the property.

Response

void

__toString

Magic function to render this object as a string using default args of toString method.

__toString() : 
inherited
since

1.0.0

Response

string

append

Append value to a path in registry

append( path,  value) : 
inherited
since

1.4.0

Arguments

path

stringParent registry Path (e.g. joomla.content.showauthor)

value

mixedValue of entry

Response

mixedThe value of the that has been set.

asArray

Method to recursively convert an object of data to an array.

asArray( data) : mixed||string|int
inherited
since

1.0.0

Arguments

data

objectAn object of data to return as an array.

Response

array<string|int, mixed>Array representation of the input object.

bindData

Method to recursively bind data to a parent object.

bindData( parent,  data,  recursive = true,  allowNull = true) : 
inherited
since

1.0.0

Arguments

parent

objectThe parent object on which to attach the data values.

data

mixedAn array or object of data to bind to the parent object.

recursive

boolTrue to support recursive bindData.

allowNull

boolTrue to allow null values.

Response

void

count

Count elements of the data object

count() : 
inherited
link
since

1.3.0

Response

intThe custom count as an integer.

def

Sets a default value if not already assigned.

def( key,  default = '') : 
inherited
since

1.0.0

Arguments

key

stringThe name of the parameter.

default

mixedAn optional value for the parameter.

Response

mixedThe value set, or the default if the value was not previously set (or null).

exists

Check if a registry path exists.

exists( path) : 
inherited
since

1.0.0

Arguments

path

stringRegistry path (e.g. joomla.content.showauthor)

Response

bool

extract

Method to extract a sub-registry from path

extract( path) : \Joomla\Registry\Registry
inherited
since

1.2.0

2.0.0

Arguments

path

stringRegistry path (e.g. joomla.content.showauthor)

Response

RegistryRegistry object (empty if no data is present)

flatten

Dump to one dimension array.

flatten( separator = null) : string||string|int
inherited
since

1.3.0

Arguments

separator

stringThe key separator.

Response

array<string|int, string>Dumped array.

get

Get a registry value.

get( path,  default = null) : 
inherited
since

1.0.0

Arguments

path

stringRegistry path (e.g. joomla.content.showauthor)

default

mixedOptional default value, returned if the internal value is null.

Response

mixedValue of entry or null

getIterator

Gets this object represented as an ArrayIterator.

getIterator() : \ArrayIterator
inherited

This allows the data properties to be accessed via a foreach statement.

see IteratorAggregate::getIterator()
since

1.3.0

Response

ArrayIteratorThis object represented as an ArrayIterator.

jsonSerialize

Implementation for the JsonSerializable interface.

jsonSerialize() : 
inherited

Allows us to pass Registry objects to json_encode.

since

1.0.0

note

The interface is only present in PHP 5.4 and up.

Response

object

loadArray

Load an associative array of values into the default namespace

loadArray(mixed||string|int array,  flattened = false,  separator = null) : 
inherited
since

1.0.0

2.0.0

Arguments

array

array<string|int, mixed>Associative array of value to load

flattened

boolLoad from a one-dimensional array

separator

stringThe key separator

Response

$this

loadFile

Load the contents of a file into the registry

loadFile( file,  format = 'JSON', mixed||string|int options = []) : 
inherited
since

1.0.0

2.0.0

Arguments

file

stringPath to file to load

format

stringFormat of the file [optional: defaults to JSON]

options

array<string|int, mixed>Options used by the formatter

Response

$this

loadKeychain

Load a keychain file into this object.

loadKeychain( keychainFile) : 
since

1.0

throws

RuntimeExceptionif the keychain file does not exist

CryptExceptionInterfaceif the keychain cannot be decrypted

Arguments

keychainFile

stringPath to the keychain file.

Response

$this

loadObject

Load the public variables of the object into the default namespace.

loadObject( object) : 
inherited
since

1.0.0

Arguments

object

objectThe object holding the publics to load

Response

$this

loadString

Load a string into the registry

loadString( data,  format = 'JSON', mixed||string|int options = []) : 
inherited
since

1.0.0

2.0.0

Arguments

data

stringString to load into the registry

format

stringFormat of the string

options

array<string|int, mixed>Options used by the formatter

Response

$this

merge

Merge a Registry object into this one

merge(\Joomla\Registry\Registry source,  recursive = false) : 
inherited
since

1.0.0

2.0.0

Arguments

source

RegistrySource Registry object to merge.

recursive

boolTrue to support recursive merge the children values.

Response

$this

offsetExists

Checks whether an offset exists in the iterator.

offsetExists( offset) : 
inherited
since

1.0.0

Arguments

offset

mixedThe array offset.

Response

boolTrue if the offset exists, false otherwise.

offsetGet

Gets an offset in the iterator.

offsetGet( offset) : 
inherited
since

1.0.0

Arguments

offset

mixedThe array offset.

Response

mixedThe array value if it exists, null otherwise.

offsetSet

Sets an offset in the iterator.

offsetSet( offset,  value) : 
inherited
since

1.0.0

Arguments

offset

mixedThe array offset.

value

mixedThe array value.

Response

void

offsetUnset

Unsets an offset in the iterator.

offsetUnset( offset) : 
inherited
since

1.0.0

Arguments

offset

mixedThe array offset.

Response

void

remove

Delete a registry value

remove( path) : 
inherited
since

1.6.0

Arguments

path

stringRegistry Path (e.g. joomla.content.showauthor)

Response

mixedThe value of the removed node or null if not set

saveKeychain

Save this keychain to a file.

saveKeychain( keychainFile) : 
since

1.0

throws

RuntimeExceptionif the keychain file path is invalid

CryptExceptionInterfaceif the keychain cannot be encrypted

Arguments

keychainFile

stringThe path to the keychain file.

Response

boolResult of storing the file.

set

Set a registry value.

set( path,  value,  separator = null) : 
inherited
since

1.0.0

Arguments

path

stringRegistry Path (e.g. joomla.content.showauthor)

value

mixedValue of entry

separator

stringThe key separator. Will be removed in version 4.

Response

mixedThe value of the that has been set.

toArray

Transforms a namespace to an array

toArray() : mixed||string|int
inherited
since

1.0.0

Response

array<string|int, mixed>An associative array holding the namespace data

toFlatten

Method to recursively convert data to one dimension array.

toFlatten( separator = null, array|object data = null, mixed||string|int &array = [],  prefix = '') : 
inherited
since

1.3.0

2.0.0

Arguments

separator

stringThe key separator.

data

array<string|int, mixed>|objectData source of this scope.

array

array<string|int, mixed>The result array, it is passed by reference.

prefix

stringLast level key prefix.

Response

void

toObject

Transforms a namespace to an object

toObject() : 
inherited
since

1.0.0

Response

objectAn an object holding the namespace data

toString

Get a namespace in a given string format

toString( format = 'JSON', mixed||string|int options = []) : 
inherited
since

1.0.0

Arguments

format

stringFormat to return the string in

options

array<string|int, mixed>Parameters used by the formatter, see formatters for more info

Response

stringNamespace in string format

Properties

data

Registry Object

inherited
since

1.0.0

Type(s)

stdClass

initialized

Flag if the Registry data object has been initialized

inherited
since

1.5.2

Type(s)

bool

separator

Path separator

inherited
since

1.4.0

Type(s)

string

crypt

The encryption handler.

since

2.0.0

Type(s)

Crypt