Guest User

Untitled

a guest
Jul 18th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. <?php
  2. // MemcacheQ config
  3. $queueOptions = array(
  4. 'name' => 'example-queue',
  5. 'driverOptions' => array(
  6. 'host' => '127.0.0.1',
  7. 'port' => 22201
  8. )
  9. );
  10.  
  11. // Instantiate Zend_Queue
  12. $queue = new Zend_Queue('MemcacheQ', $queueOptions);
  13.  
  14. // Find out if the queue exists
  15. if (!$queue->getAdapter()->isExists($queueOptions['name']))
  16. {
  17. // If not, create it
  18. $queue->createQueue($queueOptions['name']);
  19. }
  20.  
  21. // Build a query string (key=val&key=val) because we need a scalar value
  22. $params = http_build_query(
  23. array(
  24. 'timestamp' => $timestamp,
  25. 'page' => $page
  26. )
  27. );
  28. // Send the data to the queue
  29. $queue->send($params);
Add Comment
Please, Sign In to add comment