Commit c5d20d18 authored by Tomáš Pospíšil's avatar Tomáš Pospíšil
Browse files

allow extra ips

parent 6c2cb52e
......@@ -96,12 +96,7 @@ final class Registrator
// }
}
/**
* @param string $errorDir
* @param string $emailDeveloper
* @return $this
*/
public function registerDebugger(string $errorDir, string $emailDeveloper): Registrator
public function registerDebugger(string $errorDir, string $emailDeveloper, array $extraIps = null): Registrator
{
FileSystem::createDir($errorDir);
......@@ -111,7 +106,13 @@ final class Registrator
Debugger::$strictMode = $currentSetting->isOn();
Debugger::$maxLength = 512;
Debugger::$maxDepth = 5;
Debugger::enable('42@84.42.168.182,42@185.156.123.46,42@178.77.200.253', realpath($errorDir), Strings::replace($emailDeveloper, '/,;/', ','));
$ips = $this->getIps($extraIps);
Debugger::enable(
implode(',', $ips),
realpath($errorDir),
Strings::replace($emailDeveloper, '/,;/', ',')
);
$this->addPanel(
__METHOD__,
......@@ -189,4 +190,22 @@ final class Registrator
return $this;
}
/**
* @param array|null $extraIps
* @return array|string[]
*/
private function getIps(?array $extraIps): array
{
$ips = [
'42@84.42.168.182',
'42@185.156.123.46',
'42@178.77.200.253',
];
if ($extraIps !== null) {
$ips = array_merge($ips, $extraIps);
}
return $ips;
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment