DoSomething/messagebroker-config — pull request #52 by DeeZone (2014-11-17 02:42:42+00:00)
Title: File cleanup and addition of MB_Configuration class

Fixes #47

Addition of MB_Configuration class file for PHP applications to include to provide tools related to Message Broker configurations.

**Use Case**:
- In application directory create sym link to `messagebroker-config` repo:
```
lrwxr-xr-x 1 darrenlee staff 58 Nov 16 21:19 messagebroker-config -> /Users/darrenlee/Sites/message-broker/messagebroker-config
```
- In application, load `MB_Configuration class file: `require __DIR__ . '/messagebroker-config/MessageBrokerConfig.class.inc';`
- Build $config settings array to pass to the MessageBroker class via the `MessageBrokerConfig` class method `exchangeSettings()`:
```
$config = array();
$source = __DIR__ . '/mb_config.json';
$mb_config = new MessageBrokerConfig($source, $settings);
$mb_exchange_directExternalApplicationsExchange = $mb_config->exchangeSettings('directExternalApplicationsExchange');

$config['exchange'] = array(
'name' => $mb_exchange_directExternalApplicationsExchange->name,
'type' => $mb_exchange_directExternalApplicationsExchange->type,
'passive' => $mb_exchange_directExternalApplicationsExchange->passive,
'durable' => $mb_exchange_directExternalApplicationsExchange->durable,
'auto_delete' => $mb_exchange_directExternalApplicationsExchange->auto_delete,
);
$config['queue'][] = array(
'name' => $mb_exchange_directExternalApplicationsExchange->queues->externalApplicationEventQueue->name,
'passive' => $mb_exchange_directExternalApplicationsExchange->queues->externalApplicationEventQueue->passive,
'durable' => $mb_exchange_directExternalApplicationsExchange->queues->externalApplicationEventQueue->durable,
'exclusive' => $mb_exchange_directExternalApplicationsExchange->queues->externalApplicationEventQueue->exclusive,
'auto_delete' => $mb_exchange_directExternalApplicationsExchange->queues->externalApplicationEventQueue->auto_delete,
'bindingKey' => $mb_exchange_directExternalApplicationsExchange->queues->externalApplicationEventQueue->binding_key,
);
```

Related:
https://github.com/DoSomething/mbc-externalApplications-services/pull/4