$objectTypes = ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.visitTracker.objectType');
foreach ($objectTypes as $objectType) {
$visitLifetime = 120 * 86400;
- \assert($visitLifetime > VisitTracker::DEFAULT_LIFETIME);
- $lifetime = \max($objectType->lifetime ?: 0, $visitLifetime);
+ \assert($visitLifetime > VisitTracker::LIFETIME);
// delete data
$statement1->execute([
$objectType->objectTypeID,
- TIME_NOW - $lifetime,
+ TIME_NOW - $visitLifetime,
]);
$statement2->execute([
$objectType->objectTypeID,
- TIME_NOW - $lifetime,
+ TIME_NOW - $visitLifetime,
]);
}
WCF::getDB()->commitTransaction();
class VisitTracker extends SingletonFactory
{
/**
- * default tracking lifetime
- * @var int
+ * @deprecated 5.5 Use VisitTracker::LIFETIME instead.
*/
- const DEFAULT_LIFETIME = 31 * 86400;
+ const DEFAULT_LIFETIME = self::LIFETIME;
+
+ /**
+ * Objects older than this are considered visited.
+ * @since 5.5
+ */
+ public const LIFETIME = 31 * 86400;
/**
* list of available object types
}
}
- $lifetime = ($this->availableObjectTypes[$objectType]->lifetime) ?: self::DEFAULT_LIFETIME;
- $minimum = TIME_NOW - $lifetime;
+ $minimum = TIME_NOW - self::LIFETIME;
if (WCF::getUser()->userID) {
// Mark everything before the registration date as read.