* of seconds.
*
* @var integer
- * @see $gc_probability
+ * @see $gc_probability, $gc_maxlifetime
* @access public
*/
var $gc_time = 1;
* TODO: Add an explanation.
*
* @var integer 0 => never
- * @see $gc_time
+ * @see $gc_time, $gc_maxlifetime
* @access public
*/
var $gc_probability = 1;
+
+ /**
+ * Garbage collection: delete all entries not use for n seconds.
+ *
+ * Default is one day, 60 * 60 * 24 = 86400 seconds.
+ *
+ * @var integer
+ * @see $gc_probability, $gc_time
+ */
+ var $gc_maxlifetime = 86400;
/**
* Storage container object.
// time and probability based
if (($force) || ($last_run && $last_run < time() + $this->gc_time) || (rand(1, 100) < $this->gc_probability)) {
- $this->container->garbageCollection();
+ $this->container->garbageCollection($this->gc_maxlifetime);
$last_run = time();
}
} // end func garbageCollection