Lets get rid of this global..Symfony's request provides isSecure method which is better
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | drupal-replace_is_https-1960344-16.patch | 11.63 KB | ParisLiakos |
| #12 | drupal-replace_is_https-1960344-12.patch | 11.67 KB | ParisLiakos |
| #12 | interdiff.txt | 634 bytes | ParisLiakos |
| #10 | drupal-replace_is_https-1960344-10.patch | 11.39 KB | ParisLiakos |
| #4 | drupal-replace_is_https-1960344-4.patch | 14.12 KB | kid_icarus |
Comments
Comment #1
ParisLiakos commentedwell, i ll wait for #1847768: Remove ip_address() i kinda have to do the same work i did there already
Comment #2
ParisLiakos commentedwont be that hard after the issue above is in, so unnassigning and tagging novice
Replace
$is_httpsglobal variable withDrupal::request()->isSecure();Comment #3
ParisLiakos commentedblocker is in:)
Comment #4
kid_icarus commentedOk, here is my first attempt. I think this is pretty close to there, except for one little piece.
I'm confused on how to treat this little snippet at the bottom of core/modules/language/lib/Drupal/language/Tests/LanguageUILanguageNegotiationTest.php (lines 470-477).
I'm not quite sure what this is doing, but what raises a red flag for me is assigning $is_https to TRUE:
Feedback greatly appreciated :)
Comment #6
berdirIf you use this in classes, you need \Drupal
Comment #7
ParisLiakos commentedthank you kid_icarus!
in
drupal_settings_initialize()is probably too early, we dont even have a kernel yet, so i guess we can leave the old logic there but just remove the global declaration on the topabout the test, you should create a dummy request in the test setUp() function, store it to $this->request and set it to the container..then when it is assigning the global variable to TRUE you could set the server https variable to "on" or 1
Something like this:
Comment #8
kid_icarus commented@Berdir @rootawc
Thank you for the feedback :) I'll address this tonight!
Comment #9
tsphethean commentedThis is also a sub-task of #1956180: [meta] Remove global variables
Comment #10
ParisLiakos commentedhappened to be in the hood..here we go
Comment #12
ParisLiakos commentedwhat a nice hacky way we have to test https:)
Comment #13
Crell commentedThe conversions in #12 all look reasonable. Thanks, team!
Comment #14
damien tournoud commentedYes, that's part of the bootstrap cleanup that need to happen. Our whole container (and as a consequence the whole kernel) depends on the request (because the configuration path depends on the request). So we need to change the bootstrap from:
... into something more like:
And at the same time, we can implement
DrupalKernel::createForSite($url)for command line tools like Drush to use.Comment #15
alexpottPostponing on #1888424: Make Drupal's URL generation logic available to HttpKernel, and minimize code repetition/divergence as this patch conflicts
Comment #16
ParisLiakos commentedissue above has no longer avoid commit conflicts tag, here is a reroll since previous patch stopped applying
Comment #17
ParisLiakos commentedback to rtbc
Comment #18
alexpottI think #14 is part of a larger issue and this patch gets us some of the way there and removes a global to boot :)
I've tested installation under https and general usage everything appears to be working just fine.
Committed 2784f48 and pushed to 8.x. Thanks!
Comment #19
ParisLiakos commentedyay!
change notice: https://drupal.org/node/1983438
related meta #1956180: [meta] Remove global variables
Comment #20
ParisLiakos commentedstatus