Hi!
isDev use $_SERVER['HTTP_HOST'] for checking $dev_servers.
I think he should also use $_SERVER[REMOTE_ADDR], right?
In this way, we could use a remote address to work in development mode. :)
Regards,
Jose A.
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
Hi!
isDev use $_SERVER['HTTP_HOST'] for checking $dev_servers.
I think he should also use $_SERVER[REMOTE_ADDR], right?
In this way, we could use a remote address to work in development mode. :)
Regards,
Jose A.
Have a look at using _ss_environment.php for this.
Thanks Simon,
Indeed, we can do something like this (_config.php):
if(isset($_SERVER['REMOTE_ADDR']) && ($_SERVER['REMOTE_ADDR'] == '127.0.0.1' || ($_SERVER['REMOTE_ADDR'] == '<my_ip>'))) {
Director::set_environment_type('dev');
} else {
Director::set_environment_type('live');
}
but, no bad thing that isDev also take into account $_SERVER['REMOTE_ADDR'].
Thank you very much Simon.
Regards,
Jose A.