Toolbar.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?php
  2. namespace Config;
  3. use CodeIgniter\Config\BaseConfig;
  4. use CodeIgniter\Debug\Toolbar\Collectors\Database;
  5. use CodeIgniter\Debug\Toolbar\Collectors\Events;
  6. use CodeIgniter\Debug\Toolbar\Collectors\Files;
  7. use CodeIgniter\Debug\Toolbar\Collectors\Logs;
  8. use CodeIgniter\Debug\Toolbar\Collectors\Routes;
  9. use CodeIgniter\Debug\Toolbar\Collectors\Timers;
  10. use CodeIgniter\Debug\Toolbar\Collectors\Views;
  11. /**
  12. * --------------------------------------------------------------------------
  13. * Debug Toolbar
  14. * --------------------------------------------------------------------------
  15. *
  16. * The Debug Toolbar provides a way to see information about the performance
  17. * and state of your application during that page display. By default it will
  18. * NOT be displayed under production environments, and will only display if
  19. * `CI_DEBUG` is true, since if it's not, there's not much to display anyway.
  20. */
  21. class Toolbar extends BaseConfig
  22. {
  23. /**
  24. * --------------------------------------------------------------------------
  25. * Toolbar Collectors
  26. * --------------------------------------------------------------------------
  27. *
  28. * List of toolbar collectors that will be called when Debug Toolbar
  29. * fires up and collects data from.
  30. *
  31. * @var string[]
  32. */
  33. public $collectors = [
  34. Timers::class,
  35. Database::class,
  36. Logs::class,
  37. Views::class,
  38. // \CodeIgniter\Debug\Toolbar\Collectors\Cache::class,
  39. Files::class,
  40. Routes::class,
  41. Events::class,
  42. ];
  43. /**
  44. * --------------------------------------------------------------------------
  45. * Collect Var Data
  46. * --------------------------------------------------------------------------
  47. *
  48. * If set to false var data from the views will not be colleted. Usefull to
  49. * avoid high memory usage when there are lots of data passed to the view.
  50. *
  51. * @var bool
  52. */
  53. public $collectVarData = true;
  54. /**
  55. * --------------------------------------------------------------------------
  56. * Max History
  57. * --------------------------------------------------------------------------
  58. *
  59. * `$maxHistory` sets a limit on the number of past requests that are stored,
  60. * helping to conserve file space used to store them. You can set it to
  61. * 0 (zero) to not have any history stored, or -1 for unlimited history.
  62. *
  63. * @var int
  64. */
  65. public $maxHistory = 20;
  66. /**
  67. * --------------------------------------------------------------------------
  68. * Toolbar Views Path
  69. * --------------------------------------------------------------------------
  70. *
  71. * The full path to the the views that are used by the toolbar.
  72. * This MUST have a trailing slash.
  73. *
  74. * @var string
  75. */
  76. public $viewsPath = SYSTEMPATH . 'Debug/Toolbar/Views/';
  77. /**
  78. * --------------------------------------------------------------------------
  79. * Max Queries
  80. * --------------------------------------------------------------------------
  81. *
  82. * If the Database Collector is enabled, it will log every query that the
  83. * the system generates so they can be displayed on the toolbar's timeline
  84. * and in the query log. This can lead to memory issues in some instances
  85. * with hundreds of queries.
  86. *
  87. * `$maxQueries` defines the maximum amount of queries that will be stored.
  88. *
  89. * @var int
  90. */
  91. public $maxQueries = 100;
  92. }