You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
2.2 KiB

3 years ago
  1. <?php
  2. use Illuminate\Support\Facades\Route;
  3. Route::get('/lab', function () {
  4. $message_delivery = [
  5. 1,
  6. 2,
  7. ];
  8. $message_mandatory = [
  9. 1,
  10. 0,
  11. ];
  12. $exchange_durable = [
  13. 1,
  14. 0,
  15. ];
  16. $exchange_type = [
  17. 'direct',
  18. 'fanout',
  19. 'topic',
  20. 'headers',
  21. ];
  22. $consumer_prefetch = [
  23. 1,
  24. 2,
  25. ];
  26. $consumer_ack = [
  27. 1,
  28. 0,
  29. ];
  30. $queue_durable = [
  31. 1,
  32. 0,
  33. ];
  34. $r = [];
  35. foreach ($message_delivery as $message_delivery_value) {
  36. foreach ($message_mandatory as $message_mandatory_value) {
  37. foreach ($exchange_durable as $exchange_durable_value) {
  38. foreach ($exchange_type as $exchange_type_value) {
  39. foreach ($consumer_prefetch as $consumer_prefetch_value) {
  40. foreach ($consumer_ack as $consumer_ack_value) {
  41. foreach ($queue_durable as $queue_durable_value) {
  42. $r[] = [
  43. 'message_delivery_value' => $message_delivery_value,
  44. 'message_mandatory_value' => $message_mandatory_value,
  45. 'exchange_durable_value' => $exchange_durable_value,
  46. 'exchange_type_value' => $exchange_type_value,
  47. 'consumer_prefetch_value' => $consumer_prefetch_value,
  48. 'consumer_ack_value' => $consumer_ack_value,
  49. 'queue_durable_value' => $queue_durable_value,
  50. ];
  51. }
  52. }
  53. }
  54. }
  55. }
  56. }
  57. }
  58. $fp = fopen('states.csv', 'w');
  59. $h = [
  60. 'message_delivery_value',
  61. 'message_mandatory_value',
  62. 'exchange_durable_value',
  63. 'exchange_type_value',
  64. 'consumer_prefetch_value',
  65. 'consumer_ack_value',
  66. 'queue_durable_value',
  67. ];
  68. fputcsv($fp, $h);
  69. foreach ($r as $fields) {
  70. fputcsv($fp, $fields);
  71. }
  72. fclose($fp);
  73. });