| @@ 20-30 (lines=11) @@ | ||
| 17 | { |
|
| 18 | $ips = explode("\n", $this->getStreamData($data)->getContents()); |
|
| 19 | $ips = array_filter($ips, 'ip2long'); |
|
| 20 | if (count($ips) < $this->getParseWarningThreshold()) { |
|
| 21 | $this->logger->warning( |
|
| 22 | 'Number of Tor exit nodes found when parsing is low.', |
|
| 23 | ['exit-node-count' => count($ips)] |
|
| 24 | ); |
|
| 25 | } else { |
|
| 26 | $this->logger->info( |
|
| 27 | 'Tor exit nodes parsed from blutmagie.de', |
|
| 28 | ['exit-node-count' => count($ips)] |
|
| 29 | ); |
|
| 30 | } |
|
| 31 | return new IpList($ips); |
|
| 32 | } |
|
| 33 | } |
|
| @@ 25-35 (lines=11) @@ | ||
| 22 | $contents = stream_get_contents($resource); |
|
| 23 | ||
| 24 | $ips = $contents ? explode(',', $contents) : []; |
|
| 25 | if (count($ips) < $this->getParseWarningThreshold()) { |
|
| 26 | $this->logger->warning( |
|
| 27 | 'Number of Tor exit nodes found when parsing is low.', |
|
| 28 | ['exit-node-count' => count($ips)] |
|
| 29 | ); |
|
| 30 | } else { |
|
| 31 | $this->logger->info( |
|
| 32 | 'Tor exit-nodes parsed from Tor project.', |
|
| 33 | ['exit-node-count' => count($ips)] |
|
| 34 | ); |
|
| 35 | } |
|
| 36 | return new IpList($ips); |
|
| 37 | } |
|
| 38 | } |
|