ZF-10597: Zend_Queue_Adapter_Db provides no mechanism for using custom table names


In order to use table names other than 'queue' and 'message' in Zend_Queue_Adapter_Db, one must currently extend three classes:

  1. Zend_Queue_Adapter_Db_Message to change the message table name
  2. Zend_Queue_Adapter_Db_Queue to change the queue table name
  3. Zend_Queue_Adapter_Db to override __construct or add table setter methods to override the default table usage.

It seems like this is something that should and could be supported easily through an option key or setter method.


Patch with unit test and updated docs attached.

Also attaching instructions on TestConfiguration.php settings and related steps to turn on the the Zend_Queue_Db unit tests to make it easier for whoever is testing/applying this patch. Thanks!

As well as the name of the table, we should have an option to the schema too. It will be nice, while working with postgres.

While working with the Db adapter, why not use the Zend_Db_Table classes, for message and queue? Doing this, we could intercept the methods used by, like the insert, or the update.Instead of using the database adapter methods for update, select, insert, I purpose to use the Zend_Db_Table methods.