Keychain

Extends Registry

Keychain Class

since

1.0

package

Joomla Framework

Methods

__clone

Magic function to clone the registry object.

__clone() : void
inherited
since

1.0

__construct

Constructor

__construct(mixed data = null) : mixed
inherited
since

1.0

Arguments

data

mixedThe data to bind to the new Registry object.

Response

mixed

__toString

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

__toString() : string
inherited
since

1.0

Response

string

append

Append value to a path in registry

append(string path, mixed value) : mixed
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(object data) : array
inherited
since

1.0

Arguments

data

objectAn object of data to return as an array.

Response

arrayArray representation of the input object.

bindData

Method to recursively bind data to a parent object.

bindData(object parent, mixed data, bool recursive = true, bool allowNull = true) : void
inherited
since

1.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.

count

Count elements of the data object

count() : int
inherited
link
since

1.3.0

Response

intThe custom count as an integer.

createPassphraseFile

Create a passphrase file

createPassphraseFile(string passphrase, string passphraseFile, string privateKeyFile, string privateKeyPassphrase) : bool
since

1.0

throws

\RuntimeException

Arguments

passphrase

stringThe passphrase to store in the passphrase file.

passphraseFile

stringPath to the passphrase file to create.

privateKeyFile

stringPath to the private key file to encrypt the passphrase file.

privateKeyPassphrase

stringThe passphrase for the private key.

Response

boolResult of writing the passphrase file to disk.

def

Sets a default value if not already assigned.

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

1.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).

deleteValue

Delete a registry value (very simple method)

deleteValue(string path) : mixed
deprecated
since

1.0

deprecated

2.0 Use Registry::remove() instead.

Arguments

path

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

Response

mixedValue of old value or boolean false if operation failed

exists

Check if a registry path exists.

exists(string path) : bool
inherited
since

1.0

Arguments

path

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

Response

bool

extract

Method to extract a sub-registry from path

extract(string path) : \Joomla\Registry\Registry|null
inherited
since

1.2.0

Arguments

path

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

Response

\Joomla\Registry\Registry|nullRegistry object if data is present

flatten

Dump to one dimension array.

flatten(string separator = null) : string[]
inherited
since

1.3.0

Arguments

separator

stringThe key separator.

Response

string[]Dumped array.

get

Get a registry value.

get(string path, mixed default = null) : mixed
inherited
since

1.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

getInstance

Returns a reference to a global Registry object, only creating it if it doesn't already exist.

getInstance(string id) : \Joomla\Registry\Registry
inherited static deprecated

This method must be invoked as:

$registry = Registry::getInstance($id);
since

1.0

deprecated

2.0 Instantiate a new Registry instance instead

Arguments

id

stringAn ID for the registry instance

Response

\Joomla\Registry\RegistryThe Registry object.

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.

getPassphraseFromFile

Get the passphrase for this keychain

getPassphraseFromFile(string passphraseFile, string publicKeyFile) : string
since

1.0

throws

\RuntimeException

Arguments

passphraseFile

stringThe file containing the passphrase to encrypt and decrypt.

publicKeyFile

stringThe file containing the public key to decrypt the passphrase file.

Response

stringThe passphrase in from passphraseFile

jsonSerialize

Implementation for the JsonSerializable interface.

jsonSerialize() : object
inherited

Allows us to pass Registry objects to json_encode.

since

1.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(array array, bool flattened = false, string separator = null) : \Joomla\Registry\Registry
inherited
since

1.0

Arguments

array

arrayAssociative array of value to load

flattened

boolLoad from a one-dimensional array

separator

stringThe key separator

Response

\Joomla\Registry\RegistryReturn this object to support chaining.

loadFile

Load the contents of a file into the registry

loadFile(string file, string format = 'JSON', array options = array()) : \Joomla\Registry\Registry
inherited
since

1.0

Arguments

file

stringPath to file to load

format

stringFormat of the file [optional: defaults to JSON]

options

arrayOptions used by the formatter

Response

\Joomla\Registry\RegistryReturn this object to support chaining.

loadKeychain

Load a keychain file into this object.

loadKeychain(string keychainFile, string passphraseFile, string publicKeyFile) : bool
since

1.0

throws

\RuntimeException

Arguments

keychainFile

stringPath to the keychain file.

passphraseFile

stringThe path to the passphrase file to decript the keychain.

publicKeyFile

stringThe file containing the public key to decrypt the passphrase file.

Response

boolResult of loading the object.

loadObject

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

loadObject(object object) : \Joomla\Registry\Registry
inherited
since

1.0

Arguments

object

objectThe object holding the publics to load

Response

\Joomla\Registry\RegistryReturn this object to support chaining.

loadString

Load a string into the registry

loadString(string data, string format = 'JSON', array options = array()) : \Joomla\Registry\Registry
inherited
since

1.0

Arguments

data

stringString to load into the registry

format

stringFormat of the string

options

arrayOptions used by the formatter

Response

\Joomla\Registry\RegistryReturn this object to support chaining.

merge

Merge a Registry object into this one

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

1.0

Arguments

source

\Joomla\Registry\RegistrySource Registry object to merge.

recursive

boolTrue to support recursive merge the children values.

Response

\Joomla\Registry\Registry|falseReturn this object to support chaining or false if $source is not an instance of Registry.

offsetExists

Checks whether an offset exists in the iterator.

offsetExists(mixed offset) : bool
inherited
since

1.0

Arguments

offset

mixedThe array offset.

Response

boolTrue if the offset exists, false otherwise.

offsetGet

Gets an offset in the iterator.

offsetGet(mixed offset) : mixed
inherited
since

1.0

Arguments

offset

mixedThe array offset.

Response

mixedThe array value if it exists, null otherwise.

offsetSet

Sets an offset in the iterator.

offsetSet(mixed offset, mixed value) : void
inherited
since

1.0

Arguments

offset

mixedThe array offset.

value

mixedThe array value.

offsetUnset

Unsets an offset in the iterator.

offsetUnset(mixed offset) : void
inherited
since

1.0

Arguments

offset

mixedThe array offset.

remove

Delete a registry value

remove(string path) : mixed
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(string keychainFile, string passphraseFile, string publicKeyFile) : bool
since

1.0

throws

\RuntimeException

Arguments

keychainFile

stringThe path to the keychain file.

passphraseFile

stringThe path to the passphrase file to encrypt the keychain.

publicKeyFile

stringThe file containing the public key to decrypt the passphrase file.

Response

boolResult of storing the file.

set

Set a registry value.

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

1.0

Arguments

path

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

value

mixedValue of entry

separator

stringThe key separator

Response

mixedThe value of the that has been set.

toArray

Transforms a namespace to an array

toArray() : array
inherited
since

1.0

Response

arrayAn associative array holding the namespace data

toFlatten

Method to recursively convert data to one dimension array.

toFlatten(string separator = null, array|object data = null, array &array = array(), string prefix = '') : void
inherited
since

1.3.0

Arguments

separator

stringThe key separator.

data

array|objectData source of this scope.

array

arrayThe result array, it is passed by reference.

prefix

stringLast level key prefix.

toObject

Transforms a namespace to an object

toObject() : object
inherited
since

1.0

Response

objectAn an object holding the namespace data

toString

Get a namespace in a given string format

toString(string format = 'JSON', mixed options = array()) : string
inherited
since

1.0

Arguments

format

stringFormat to return the string in

options

mixedParameters used by the formatter, see formatters for more info

Response

stringNamespace in string format

Properties

method

Method to use for encryption.

since

1.0

Type(s)

string

iv

Initialisation vector for encryption method.

since

1.0

Type(s)

string

data

Registry Object

inherited
since

1.0

Type(s)

\stdClass

initialized

Flag if the Registry data object has been initialized

inherited
since

1.5.2

Type(s)

bool

instances

Registry instances container.

inherited static deprecated
since

1.0

deprecated

2.0 Object caching will no longer be supported

Type(s)

\Joomla\Registry\Registry[]

separator

Path separator

inherited
since

1.4.0

Type(s)

string