PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Specific Adapters - Configuration settings

If a default setting is indicated then the parameter is optional. If a default setting is not specified then the parameter is required.

Apache ActiveMQ - Zend_Queue_Adapter_Activemq

Options listed here are known requirements. Not all messaging servers require username or password.

  • $options['name'] = '/temp/queue1';

    This is the name of the queue that you wish to start using. (Required)

  • $options['driverOptions']['host'] = 'host.domain.tld';

    $options['driverOptions']['host'] = '127.0.0.1';

    You may set host to an IP address or a hostname.

    Default setting for host is '127.0.0.1'.

  • $options['driverOptions']['port'] = 61613;

    Default setting for port is 61613.

  • $options['driverOptions']['username'] = 'username';

    Optional for some messaging servers. Read the manual for your messaging server.

  • $options['driverOptions']['password'] = 'password';

    Optional for some messaging servers. Read the manual for your messaging server.

  • $options['driverOptions']['timeout_sec'] = 2;

    $options['driverOptions']['timeout_usec'] = 0;

    This is the amount of time that Zend_Queue_Adapter_Activemq will wait for read activity on a socket before returning no messages.

Db - Zend_Queue_Adapter_Db

Driver options are checked for a few required options such as type, host, username, password, and dbname. You may pass along additional parameters for Zend_DB::factory() as parameters in $options['driverOptions']. An example of an additional option not listed here, but could be passed would be port.

<?php
$options 
= array(
    
'driverOptions' => array(
        
'host'      => 'db1.domain.tld',
        
'username'  => 'my_username',
        
'password'  => 'my_password',
        
'dbname'    => 'messaging',
        
'type'      => 'pdo_mysql',
        
'port'      => 3306// optional parameter.
    
),
    
'options' => array(
        
// use Zend_Db_Select for update, not all databases can support this
        // feature.
        
Zend_Db_Select::FOR_UPDATE => true
    
)
);

// Create a database queue.
$queue = new Zend_Queue('Db'$options);
  • $options['name'] = 'queue1';

    This is the name of the queue that you wish to start using. (Required)

  • $options['driverOptions']['type'] = 'Pdo';

    type is the adapter you wish to have Zend_Db::factory() use. This is the first parameter for the Zend_Db::factory() class method call.

  • $options['driverOptions']['host'] = 'host.domain.tld';

    $options['driverOptions']['host'] = '127.0.0.1';

    You may set host to an IP address or a hostname.

    Default setting for host is '127.0.0.1'.

  • $options['driverOptions']['username'] = 'username';

  • $options['driverOptions']['password'] = 'password';

  • $options['driverOptions']['dbname'] = 'dbname';

    The database name that you have created the required tables for. See the notes section below.

MemcacheQ - Zend_Queue_Adapter_Memcacheq

  • $options['name'] = 'queue1';

    This is the name of the queue that you wish to start using. (Required)

  • $options['driverOptions']['host'] = 'host.domain.tld';

    $options['driverOptions']['host'] = '127.0.0.1;'

    You may set host to an IP address or a hostname.

    Default setting for host is '127.0.0.1'.

  • $options['driverOptions']['port'] = 22201;

    The default setting for port is 22201.

Zend Platform Job Queue - Zend_Queue_Adapter_PlatformJobQueue

  • $options['daemonOptions']['host'] = '127.0.0.1:10003';

    The hostname and port corresponding to the Zend Platform Job Queue daemon you will use. (Required)

  • $options['daemonOptions']['password'] = '1234';

    The password required for accessing the Zend Platform Job Queue daemon. (Required)

Array - Zend_Queue_Adapter_Array

  • $options['name'] = 'queue1';

    This is the name of the queue that you wish to start using. (Required)

Zend Framework