You are here

function sms_bootstrap_load_queue in SMS Framework 7

Load and return the appropriate queue.

If an alternate queue system is configured. Ensure a required include file is loaded. Use Drupal variables 'queue_class' . $name, or 'queue_default_class' to define the implementation of DrupalQueueInterface to load.

Set 'sms_bootstrap_queue' in settings.php if you don't rely on the db.

1 call to sms_bootstrap_load_queue()
sms_incoming.inc in bootstrap/sms_incoming.inc
Include file to (ab)use the cache router to accept and queue SMS.

File

bootstrap/sms_incoming.inc, line 78
Include file to (ab)use the cache router to accept and queue SMS.

Code

function sms_bootstrap_load_queue() {
  $queue_info = variable_get('sms_bootstrap_queue', array());
  if (empty($queue_info['require db']) || $queue_info['required db']) {

    // The queue requires the db to be bootstraped, even if all the
    // variables have been supplied so far from settings.php.
    // Default DrupalSystemQueue requires DB. Set your $queue_info['require db']
    // to FALSE if you don't need it.
    drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE, FALSE);
  }
  if (!empty($queue_info['inc'])) {
    require $queue_info['inc'];
  }
  $name = empty($queue_info['name']) ? 'sms_incoming' : $queue_info['name'];
  $reliable = empty($queue_info['reliable']) ? TRUE : $queue_info['reliable'];
  $queue = DrupalQueue::get($name, $reliable);
  $queue
    ->createQueue();
  return $queue;
}