1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-22 00:56:08 +02:00

Check for json dependency, fixes #378

This commit is contained in:
Jordi Boggiano
2014-06-20 16:09:34 +02:00
parent 25b16e8019
commit 0951050a1e
2 changed files with 15 additions and 0 deletions

View File

@@ -30,6 +30,9 @@ class NormalizerFormatter implements FormatterInterface
public function __construct($dateFormat = null)
{
$this->dateFormat = $dateFormat ?: static::SIMPLE_DATE;
if (!function_exists('json_encode')) {
throw new \RuntimeException('PHP\'s json extension is required to use Monolog\'s NormalizerFormatter');
}
}
/**