What are the Slack Archives?
Itβs a history of our time together in the Slack Community! Thereβs a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you wonβt be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
I want to get http_host for back office in spryker can anyone help how should i get it ?
I want to get http_host for back office in spryker
can anyone help how should i get it ?
Comments
-
You mean
getenv('SPRYKER_ZED_HOST')
...?0 -
i want to get $_SERVER['HTTP_HOST'] in spryker
but i do not know how to get it in spryker ?0 -
i want to verify wether it is http or https ?
0 -
If you have xdebug configured, then you can just set up a random breakpoint somewhere in PHPStorm, load a shop page and once the breakpoint is caught, you can check the value of
$_SERVER['HTTP_HOST']
in PHPStorm.0 -
i tried to print $_SERVER but i did not get HTTP_HOST in $_SERVER array ?
0 -
Try what I just described above and see if you can find it that way.
0 -
So like this:
0 -
Okay @U04FXCTCWPP
But i want to get http or https because i want to append this to third party url..and i do not have xdebug configured0 -
Well, at least in my case, the value I have for
$_SERVER['HTTP_HOST']
is the same what I see in my browser's URL bar. What do you see in yours? http or https?0 -
Also, for configuring xedbug (if you are using Docker):
https://docs.spryker.com/docs/scos/dev/the-docker-sdk/202204.0/configuring-debugging-in-docker.html
It is very helpful, you should try to set it.0 -
when i print $_SERVER i did not get HTTP_HOST
0 -
Where and how do you print this? Because you don't seem to have any
HTTP_
entries in there.
(Also, you should probably remove that copypaste from here or at least edit it and remove the private key from it, as for reasons of security, you should not share that publicly)0 -
yes i removed
0 -
So, where did you print that?
0 -
i print in my facade file...
0 -
And if you check the URL in your browser for the page you are on, what do you see there?
0 -
that is backoffice url
0 -
Because, as I mentioned above, the
$_SERVER['HTTP_HOST']
seems to be the same as what is in the browser's URL bar. So for example when I go to the Zed login page, the URL is:<http://backoffice.de.spryker.local/security-gui/login>
and the$_SERVER['HTTP_HOST']
value is:[backoffice.de](http://backoffice.de).spryker.local
0 -
So you should be able to derive that from the URL you see there, based on the above example.
0 -
Okay @U04FXCTCWPP
got it now
so i created one console command which do some db operations and after that i want to get the http or https what ever it may be ?
how should i get that ?0 -
I'm not sure if http even comes into the picture at all if you're only working with a console command. Seeing how you didn't have any
HTTP_
entries in your$_SERVER
, I think you might simply not have that there at all. But if what you really need is simply to know whether you are usinghttp
orhttps
, then you might simply check theSSL
settings in your config.0 -
And that should be available.
0 -
Use
getenv('SPRYKER_SSL_ENABLE')
0 -
Yep, as I suspected:
https://www.php.net/manual/en/reserved.variables.server.phpNote: When running PHP on the command line most of these entries will not be available or have any meaning.
0 -
Got that
getenv('SPRYKER_SSL_ENABLE') ? 'https' : 'http';
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 930 Developer Corner
- 788 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K π Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random