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.

92 lines
2.2 KiB

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