Fix missing AMQPConnection errors in setup

Also fixes them elsewhere, apart from having switched to a vendorized version, I also used one that is already namespaced.

The easy way out here is to use it in the namespaced fashion, it is only used in a few places and I know the library well enough to be certain that nothing much changed apart from the namespacing.
This commit is contained in:
Lucas Bickel 2017-03-02 12:37:39 +01:00
parent 7f3f420763
commit 21a319767f
4 changed files with 11 additions and 6 deletions

View file

@ -16,7 +16,7 @@ class Application_Model_RabbitMq
{
$CC_CONFIG = Config::getConfig();
$conn = new AMQPConnection($CC_CONFIG["rabbitmq"]["host"],
$conn = new \PhpAmqpLib\Connection\AMQPConnection($CC_CONFIG["rabbitmq"]["host"],
$CC_CONFIG["rabbitmq"]["port"],
$CC_CONFIG["rabbitmq"]["user"],
$CC_CONFIG["rabbitmq"]["password"],
@ -34,7 +34,7 @@ class Application_Model_RabbitMq
//the way it is just so I don't accidentally break anything when I add the Analyzer code in. -- Albert, March 13, 2014
$channel->exchange_declare($exchange, $exchangeType, false, true, $autoDeleteExchange);
$msg = new AMQPMessage($data, array('content_type' => 'text/plain'));
$msg = new \PhpAmqpLib\Message\AMQPMessage($data, array('content_type' => 'text/plain'));
$channel->basic_publish($msg, $exchange);
$channel->close();
@ -99,7 +99,7 @@ class Application_Model_RabbitMq
$callbackUrl, $apiKey, $storageBackend, $filePrefix)
{
$config = parse_ini_file(self::getRmqConfigPath(), true);
$conn = new AMQPConnection($config["rabbitmq"]["host"],
$conn = new \PhpAmqpLib\Connection\AMQPConnection($config["rabbitmq"]["host"],
$config["rabbitmq"]["port"],
$config["rabbitmq"]["user"],
$config["rabbitmq"]["password"],
@ -138,7 +138,7 @@ class Application_Model_RabbitMq
//the way it is just so I don't accidentally break anything when I add the Analyzer code in. -- Albert, March 13, 2014
$channel->exchange_declare($exchange, $exchangeType, false, true, $autoDeleteExchange);
$msg = new AMQPMessage($jsonData, array('content_type' => 'text/plain'));
$msg = new \PhpAmqpLib\Message\AMQPMessage($jsonData, array('content_type' => 'text/plain'));
$channel->basic_publish($msg, $exchange);
$channel->close();