'fieldset', '#title' => t('Query log')); $description = t('Display a log of the database queries needed to generate the current page, and the execution time for each. Also, queries which are repeated during a single page view are summed in the # column, and printed in red since they are candidates for caching.'); if (!devel_is_compatible_optimizer()) { $description = t('You must disable or upgrade the php Zend Optimizer extension in order to enable this feature. The minimum required version is 3.2.8. Earlier versions of Zend Optimizer are horribly buggy and segfault your Apache ... ', array('!url' => url('http://drupal.org/node/126098'))) . $description; } $form['queries']['devel_query_display'] = array('#type' => 'checkbox', '#title' => t('Display query log'), '#default_value' => variable_get('devel_query_display', 0), '#description' => $description, '#disabled' => !devel_is_compatible_optimizer(), ); $form['queries']['settings'] = array( '#type' => 'container', '#states' => array( // Hide the query log settings when not displaying query log. 'invisible' => array( 'input[name="devel_query_display"]' => array('checked' => FALSE), ), ), ); $form['queries']['settings']['devel_query_sort'] = array('#type' => 'radios', '#title' => t('Sort query log'), '#default_value' => variable_get('devel_query_sort', DEVEL_QUERY_SORT_BY_SOURCE), '#options' => array(t('by source'), t('by duration')), '#description' => t('The query table can be sorted in the order that the queries were executed or by descending duration.'), ); $form['queries']['settings']['devel_execution'] = array('#type' => 'textfield', '#title' => t('Slow query highlighting'), '#default_value' => variable_get('devel_execution', 5), '#size' => 4, '#maxlength' => 4, '#description' => t('Enter an integer in milliseconds. Any query which takes longer than this many milliseconds will be highlighted in the query log. This indicates a possibly inefficient query, or a candidate for caching.'), ); $form['xhprof'] = array( '#type' => 'fieldset', '#title' => 'XHProf', '#description' => t('XHProf is a php extension which is essential for profiling your Drupal site. It pinpoints slow functions, and also memory hogging functions.'), ); $description = extension_loaded('xhprof') ? t('Profile requests with the xhprof php extension.') : '' . t('You must enable the xhprof php extension to use this feature.', array('!url' => url('http://techportal.ibuildings.com/2009/12/01/profiling-with-xhprof/'))) . ''; $form['xhprof']['devel_xhprof_enabled'] = array( '#type' => 'checkbox', '#title' => t('Enable profiling of all page views and drush requests.', array('!drush' => url('http://drush.ws'))), '#default_value' => variable_get('devel_xhprof_enabled', FALSE), '#description' => $description, '#disabled' => !extension_loaded('xhprof'), ); $form['xhprof']['settings'] = array( '#type' => 'container', '#states' => array( 'invisible' => array( 'input[name="devel_xhprof_enabled"]' => array('checked' => FALSE), ), ), ); $form['xhprof']['settings']['devel_xhprof_directory'] = array( '#type' => 'textfield', '#title' => 'xhprof directory', '#description' => t('Location of the xhprof source code on your system, where the directory "xhprof_lib" can be found, usually somewhere in /usr/local/share or /usr/share, include the leading forward slash.'), '#default_value' => variable_get('devel_xhprof_directory', ''), '#states' => array( 'invisible' => array( 'input[name="devel_xhprof_enabled"]' => array('checked' => FALSE), ), ), ); $form['xhprof']['settings']['devel_xhprof_url'] = array( '#type' => 'textfield', '#title' => 'XHProf URL', '#description' => t('Path to the publically accessible xhprof_html - required to display profiler reports. You will need to set this up outside Drupal, for example at http://xhprof.localhost/xhprof_html'), '#default_value' => variable_get('devel_xhprof_url', ''), '#states' => array( 'invisible' => array( 'input[name="devel_xhprof_enabled"]' => array('checked' => FALSE), ), ), ); $form['devel_api_url'] = array('#type' => 'textfield', '#title' => t('API Site'), '#default_value' => variable_get('devel_api_url', 'api.drupal.org'), '#description' => t('The base URL for your developer documentation links. You might change this if you run api.module locally.', array('!url' => url('http://drupal.org/project/api')))); $form['dev_timer'] = array('#type' => 'checkbox', '#title' => t('Display page timer'), '#default_value' => variable_get('dev_timer', 0), '#description' => t('Display page execution time in the query log box.'), ); $form['devel_memory'] = array('#type' => 'checkbox', '#title' => t('Display memory usage'), '#default_value' => variable_get('devel_memory', 0), '#description' => t('Display how much memory is used to generate the current page. This will show memory usage when devel_init() is called and when devel_exit() is called.'), ); $form['devel_redirect_page'] = array('#type' => 'checkbox', '#title' => t('Display redirection page'), '#default_value' => variable_get('devel_redirect_page', 0), '#description' => t('When a module executes drupal_goto(), the query log and other developer information is lost. Enabling this setting presents an intermediate page to developers so that the log can be examined before continuing to the destination page.'), ); $form['devel_page_alter'] = array('#type' => 'checkbox', '#title' => t('Display $page array'), '#default_value' => variable_get('devel_page_alter', FALSE), '#description' => t('Display $page array from hook_page_alter() in the messages area of each page.'), ); $form['devel_raw_names'] = array('#type' => 'checkbox', '#title' => t('Display machine names of permissions and modules'), '#default_value' => variable_get('devel_raw_names', FALSE), '#description' => t('Display the language-independent machine names of the permissions in mouse-over hints on the !Permissions page and the module base file names on the @Permissions and !Modules pages.', array('!Permissions' => l(t('Permissions'), 'admin/people/permissions'), '@Permissions' => t('Permissions'), '!Modules' => l(t('Modules'), 'admin/modules'))), ); $error_handlers = devel_get_handlers(); $form['devel_error_handlers'] = array( '#type' => 'select', '#title' => t('Error handlers'), '#options' => array( DEVEL_ERROR_HANDLER_NONE => t('None'), DEVEL_ERROR_HANDLER_STANDARD => t('Standard Drupal'), DEVEL_ERROR_HANDLER_BACKTRACE_DPM => t('Krumo backtrace in the message area'), DEVEL_ERROR_HANDLER_BACKTRACE_KRUMO => t('Krumo backtrace above the rendered page'), ), '#multiple' => TRUE, '#default_value' => empty($error_handlers) ? DEVEL_ERROR_HANDLER_NONE : $error_handlers, '#description' => t('Select the error handler(s) to use, in case you choose to show errors on screen.', array('@choose' => url('admin/config/development/logging'))) . '