Work on adding image upload to add-show form

This commit is contained in:
Duncan Sommerville 2014-09-12 18:05:24 -04:00
parent cc3ddb40ea
commit cb80423fdd
8 changed files with 151 additions and 58 deletions

View file

@ -129,45 +129,49 @@ class Application_Model_RabbitMq
}
public static function SendMessageToHaproxyConfigDaemon($md){
$config = parse_ini_file("/etc/airtime-saas/rabbitmq.ini", true);
$conn = new AMQPConnection($config["rabbitmq"]["host"],
$config["rabbitmq"]["port"],
$config["rabbitmq"]["user"],
$config["rabbitmq"]["password"],
$config["rabbitmq"]["vhost"]);
/**
* Disabled to prevent warnings about /etc/airtime-saas/rabbitmq.ini
*/
// public static function SendMessageToHaproxyConfigDaemon($md){
// $config = parse_ini_file("/etc/airtime-saas/rabbitmq.ini", true);
// $conn = new AMQPConnection($config["rabbitmq"]["host"],
// $config["rabbitmq"]["port"],
// $config["rabbitmq"]["user"],
// $config["rabbitmq"]["password"],
// $config["rabbitmq"]["vhost"]);
$exchange = $config["rabbitmq"]["queue"];
$queue = $config["rabbitmq"]["queue"];
// $exchange = $config["rabbitmq"]["queue"];
// $queue = $config["rabbitmq"]["queue"];
$ch = $conn->channel();
// $ch = $conn->channel();
/*
name: $queue
passive: false
durable: true // the queue will survive server restarts
exclusive: false // the queue can be accessed in other channels
auto_delete: false //the queue won't be deleted once the channel is closed.
*/
$ch->queue_declare($queue, false, true, false, false);
// /*
// name: $queue
// passive: false
// durable: true // the queue will survive server restarts
// exclusive: false // the queue can be accessed in other channels
// auto_delete: false //the queue won't be deleted once the channel is closed.
// */
// $ch->queue_declare($queue, false, true, false, false);
/*
name: $exchange
type: direct
passive: false
durable: true // the exchange will survive server restarts
auto_delete: false //the exchange won't be deleted once the channel is closed.
*/
// /*
// name: $exchange
// type: direct
// passive: false
// durable: true // the exchange will survive server restarts
// auto_delete: false //the exchange won't be deleted once the channel is closed.
// */
$ch->exchange_declare($exchange, 'direct', false, true, false);
$ch->queue_bind($queue, $exchange);
// $ch->exchange_declare($exchange, 'direct', false, true, false);
// $ch->queue_bind($queue, $exchange);
$data = json_encode($md).PHP_EOL;
$msg = new AMQPMessage($data, array('content_type' => 'application/json'));
// $data = json_encode($md).PHP_EOL;
// $msg = new AMQPMessage($data, array('content_type' => 'application/json'));
$ch->basic_publish($msg, $exchange);
$ch->close();
$conn->close();
}
// $ch->basic_publish($msg, $exchange);
// $ch->close();
// $conn->close();
// }
}