Tuleap Community Edition development and releases are no longer public. You have until September 30th to download packages and sources in Tuleap project. You can contact the team if you need further assistance.

    •  
      request #43339 Unify retrieval of request time
    Infos
    #43339
    Nicolas Terray (nterray)
    2025-11-18 21:09
    2025-06-05 08:44
    45088
    Details
    Unify retrieval of request time

    There are several ways to retrieve the request time in Tuleap:

    • $request->getTime()
    • $_SERVER['REQUEST_TIME']
    • RequestTime::getTimestamp()

    For the sake of consistency, we should keep only one way. RequestTime::getTimestamp() is the safest because it does not trust that the global array $_SERVER contains 'REQUEST_TIME' key.

    Empty
    All
    Empty
    • [ ] enhancement
    • [x] internal improvement
    Empty
    Stage
    Empty
    New
    Empty
    Attachments
    Empty
    References
    References list is empty

    Follow-ups

    User avatar

    I agree. I suggest to convert to RequestTime::getTimestamp() first. Then it will be easier to use PSR 20.

    User avatar
    Thomas Gerbet (tgerbet)2025-06-05 09:14

    Outside very specific use cases all these 3 should probably be dropped in favor of a PSR 20 Clock implementation (we already pull lcobucci/clock transitively BTW)