50 public function get($namespace, $key, $defaultValue = NULL) {
55 return isset($this->entries[$namespace][$key]) ? $this->entries[$namespace][$key] : $defaultValue;
75 public function set($namespace, $key, $value) {
80 $serializedValue = serialize($value);
81 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(
'uid',
'sys_registry',
'entry_namespace = ' .
$GLOBALS[
'TYPO3_DB']->fullQuoteStr($namespace,
'sys_registry') .
' AND entry_key = ' .
$GLOBALS[
'TYPO3_DB']->fullQuoteStr($key,
'sys_registry'));
82 if (
$GLOBALS[
'TYPO3_DB']->sql_num_rows($res) < 1) {
83 $GLOBALS[
'TYPO3_DB']->exec_INSERTquery(
'sys_registry', array(
84 'entry_namespace' => $namespace,
86 'entry_value' => $serializedValue
89 $GLOBALS[
'TYPO3_DB']->exec_UPDATEquery(
'sys_registry',
'entry_namespace = ' .
$GLOBALS[
'TYPO3_DB']->fullQuoteStr($namespace,
'sys_registry') .
' AND entry_key = ' .
$GLOBALS[
'TYPO3_DB']->fullQuoteStr($key,
'sys_registry'), array(
90 'entry_value' => $serializedValue
93 $this->entries[$namespace][$key] = $value;
104 public function remove($namespace, $key) {
106 $GLOBALS[
'TYPO3_DB']->exec_DELETEquery(
'sys_registry',
'entry_namespace = ' .
$GLOBALS[
'TYPO3_DB']->fullQuoteStr($namespace,
'sys_registry') .
' AND entry_key = ' .
$GLOBALS[
'TYPO3_DB']->fullQuoteStr($key,
'sys_registry'));
107 unset($this->entries[$namespace][$key]);
119 $GLOBALS[
'TYPO3_DB']->exec_DELETEquery(
'sys_registry',
'entry_namespace = ' .
$GLOBALS[
'TYPO3_DB']->fullQuoteStr($namespace,
'sys_registry'));
120 unset($this->entries[$namespace]);
131 return isset($this->loadedNamespaces[$namespace]);
143 $storedEntries =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetRows(
'*',
'sys_registry',
'entry_namespace = ' .
$GLOBALS[
'TYPO3_DB']->fullQuoteStr($namespace,
'sys_registry'));
144 foreach ($storedEntries as $storedEntry) {
145 $key = $storedEntry[
'entry_key'];
146 $this->entries[$namespace][$key] = unserialize($storedEntry[
'entry_value']);
148 $this->loadedNamespaces[$namespace] = TRUE;
163 if (strlen($namespace) < 2) {
164 throw new \InvalidArgumentException(
'Given namespace must be longer than two characters.', 1249755131);
removeAllByNamespace($namespace)
validateNamespace($namespace)
isNamespaceLoaded($namespace)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
loadEntriesByNamespace($namespace)