introducing automatic purging of expired pastes, triggered by default at least 5 minutes apart, deleting a maximum of 10 pastes - resolves #3
This commit is contained in:
@@ -35,6 +35,7 @@ class model
|
||||
* Factory constructor.
|
||||
*
|
||||
* @param configuration $conf
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(configuration $conf)
|
||||
{
|
||||
@@ -54,8 +55,24 @@ class model
|
||||
return $paste;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a purge is necessary and triggers it if yes.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function purge()
|
||||
{
|
||||
purgelimiter::setConfiguration($this->_conf);
|
||||
if (purgelimiter::canPurge())
|
||||
{
|
||||
$this->_getStore()->purge($this->_conf->getKey('batchsize', 'purge'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets, and creates if neccessary, a store object
|
||||
*
|
||||
* @return privatebin_abstract
|
||||
*/
|
||||
private function _getStore()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user