diff --git a/Command/DumpCommand.php b/Command/DumpCommand.php index c454129b..bb59ce31 100644 --- a/Command/DumpCommand.php +++ b/Command/DumpCommand.php @@ -95,6 +95,9 @@ private function watch(InputInterface $input, OutputInterface $output) $previously = array(); } else { $previously = unserialize(file_get_contents($cache)); + if (!is_array($previously)) { + $previously = array(); + } } $error = ''; @@ -112,14 +115,13 @@ private function watch(InputInterface $input, OutputInterface $output) file_put_contents($cache, serialize($previously)); $error = ''; - - sleep($input->getOption('period')); } catch (\Exception $e) { if ($error != $msg = $e->getMessage()) { $output->writeln('[error] '.$msg); $error = $msg; } } + sleep($input->getOption('period')); } }