We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 8ab98b72 authored by mattl's avatar mattl

getLeaseRemaining for FeedSub too

parent 377947c5
......@@ -108,6 +108,14 @@ class FeedSub extends Managed_DataObject
return $this->uri;
}
function getLeaseRemaining()
{
if (empty($this->sub_end)) {
return null;
}
return strtotime($this->sub_end) - time();
}
/**
* Do we have a hub? Then we are a PuSH feed.
* https://en.wikipedia.org/wiki/PubSubHubbub
......
......@@ -81,6 +81,8 @@ function showSub($sub)
print " Verify token: $sub->verify_token\n";
print " Signature secret: $sub->secret\n";
print " Sub start date: $sub->sub_start\n";
print " Sub end date: $sub->sub_end\n";
print " Sub lease remaining: {$sub->getLeaseRemaining()}\n";
print " Record created: $sub->created\n";
print " Record modified: $sub->modified\n";
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment