conclude scaffolding of AbstractData key/value storage, missing implementation

This commit is contained in:
El RIDO 2021-06-07 07:02:47 +02:00
parent 1a7d0799c0
commit 7bdcc2ae15
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92
4 changed files with 94 additions and 7 deletions

View file

@ -28,12 +28,6 @@ abstract class AbstractData
*/
protected static $_instance = null;
protected static $_namespaces = array(
'purge_limiter',
'salt',
'traffic_limiter',
);
/**
* Enforce singleton, disable constructor
*

View file

@ -423,6 +423,46 @@ class Database extends AbstractData
);
}
/**
* Save a value.
*
* @access public
* @param string $value
* @param string $namespace
* @param string $key
* @return bool
*/
public function setValue($value, $namespace, $key = '')
{
switch ($namespace) {
case 'purge_limiter':
;
break;
case 'salt':
;
break;
case 'traffic_limiter':
;
break;
default:
return false;
break;
}
}
/**
* Load a value.
*
* @access public
* @param string $namespace
* @param string $key
* @return string
*/
public function getValue($namespace, $key = '')
{
}
/**
* Returns up to batch size number of paste ids that have expired
*

View file

@ -251,7 +251,20 @@ class Filesystem extends AbstractData
*/
public function setValue($value, $namespace, $key = '')
{
switch ($namespace) {
case 'purge_limiter':
;
break;
case 'salt':
;
break;
case 'traffic_limiter':
;
break;
default:
return false;
break;
}
}
/**

View file

@ -217,6 +217,46 @@ class GoogleCloudStorage extends AbstractData
return $o->exists();
}
/**
* Save a value.
*
* @access public
* @param string $value
* @param string $namespace
* @param string $key
* @return bool
*/
public function setValue($value, $namespace, $key = '')
{
switch ($namespace) {
case 'purge_limiter':
;
break;
case 'salt':
;
break;
case 'traffic_limiter':
;
break;
default:
return false;
break;
}
}
/**
* Load a value.
*
* @access public
* @param string $namespace
* @param string $key
* @return string
*/
public function getValue($namespace, $key = '')
{
}
/**
* @inheritDoc
*/