Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem/Motivation
#1209470: REQUEST_TIME is a float with microseconds on PHP 5.4 introduced casts on REQUEST_TIME because of a temporary change in PHP5.4. We can remove them.
Proposed resolution
- remove the cast from the define()
- remove casts from usages of $_SERVER['REQUEST_TIME']
- remove casts from usages of $this->requestStack->getMasterRequest()->server->get('REQUEST_TIME') (and similar usages where REQUEST_TIME is retrieved from something injected or \Drupal::request() or \Drupal::requestStack()).
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#8 | interdiff.txt | 1.57 KB | nachosalvador |
#8 | request_time_is_a_float-2862477-8.patch | 13.39 KB | nachosalvador |
#4 | request_time_is_a_float-2862477-3.patch | 12.97 KB | nachosalvador |
#2 | request_time_is_a_float-1209470-32.patch | 12.99 KB | mpdonadio |
Comments
Comment #2
mpdonadioSee attached for work in progress; this needs to be rerolled for 8.4.x.
I will get issue credits transferred over.
Comment #3
nachosalvador CreditAttribution: nachosalvador as a volunteer commentedComment #4
nachosalvador CreditAttribution: nachosalvador as a volunteer commentedRerolled for 8.4.x
Comment #5
nachosalvador CreditAttribution: nachosalvador as a volunteer commentedComment #7
mpdonadioLooks good; still need to get the credit list over, but there is at least one more usage:
Comment #8
nachosalvador CreditAttribution: nachosalvador as a volunteer commentedGood catch! :)
Included in this new patch.
Comment #9
mpdonadioNeed to do a proper review with it applied.
Looks like Munavijayalakshmi, anchal29, mpdonadio had patches on the other issue for 8.x
Looks like jibran, gnuget, agomezmoron reviewed the 8.x patches.
Comment #10
mpdonadioOk, looked at #8
That is good. Manually looked at patch, and don't see any out-of-scope oopsies.
brings up non casts, and two odd intval() in DateHelper, but I think that is OOS.
I scanned
but there are 349 uses(!) of REQUEST_TIME in one form or another. Nothing popped out at me.
This looks good to me. You could say it has some of my work in it from a while ago, so I feel a little uneasy setting RTBC on this.
Comment #11
osopolarJust wondering, about
define('REQUEST_TIME', $_SERVER['REQUEST_TIME']);
, as it is said there:Wouldn't it make sense to actually use
\Drupal::time()->getRequestTime();
everywhere else in the patch, where$_SERVER['REQUEST_TIME']
is used?Comment #23
quietone CreditAttribution: quietone at PreviousNext commentedREQUEST_TIME was deprecated in Drupal 8.3.0, https://www.drupal.org/node/2785211. Therefor, closing as outdated.