The system registry is a simple table designed to store key-value pairs. This is not meant for heavy-duty storage, but just to store a couple of values, when having a separate database table is not warranted. A typical example is the Scheduler, which just needs to store information about its last run and not a full log.
The system registry can be used by any part of TYPO3 or any extension. The provided API makes it dead simple to use. Entries in the system registry are comprised of three parameters:
To use the registry, start by getting an instance of it:
$registry = t3lib_div::makeInstance('t3lib_Registry');
You can then use the following methods:
Here's a more complete example, taken from the Scheduler:
$registry = t3lib_div::makeInstance('t3lib_Registry');
$runInformation = array('start' => $GLOBALS['EXEC_TIME'], 'end' => time(), 'type' => $type);
$registry->set('tx_scheduler', 'lastRun', $runInformation);
At some other point, the value is retrieved with the following code:
$registry = t3lib_div::makeInstance('t3lib_Registry');
$lastRun = $registry->get('tx_scheduler', 'lastRun');
More information can be found in the Core APIs.
Enjoy!