Closed mulquin closed 2 years ago
If you don't like the idea of a whole function for this, you could make HTTP_PROTO a ternary that sets to either http or https.
Again, pretty sensible. I was thinking about just making it one dumb config string without any $_SERVER
magic, for KISS reasons. But this gives you the choice to do either, which is nice.
Will have a proper look/test tomorrow probably.
This implementation removes HTTP_PROTO and replaces it with SITE_URL. I found going from dev/test on local machine and then deploying it, I forgot to change the string and was confused why my links weren't working lol. I understand wanting to keep it simple so this may not be the best approach for this script considering it's only an issue that happens very rarely.
Sorry, irl stuff kind of happened.
Generally lgtm, except the heredoc still has $url
in it, which is now undefined
Woops my mistake, updated :)
I'm thinking of closing this, it throws a notice up when purging files as HTTP_HOST is not set.
I'm thinking of closing this, it throws a notice up when purging files as HTTP_HOST is not set.
Ah yes, it does. You could just explicitly check for that though.
Done
This prevents the need to manually change the protocol and build site URLs when they are needed.
The ShareX and hupl configs need testing as I don't make use of those programs.