DbMultiController.php 515 B

1234567891011121314151617181920
  1. <?php
  2. class DbMultiController extends Zend_Controller_Action
  3. {
  4. public function indexAction()
  5. {
  6. $queries = (int) $this->getParam('queries', 1);
  7. $queries = max(1, $queries);
  8. $queries = min(500, $queries);
  9. $table = new Zend_Db_Table('World');
  10. $worlds = array();
  11. for ($i = 0; $i < $queries; $i += 1) {
  12. $worlds[] = $table->fetchRow(array('id = ?' => mt_rand(1,10000)))->toArray();
  13. }
  14. $this->_helper->json->sendJson($worlds);
  15. }
  16. }