enable.sql 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. -- settings
  2. SET @iTypeOrder = (SELECT MAX(`order`) FROM `sys_options_types` WHERE `group` = 'modules');
  3. INSERT INTO `sys_options_types` (`group`, `name`, `caption`, `icon`, `order`) VALUES
  4. ('modules', 'bx_profiler', 'Profiler', 'bx_profiler@modules/boonex/profiler/|std-icon.svg', IF(NOT ISNULL(@iTypeOrder), @iTypeOrder + 1, 1));
  5. SET @iTypeId = LAST_INSERT_ID();
  6. INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )
  7. VALUES (@iTypeId, 'bx_profiler', 'Debug Panel', 1);
  8. SET @iCategoryId = LAST_INSERT_ID();
  9. INSERT INTO `sys_options` (`category_id`, `name`, `value`, `caption`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
  10. (@iCategoryId, 'bx_profiler_show_debug_panel', 'none', 'Show debug panel below the page for', 'select', 'none,admins,all', '', '', 1);
  11. INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )
  12. VALUES (@iTypeId, 'bx_profiler_sql_querues', 'SQL Queries', 2);
  13. SET @iCategoryId = LAST_INSERT_ID();
  14. INSERT INTO `sys_options` (`category_id`, `name`, `value`, `caption`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
  15. (@iCategoryId, 'bx_profiler_long_sql_queries_log', 'on', 'Log long sql queries', 'checkbox', '', '', '', 1),
  16. (@iCategoryId, 'bx_profiler_long_sql_queries_time', '2', 'Time in seconds of long sql query', 'digit', '', '', '', 2),
  17. (@iCategoryId, 'bx_profiler_long_sql_queries_debug', '', 'Log additional debug info with each long sql query', 'checkbox', '', '', '', 3);
  18. INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )
  19. VALUES (@iTypeId, 'bx_profiler_modules_queries', 'Modules Queries', 3);
  20. SET @iCategoryId = LAST_INSERT_ID();
  21. INSERT INTO `sys_options` (`category_id`, `name`, `value`, `caption`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
  22. (@iCategoryId, 'bx_profiler_long_module_query_log', 'on', 'Log long modules queries', 'checkbox', '', '', '', 1),
  23. (@iCategoryId, 'bx_profiler_long_module_query_time', '3', 'Time in seconds of long module query', 'digit', '', '', '', 2),
  24. (@iCategoryId, 'bx_profiler_long_module_query_debug', '', 'Log additional debug info with each long module query', 'checkbox', '', '', '', 3);
  25. INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )
  26. VALUES (@iTypeId, 'bx_profiler_page_opens', 'Pages opens', 4);
  27. SET @iCategoryId = LAST_INSERT_ID();
  28. INSERT INTO `sys_options` (`category_id`, `name`, `value`, `caption`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
  29. (@iCategoryId, 'bx_profiler_long_page_log', 'on', 'Log long page opens', 'checkbox', '', '', '', 1),
  30. (@iCategoryId, 'bx_profiler_long_page_time', '5', 'Time in seconds of long page open', 'digit', '', '', '', 2),
  31. (@iCategoryId, 'bx_profiler_long_page_debug', '', 'Log additional debug info with each long page open', 'checkbox', '', '', '', 3);
  32. -- ALERTS
  33. INSERT INTO `sys_alerts_handlers` (`name`, `class`, `file`, `service_call`) VALUES
  34. ('bx_profiler', 'BxProfilerAlertsResponse', 'modules/boonex/profiler/classes/BxProfilerAlertsResponse.php', '');
  35. SET @iHandler := LAST_INSERT_ID();
  36. INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
  37. ('system', 'begin', @iHandler);