Ref T11357. When creating a file, callers can currently specify a ttl. However, it isn't unambiguous what you're supposed to pass, and some callers get it wrong.
For example, to mean "this file expires in 60 minutes", you might pass either of these:
- time() + phutil_units('60 minutes in seconds')
- phutil_units('60 minutes in seconds')
The former means "60 minutes from now". The latter means "1 AM, January 1, 1970". In practice, because the GC normally runs only once every four hours (at least, until recently), and all the bad TTLs are cases where files are normally accessed immediately, these 1970 TTLs didn't cause any real problems.
Split ttl into ttl.relative and ttl.absolute, and make sure the values are sane. Then correct all callers, and simplify out the time() calls where possible to make switching to PhabricatorTime easier.