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

Add version check for the AWS SDK, refs #260

This commit is contained in:
Jordi Boggiano
2013-11-11 23:14:40 +01:00
parent 3987f88f2c
commit 516447f913

View File

@@ -11,6 +11,7 @@
namespace Monolog\Handler;
use Aws\Common\Aws;
use Aws\DynamoDb\DynamoDbClient;
use Monolog\Formatter\ScalarFormatter;
use Monolog\Handler\AbstractProcessingHandler;
@@ -44,6 +45,10 @@ class DynamoDbHandler extends AbstractProcessingHandler
*/
public function __construct(DynamoDbClient $client, $table, $level = Logger::DEBUG, $bubble = true)
{
if (!defined('Aws\Common\Aws::VERSION') || version_compare('3.0', Aws::VERSION, '<=')) {
throw new \RuntimeException('The DynamoDbHandler is only known to work with the AWS SDK 2.x releases');
}
$this->client = $client;
$this->table = $table;