Public Attributes |
const | META = 'meta' |
const | REGISTRY = 'registry' |
Detailed Description
Definition at line 27 of file JSONStorage.php.
Constructor & Destructor Documentation
JSONStorage::__construct |
( |
|
$registry = null | ) |
|
JSONStorage::__destruct |
( |
| ) |
|
Member Function Documentation
JSONStorage::addRegistry |
( |
|
$registry | ) |
|
Add new collection name
- Parameters
-
string | $registry | the name of the registry (collection) to create |
- Returns
- bool
Definition at line 341 of file JSONStorage.php.
JSONStorage::decode |
( |
|
$data | ) |
|
|
private |
JSON decodes the data
- Parameters
-
- Returns
- mixed
Definition at line 415 of file JSONStorage.php.
JSONStorage::encode |
( |
|
$data | ) |
|
|
private |
JSON encodes the data
- Parameters
-
- Returns
- string
Definition at line 403 of file JSONStorage.php.
Saves the global registry to the file
- Returns
- bool
- Exceptions
-
Definition at line 373 of file JSONStorage.php.
JSONStorage::getData |
( |
|
$key, |
|
|
|
$registry = null |
|
) |
| |
Retrieves a data value from the registry
- Parameters
-
string | $key | the name of the key that holds the data |
null | $registry | the registry name |
- Returns
- mixed the data in the key value, null otherwise
Definition at line 255 of file JSONStorage.php.
JSONStorage::getLength |
( |
|
$registry = null | ) |
|
Retrieves the number of keys in registry
- Parameters
-
null | $registry | the registry name |
- Returns
- int the data length
Definition at line 299 of file JSONStorage.php.
JSONStorage::getRegistry |
( |
|
$registry | ) |
|
Retrieves a registry collection based on its name
- Parameters
-
string | $registry | the name of the registry to retrieve |
- Returns
- mixed|null the registry, null if none found
Definition at line 317 of file JSONStorage.php.
Loads registry data into memory
- Exceptions
-
Definition at line 190 of file JSONStorage.php.
JSONStorage::onAfterSave |
( |
|
$event | ) |
|
Fires after the registry has been saved
- Parameters
-
Definition at line 122 of file JSONStorage.php.
JSONStorage::onBeforeSave |
( |
|
$event | ) |
|
Fires before registry has been saved
- Parameters
-
Definition at line 112 of file JSONStorage.php.
JSONStorage::registryExists |
( |
|
$registry | ) |
|
Checkes whether a collection exists (registry)
- Parameters
-
string | $registry | the name of the registry to check existence |
- Returns
- bool
Definition at line 329 of file JSONStorage.php.
JSONStorage::removeData |
( |
|
$key, |
|
|
|
$registry = null |
|
) |
| |
Removes data from a key in the registry
- Parameters
-
string | $key | the key name that holds the data to remove |
null | $registry | the registry name |
- Returns
- bool true if successful, false otherwise
Definition at line 276 of file JSONStorage.php.
JSONStorage::removeRegistry |
( |
|
$registry | ) |
|
Remove an existing collection and all associated data
- Parameters
-
string | $registry | the name of the registry to remove |
- Returns
- bool
Definition at line 358 of file JSONStorage.php.
JSONStorage::setData |
( |
|
$key, |
|
|
|
$data, |
|
|
|
$registry = null |
|
) |
| |
Saves data to the registry
- Parameters
-
string | $key | the name of the key that will hold the data |
array | $data | the data to save |
null | $registry | the name of the registry |
- Returns
- bool
Definition at line 234 of file JSONStorage.php.
JSONStorage::setFile |
( |
|
$file | ) |
|
Property set file
- Parameters
-
string | $file | the filename to save the registry to |
Definition at line 158 of file JSONStorage.php.
JSONStorage::setPath |
( |
|
$path | ) |
|
Property set path
- Parameters
-
string | $path | the full path of the directory with read/write access to save the registry file to |
- Returns
- bool
- Exceptions
-
Definition at line 135 of file JSONStorage.php.
Member Data Documentation
Initial value: array(
self::META => array(
"updated" => "",
"hash" => ""
),
self::REGISTRY => array(
"default" => array(
"foo" => "bar"
)
)
)
Definition at line 63 of file JSONStorage.php.
JSONStorage::$default = "default" |
|
protected |
JSONStorage::$dirty = false |
|
protected |
JSONStorage::$filename = 'registry.json' |
|
protected |
const JSONStorage::META = 'meta' |
const string the key to keep value information
Definition at line 32 of file JSONStorage.php.
const JSONStorage::REGISTRY = 'registry' |
The documentation for this class was generated from the following file: