add IPv6 support
This commit is contained in:
parent
fdb115083e
commit
12ae8b180e
2 changed files with 13 additions and 2 deletions
|
|
@ -124,7 +124,18 @@
|
||||||
*/
|
*/
|
||||||
private function getAutoLogMode()
|
private function getAutoLogMode()
|
||||||
{
|
{
|
||||||
return ($_SERVER['SERVER_ADDR'] == '127.0.0.1' && !$this->autoLogToScreenDisabled) ? self::LOGMODE_SCREEN : self::LOGMODE_PHP;
|
return ($this->isLocalhost() && !$this->autoLogToScreenDisabled) ? self::LOGMODE_SCREEN : self::LOGMODE_PHP;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Detect if the server is running as localhost without domain.
|
||||||
|
*
|
||||||
|
* @return boolean Wheather server is running as localhost or not
|
||||||
|
*/
|
||||||
|
private function isLocalhost()
|
||||||
|
{
|
||||||
|
return ($_SERVER['SERVER_ADDR'] == '127.0.0.1' || $_SERVER['SERVER_ADDR'] = '::1');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
/**
|
/**
|
||||||
* De-/Activate error messages
|
* De-/Activate error messages
|
||||||
*/
|
*/
|
||||||
if($_SERVER['SERVER_ADDR'] == '127.0.0.1') {
|
if($_SERVER['SERVER_ADDR'] == '127.0.0.1' || $_SERVER['SERVER_ADDR'] == '::1') {
|
||||||
error_reporting(E_ALL);
|
error_reporting(E_ALL);
|
||||||
ini_set('display_errors', 1);
|
ini_set('display_errors', 1);
|
||||||
ini_set('log_errors', 0);
|
ini_set('log_errors', 0);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue