public function __construct(array $config) { if (!extension_loaded('redis')) { throw Storage\Error::require_extension('redis'); } if ($config) { $this->config = array_merge($this->config, $config); } }
<?php // README: Advanced Message Queue Protocol Service namespace Lysine\Storage; use AMQPChannel; use AMQPConnection; use AMQPEnvelope; use AMQPExchange; use AMQPQueue; if (!extension_loaded('amqp')) { throw Error::require_extension('amqp'); } class AMQP implements \Lysine\IStorage { private $connection; private $channel; public function __construct(array $config) { $this->connection = new AMQPConnection(self::prepareConfig($config)); } public function connection() { return $this->connection; } public function channel($new = false) { if (!$new && $this->channel) { return $this->channel; } $connection = $this->connection;