Closed GoogleCodeExporter closed 9 years ago
Sounds like this:
http://code.google.com/p/mollify/wiki/BackendSettings#Host_public_address_(_host
_public_address_)
Original comment by samuli.j...@gmail.com
on 10 Nov 2011 at 6:44
the problem is that if I set the variable
"host_public_address" => "http://10.220.100.18"
I have the same error, cannot resolve address.
the method to resolve address in this framework is little complicated, maybe we
can rewrite in a simplest way...
What do you think?
However, thanks for this great work...
Original comment by A.Monteb...@gmail.com
on 10 Nov 2011 at 7:20
If you still get the same error, it means that the setting is not defined
correctly.
This is how the host is determined:
private function getHost() {
if (!$this->settings->hasSetting("host_public_address")) {
if (!isset($_SERVER['HTTP_REFERER'])) throw new ServiceException("Cannot resolve host");
$protocol = substr($_SERVER['HTTP_REFERER'], 0, strpos($_SERVER['HTTP_REFERER'], ":"));
$start = strlen($protocol) + 3;
$end = strpos($_SERVER['HTTP_REFERER'], "/", $start);
if ($end > 0)
$host = substr($_SERVER['HTTP_REFERER'], $start, $end - $start);
else
$host = substr($_SERVER['HTTP_REFERER'], $start);
return $protocol."://".$host;
}
return $this->settings->setting("host_public_address");
}
You can see that this error is not thrown if the setting exists.
Of course, please tell me how to determine the host without the setting,
haven't found any better solution so far.
Original comment by samuli.j...@gmail.com
on 10 Nov 2011 at 7:52
Forgot to clarify, that this setting goes to configuration.php $SETTINGS, so
it's not a variable itself.
Original comment by samuli.j...@gmail.com
on 10 Nov 2011 at 8:23
Thanks Samuli,
in fact if I set the proper ip in configuration.php the error gone...
just for other guys that have the same error, edit configuration.php and insert
this line:
$SETTINGS = array(
"debug" => TRUE,
"host_public_address" => "http://ip_address_ord_dns/folder_where_mollify_is_installed",
);
Thanks for your suggestion, the function getHost is write well.
A.
Original comment by A.Monteb...@gmail.com
on 10 Nov 2011 at 8:42
Great!
Original comment by samuli.j...@gmail.com
on 10 Nov 2011 at 8:45
Original issue reported on code.google.com by
A.Monteb...@gmail.com
on 6 Nov 2011 at 10:23