2 namespace callnotifier;
6 public function __construct($config, $handler)
8 $this->config = $config;
9 $this->handler = $handler;
14 $file = $this->config->replayFile;
15 if (!file_exists($file)) {
16 throw new \Exception('Replay file does not exist');
19 $handle = fopen($file, 'r');
21 throw new \Exception('Cannot open replay file for reading');
24 while (($line = fgets($handle, 4096)) !== false) {
25 $this->handler->handle($line);
28 throw new \Exception('unexpected fgets() fail');