/** * Constructor for MBC_Mailchimp * * @param array $apiKey * The MailChimp API key to use for this instance of MailChip API activities. */ public function __construct($apiKey) { $this->mailChimp = new MailChimp($apiKey); $this->mbConfig = MB_Configuration::getInstance(); $this->statHat = $this->mbConfig->getProperty('statHat'); }
/** * Constructor for MB_Toolbox_BaseConsumer - all consumer applications should extend this base class. */ public function __construct($targetMBconfig = 'messageBroker') { $this->mbConfig = MB_Configuration::getInstance(); $this->messageBroker = $this->mbConfig->getProperty($targetMBconfig); $this->statHat = $this->mbConfig->getProperty('statHat'); $this->startTime = date('c'); }
/** * Constructor * * @param array $settings * Connection and configuration settings common to the application * * @return object */ public function __construct() { $this->auth = null; // Check for cURL on server if (!is_callable('curl_init')) { throw new Exception("Error - PHP cURL extension is not enabled on the server. cURL is required by many of the methods in the mb-toolbox library."); } $this->mbConfig = MB_Configuration::getInstance(); $this->statHat = $this->mbConfig->getProperty('statHat'); }
/** * Constructor for MBC_BaseConsumer - all consumer applications should extend this base class. * * @param string $targetMBconfig The Message Broker object used to interface the RabbitMQ server * exchanges and related queues. */ public function __construct($targetMBconfig = 'messageBroker') { $this->mbConfig = MB_Configuration::getInstance(); $this->settings = $this->mbConfig->getProperty('generalSettings'); $this->messageBroker = $this->mbConfig->getProperty($targetMBconfig); $this->messageBroker_deadLetter = $this->mbConfig->getProperty('messageBroker_deadLetter'); $this->statHat = $this->mbConfig->getProperty('statHat'); $this->mbRabbitMQManagementAPI = $this->mbConfig->getProperty('mbRabbitMQManagementAPI'); $connection = $this->messageBroker->connection; $this->channel = $connection->channel(); }
/** * __construct: When a new instance of the class is created it must include an email address. An * email address is the minimum value needed to work with Digest User related functionality. * * @parm string $email (required) * * @return boolean */ public function __construct($email) { // Validate structure and existing TLD (top level domain) for address if (filter_var($email, FILTER_VALIDATE_EMAIL)) { $this->email = $email; } else { return FALSE; } $this->mbConfig = MB_Configuration::getInstance(); $this->statHat = $this->mbConfig->getProperty('statHat'); $this->mbToolbox = $this->mbConfig->getProperty('mbToolbox'); }
/** * __construct(): When a new Consumer class is created at the time of starting the mbc-digest-script * this method will ensure key variables are constructed. */ public function __construct($batchSize) { $this->batchSize = $batchSize; parent::__construct(); // Future support of different Services other than Mandrill could be toggled. Currently the Mandrill // service is hard coded. There's no reason more than one service could be used at the same time // depending on the affiliates arrangements. Use of the different Service classes could be toggled with // logic for user origin. // See mbc-registration-mobile for working example of toggling based on user origin. $this->mbConfig = MB_Configuration::getInstance(); $this->mbcDEMessenger = $this->mbConfig->getProperty('mbcDEMessenger'); }
public function __construct() { // Application configuration $this->mbConfig = MB_Configuration::getInstance(); $this->messageBroker = $this->mbConfig->getProperty('messageBroker'); $this->statHat = $this->mbConfig->getProperty('statHat'); $this->mbToolbox = $this->mbConfig->getProperty('mbToolbox'); $this->mandrill = $this->mbConfig->getProperty('mandrill'); // Resources for building digest batch $this->userIndex = 0; $this->campaignTempate = parent::getTemplate('campaign-markup.inc'); $this->campaignTempateDivider = parent::getTemplate('campaign-divider-markup.inc'); $this->setGlobalMergeVars(); }
/** * Constructor for MB_RabbitMQManagementAPI * * @param array $config * Configuration settings from mb-config.inc */ public function __construct($conig) { $domain = 'http://' . $conig['domain']; $port = $conig['port']; $vhost = $conig['vhost']; $this->vhost = $vhost; $username = $conig['username']; $password = $conig['password']; if ($port > 0 && is_numeric($port)) { $domain .= ':' . (int) $port; } $this->rabbitManagement = new RabbitMqManagementApi(null, $domain, $username, $password); $this->mbConfig = MB_Configuration::getInstance(); $this->statHat = $this->mbConfig->getProperty('statHat'); }
/** * __construct(): Trigger populating values in Campaign object when object is created. * * @param integer $nid * nid (Drupal node ID) of the campaign content item. */ public function __construct($nid) { $this->mbConfig = MB_Configuration::getInstance(); $this->statHat = $this->mbConfig->getProperty('statHat'); $this->mbToolboxcURL = $this->mbConfig->getProperty('mbToolboxcURL'); $this->add($nid); }
/** * Constructor for MBC_Slack - gather config settings. */ public function __construct() { $this->mbConfig = MB_Configuration::getInstance(); $this->slackConfig = $this->mbConfig->getProperty('slack_config'); $this->statHat = $this->mbConfig->getProperty('statHat'); }