| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3.3332 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 26 | 4 | public function __construct($database) |
|
| 27 | { |
||
| 28 | 4 | if (!is_readable($database)) { |
|
| 29 | $message = "The IP Database file \"{$database}\" does not exist or is not readable."; |
||
| 30 | |||
| 31 | throw new DbFileException($message); |
||
| 32 | } |
||
| 33 | |||
| 34 | 4 | $this->file = @fopen($database, 'rb'); |
|
| 35 | 4 | if (!is_resource($this->file)) { |
|
| 36 | throw new DbFileException("IP Database File opening \"{$database}\"."); |
||
| 37 | } |
||
| 38 | |||
| 39 | 4 | $this->database = $database; |
|
| 40 | |||
| 41 | 4 | $this->init(); |
|
| 42 | 4 | } |
|
| 84 |