├── LICENSE.txt ├── README.md ├── config └── devel.settings.json ├── devel.admin.inc ├── devel.css ├── devel.drush.inc ├── devel.info ├── devel.install ├── devel.js ├── devel.mail.inc ├── devel.module ├── devel.pages.inc ├── devel.rules.inc ├── devel.test ├── develDrushTest.php ├── devel_generate ├── devel_generate.drush.inc ├── devel_generate.fields.inc ├── devel_generate.inc ├── devel_generate.info ├── devel_generate.module ├── devel_generate.pages.inc ├── devel_generate_batch.inc └── modules │ ├── date.devel_generate.inc │ ├── entityreference.devel_generate.inc │ ├── file.devel_generate.inc │ ├── image.devel_generate.inc │ ├── link.devel_generate.inc │ ├── list.devel_generate.inc │ ├── number.devel_generate.inc │ ├── taxonomy.devel_generate.inc │ └── text.devel_generate.inc ├── devel_krumo.css ├── devel_krumo.js ├── devel_node_access ├── README.md ├── devel_node_access.api.php ├── devel_node_access.info ├── devel_node_access.install ├── devel_node_access.js └── devel_node_access.module └── lib ├── chromephp └── ChromePhp.php ├── firephp ├── FirePHP.class.php └── fb.php └── krumo ├── INSTALL ├── LICENSE ├── README ├── TODO ├── VERSION ├── class.krumo.php ├── docs ├── Krumo │ ├── _class.krumo.php.html │ └── krumo.html ├── blank.html ├── classtrees_Krumo.html ├── elementindex.html ├── elementindex_Krumo.html ├── errors.html ├── index.html ├── li_Krumo.html ├── media │ ├── banner.css │ ├── images │ │ ├── AbstractClass.png │ │ ├── AbstractClass_logo.png │ │ ├── AbstractMethod.png │ │ ├── AbstractPrivateClass.png │ │ ├── AbstractPrivateClass_logo.png │ │ ├── AbstractPrivateMethod.png │ │ ├── Class.png │ │ ├── Class_logo.png │ │ ├── Constant.png │ │ ├── Constructor.png │ │ ├── Destructor.png │ │ ├── Function.png │ │ ├── Global.png │ │ ├── I.png │ │ ├── Index.png │ │ ├── Interface.png │ │ ├── Interface_logo.png │ │ ├── L.png │ │ ├── Lminus.png │ │ ├── Lplus.png │ │ ├── Method.png │ │ ├── Page.png │ │ ├── Page_logo.png │ │ ├── PrivateClass.png │ │ ├── PrivateClass_logo.png │ │ ├── PrivateMethod.png │ │ ├── PrivateVariable.png │ │ ├── StaticMethod.png │ │ ├── StaticVariable.png │ │ ├── T.png │ │ ├── Tminus.png │ │ ├── Tplus.png │ │ ├── Variable.png │ │ ├── blank.png │ │ ├── class_folder.png │ │ ├── empty.png │ │ ├── file.png │ │ ├── folder.png │ │ ├── function_folder.png │ │ ├── minus.gif │ │ ├── next_button.png │ │ ├── next_button_disabled.png │ │ ├── package.png │ │ ├── package_folder.png │ │ ├── plus.gif │ │ ├── previous_button.png │ │ ├── previous_button_disabled.png │ │ ├── private_class_logo.png │ │ ├── tutorial.png │ │ ├── tutorial_folder.png │ │ └── up_button.png │ ├── lib │ │ └── classTree.js │ └── stylesheet.css ├── packages.html ├── ric_INSTALL.html ├── ric_LICENSE.html ├── ric_README.html ├── ric_TODO.html └── ric_VERSION.html ├── krumo.ini ├── krumo.js └── skins ├── blue ├── bg.gif └── skin.css ├── default ├── bg.gif └── skin.css ├── green ├── bg.gif └── skin.css ├── orange ├── bg.gif └── skin.css └── white ├── collapsed.gif ├── dotted.gif ├── empty.gif ├── expanded.gif └── skin.css /README.md: -------------------------------------------------------------------------------- 1 | Developer Tools (devel) 2 | ======================= 3 | 4 | This module contains helper functions for Backdrop developers. It provides a 5 | wide array of tools for examining the functionality of your site, including: 6 | 7 | - Displaying a list of all SQL queries executed per page. 8 | - Integrating with XHProf to show what PHP was executed and identify slow calls. 9 | - Executing arbitrary PHP. 10 | - Switch between different users. 11 | - Report memory usage at the bottom of each page. 12 | - A mail-system class which redirects outbound email to files. 13 | - Utility functions for dumping variables to the page or messages area. 14 | 15 | Although the abilities of this module are restricted to a permission 16 | ('access development information'), it's a good idea not to have this module 17 | enabled on production servers due to its exceedingly dangerous functionality. 18 | 19 | The most common functions for dumping variables include: 20 | 21 | - `dpr()`: Prints a variable using `print_r()` to the messages area. 22 | - `dpm()`: Prints a variable using the krumo library to the messages area. 23 | - `dvm()`: Prints a variable using `var_export()` to the messages area. 24 | 25 | All of these functions will only show the messages to users that have the 26 | 'access development information' permission. 27 | 28 | Included in this package is also: 29 | 30 | - devel_node_access module which prints out the node_access records for a given node. Also offers hook_node_access_explain for all node access modules to implement. Handy. 31 | - devel_generate.module which bulk creates nodes, users, comment, terms for development. 32 | 33 | License 34 | ------- 35 | 36 | This project is GPL v2 software. See the LICENSE.txt file in this directory for 37 | complete text. 38 | 39 | Maintainers 40 | ----------- 41 | 42 | - Nate Haug (https://github.com/quicksketch/) 43 | - Jen Lampton (https://github.com/jenlampton) 44 | - Alan Mels (https://github.com/alanmels) 45 | 46 | Originally written for Drupal by 47 | 48 | - Moshe Weitzman (https://www.drupal.org/u/moshe-weitzman) 49 | - Hans Salvisberg (https://www.drupal.org/u/salvis) 50 | 51 | This module is seeking additional maintainers. 52 | -------------------------------------------------------------------------------- /config/devel.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "_config_name": "devel.settings", 3 | "_config_static": true, 4 | "query_display": null, 5 | "query_sort": "source", 6 | "query_slow_limit": 5, 7 | "api_url": "api.backdropcms.org", 8 | "timer_display": false, 9 | "memory_display": false, 10 | "redirect_page": false, 11 | "permission_raw_names": false, 12 | "error_handlers": [ 13 | "standard" 14 | ], 15 | "debug_mail_file_format": "%to-%subject-%datetime.mail.txt", 16 | "debug_mail_directory": "temporary://devel-mails" 17 | } 18 | -------------------------------------------------------------------------------- /devel.admin.inc: -------------------------------------------------------------------------------- 1 | 'fieldset', 18 | '#title' => t('Query logging'), 19 | ); 20 | 21 | $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.'); 22 | $form['queries']['query_display'] = array( 23 | '#type' => 'checkbox', 24 | '#title' => t('Display query log'), 25 | '#default_value' => $config->get('query_display', 0), 26 | '#description' => $description, 27 | ); 28 | $form['queries']['settings'] = array( 29 | '#type' => 'container', 30 | '#states' => array( 31 | // Hide the query log settings when not displaying query log. 32 | 'invisible' => array( 33 | 'input[name="query_display"]' => array('checked' => FALSE), 34 | ), 35 | ), 36 | ); 37 | $form['queries']['settings']['show_query_args_first'] = array( 38 | '#type' => 'checkbox', 39 | '#title' => t('Show query arguments'), 40 | '#default_value' => $config->get('show_query_args_first'), 41 | '#description' => t('Show arguments rather than the query placeholders in the logged query.'), 42 | ); 43 | $form['queries']['settings']['query_sort'] = array( 44 | '#type' => 'radios', 45 | '#title' => t('Sort query log'), 46 | '#default_value' => $config->get('query_sort', DEVEL_QUERY_SORT_BY_SOURCE), 47 | '#options' => array( 48 | DEVEL_QUERY_SORT_BY_SOURCE => t('by source'), 49 | DEVEL_QUERY_SORT_BY_DURATION => t('by duration') 50 | ), 51 | '#description' => t('The query table can be sorted in the order that the queries were executed or by descending duration.'), 52 | ); 53 | $form['queries']['settings']['query_slow_limit'] = array('#type' => 'textfield', 54 | '#title' => t('Slow query highlighting'), 55 | '#default_value' => $config->get('query_slow_limit'), 56 | '#size' => 4, 57 | '#maxlength' => 4, 58 | '#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.'), 59 | ); 60 | 61 | $form['performance'] = array( 62 | '#type' => 'fieldset', 63 | '#title' => t('Performance logging'), 64 | '#collapsible' => FALSE, 65 | ); 66 | $form['performance']['timer_display'] = array('#type' => 'checkbox', 67 | '#title' => t('Display page timer'), 68 | '#default_value' => $config->get('timer_display'), 69 | '#description' => t('Display page execution time in the query log box.'), 70 | ); 71 | $form['performance']['memory_display'] = array( 72 | '#type' => 'checkbox', 73 | '#title' => t('Display memory usage'), 74 | '#default_value' => $config->get('memory_display'), 75 | '#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.'), 76 | ); 77 | $form['performance']['redirect_page'] = array( 78 | '#type' => 'checkbox', 79 | '#title' => t('Display redirection page'), 80 | '#default_value' => $config->get('redirect_page'), 81 | '#description' => t('When a module executes backdrop_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.'), 82 | ); 83 | 84 | $form['theme'] = array( 85 | '#type' => 'fieldset', 86 | '#title' => t('Theming tools'), 87 | '#collapsible' => FALSE, 88 | ); 89 | $form['theme']['theme_debug'] = array( 90 | '#type' => 'checkbox', 91 | '#title' => t('Enable theme debug'), 92 | '#default_value' => config_get('system.core', 'theme_debug'), 93 | '#description' => t('Adds HTML comments containing information about the template files used to render each part of the page. Useful for finding template suggestions when building a custom theme.'), 94 | ); 95 | $form['theme']['rebuild_theme_registry'] = array( 96 | '#type' => 'checkbox', 97 | '#title' => t('Rebuild the theme registry on every page load'), 98 | '#description' => t('While creating new templates and theme_ overrides the theme registry needs to be rebuilt.'), 99 | '#default_value' => $config->get('rebuild_theme_registry'), 100 | ); 101 | 102 | $form['errors'] = array( 103 | '#type' => 'fieldset', 104 | '#title' => t('Error handling'), 105 | '#collapsible' => FALSE, 106 | ); 107 | 108 | $enabled_levels = config_get('system.core', 'watchdog_enabled_severity_levels'); 109 | if (is_array($enabled_levels)) { 110 | $form['errors']['watchdog_enabled_severity_levels'] = array( 111 | '#type' => 'checkboxes', 112 | '#title' => t('Enabled watchdog severity levels'), 113 | '#options' => watchdog_severity_levels(), 114 | '#default_value' => $enabled_levels, 115 | '#description' => t('Only messages with the enabled severity levels will be logged. The "debug" and "deprecated" levels are recommended for developer environments, but not on production sites.'), 116 | ); 117 | } 118 | 119 | $error_handlers = devel_get_handlers(); 120 | $form['errors']['devel_error_handlers'] = array( 121 | '#type' => 'select', 122 | '#title' => t('Error handlers'), 123 | '#options' => array( 124 | DEVEL_ERROR_HANDLER_NONE => t('None'), 125 | DEVEL_ERROR_HANDLER_STANDARD => t('Standard Backdrop'), 126 | DEVEL_ERROR_HANDLER_BACKTRACE_DPM => t('Krumo backtrace in the message area'), 127 | DEVEL_ERROR_HANDLER_BACKTRACE_KRUMO => t('Krumo backtrace above the rendered page'), 128 | ), 129 | '#multiple' => TRUE, 130 | '#default_value' => empty($error_handlers) ? DEVEL_ERROR_HANDLER_STANDARD : $error_handlers, 131 | '#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'))) . '' . 135 | t('Depending on the situation, the theme, the size of the call stack and the arguments, etc., some handlers may not display their messages, or display them on the subsequent page. Select Standard Backdrop and Krumo backtrace above the rendered page to maximize your chances of not missing any messages.') . '
' . 136 | t('Demonstrate the current error handler(s):') . ' ' . l('notice+warning', $_GET['q'], array('query' => array('demo' => 'warning'))) . ', ' . l('notice+warning+error', $_GET['q'], array('query' => array('demo' => 'error'))) . ' ' . t('(The presentation of the @error is determined by PHP.)', array('@error' => 'error')), 137 | ); 138 | $form['errors']['devel_error_handlers']['#size'] = count($form['errors']['devel_error_handlers']['#options']); 139 | if (empty($_POST) && !empty($_GET['demo'])) { 140 | devel_demonstrate_error_handlers($_GET['demo']); 141 | } 142 | 143 | $form['misc'] = array( 144 | '#type' => 'fieldset', 145 | '#title' => t('Miscellaneous'), 146 | '#collapsible' => TRUE, 147 | '#collapsed' => TRUE, 148 | ); 149 | $form['misc']['permission_raw_names'] = array( 150 | '#type' => 'checkbox', 151 | '#title' => t('Display machine names of permissions and modules'), 152 | '#default_value' => $config->get('permission_raw_names'), 153 | '#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'))), 154 | ); 155 | $form['misc']['api_url'] = array( 156 | '#type' => 'textfield', 157 | '#title' => t('API Site'), 158 | '#default_value' => $config->get('api_url'), 159 | '#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'))) 160 | ); 161 | 162 | $form['actions']['#type'] = 'actions'; 163 | $form['actions']['submit'] = array( 164 | '#type' => 'submit', 165 | '#value' => t('Save configuration'), 166 | ); 167 | return $form; 168 | } 169 | 170 | /** 171 | * Submit handler for devel_admin_settings(). 172 | */ 173 | function devel_admin_settings_submit($form, &$form_state) { 174 | $values = $form_state['values']; 175 | 176 | // Save the hidden core development settings 177 | $config = config('system.core'); 178 | $config->set('theme_debug', (bool) $values['theme_debug']); 179 | $config->set('watchdog_enabled_severity_levels', array_map('intval', array_values(array_filter($values['watchdog_enabled_severity_levels'], 'is_string')))); 180 | 181 | $config->save(); 182 | 183 | // And now our own devel.settings. 184 | $config = config('devel.settings'); 185 | 186 | // Save value of system variable 'theme_debug' 187 | config_set('system.core', 'theme_debug', (bool) $values['theme_debug']); 188 | 189 | $config->set('query_display', (bool) $values['query_display']); 190 | $config->set('show_query_args_first', (bool) $values['show_query_args_first']); 191 | $config->set('query_sort', $values['query_sort']); 192 | $config->set('query_slow_limit', (int) $values['query_slow_limit']); 193 | 194 | $config->set('api_url', $values['api_url']); 195 | 196 | $config->set('timer_display', (bool) $values['timer_display']); 197 | $config->set('memory_display', (bool) $values['memory_display']); 198 | $config->set('redirect_page', (bool) $values['redirect_page']); 199 | $config->set('permission_raw_names', (bool) $values['permission_raw_names']); 200 | $config->set('devel_error_handlers', array_values(array_filter($values['devel_error_handlers']))); 201 | $config->set('rebuild_theme_registry', (bool) $values['rebuild_theme_registry']); 202 | 203 | $config->save(); 204 | 205 | backdrop_set_message('The configuration options have been saved.'); 206 | } 207 | 208 | /** 209 | * Demonstrates the active error handler. 210 | * 211 | * Generates some warnings or errors, so that the reaction of the current error 212 | * handler can be observed. 213 | * 214 | * @param $severity 215 | * The severity level that the error handler should demonstrate. 216 | */ 217 | function devel_demonstrate_error_handlers($severity) { 218 | switch ($severity) { 219 | case 'warning': 220 | trigger_error('Notice', E_USER_NOTICE); 221 | trigger_error('Warning', E_USER_WARNING); 222 | break; 223 | case 'error': 224 | trigger_error('Notice', E_USER_NOTICE); 225 | trigger_error('Warning', E_USER_WARNING); 226 | trigger_error('Error', E_USER_ERROR); 227 | break; 228 | } 229 | } 230 | -------------------------------------------------------------------------------- /devel.css: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * Styles for elements created by Devel. 4 | */ 5 | 6 | .dev-query, .dev-timer, .dev-memory-usage { 7 | padding: 1em; 8 | } 9 | 10 | .devel-obj-output .field { 11 | color: red; 12 | } 13 | 14 | .devel-obj-output dd { 15 | display: block; 16 | } 17 | 18 | /** 19 | * Disable flexbox on the overall layout to prevent overlapping issues. 20 | */ 21 | body > .layout { 22 | height: auto !important; 23 | } 24 | 25 | 26 | /** 27 | * Query summary 28 | */ 29 | div.dev-query { 30 | font-size:11px; 31 | background:#fff; 32 | border-top:3px solid #ccc; 33 | color:#333; 34 | /*padding:.5em;*/ 35 | } 36 | 37 | div.dev-query .marker { 38 | color: #f00; 39 | font-weight: bold; 40 | } 41 | 42 | /** 43 | * Querylog 44 | */ 45 | div.devel-querylog { 46 | color:#333; 47 | border-bottom:1px solid #eee; 48 | font-size:11px; 49 | line-height:100%; 50 | padding-left:30em; 51 | padding-right:2em; 52 | position:relative; 53 | overflow:hidden; 54 | } 55 | 56 | div.devel-querylog .marker { 57 | color: #f00; 58 | font-weight: bold; 59 | } 60 | 61 | div.devel-querylog-header { 62 | border-top:3px solid #ccc; 63 | background:#fff; 64 | font-weight:bold; 65 | } 66 | 67 | div.devel-querylog-even { 68 | background:#fff; 69 | } 70 | 71 | div.devel-querylog-odd { 72 | background:#f8f8f8; 73 | } 74 | 75 | div.devel-querylog div.cell { 76 | overflow:hidden; 77 | padding: 1em .5em; 78 | } 79 | 80 | div.devel-querylog div.cell-1 { 81 | position:absolute; 82 | left:0px; 83 | width:4em; 84 | } 85 | 86 | div.devel-querylog div.cell-2 { 87 | position:absolute; 88 | left:4em; 89 | width:3em; 90 | } 91 | 92 | div.devel-querylog div.cell-3 { 93 | position:absolute; 94 | left:6em; 95 | width:19em; 96 | } 97 | 98 | div.devel-querylog div.cell-4 { 99 | position:absolute; 100 | left:26em; 101 | width:4em; 102 | } 103 | 104 | div.devel-querylog-even div.cell-5, 105 | div.devel-querylog-odd div.cell-5 { 106 | /*max-height:18em;*/ 107 | font-family: 'Andale Mono', monospace; 108 | } 109 | 110 | div.devel-querylog div.cell-6 { 111 | position:absolute; 112 | right:0em; 113 | top:0em; 114 | /*width:9em;*/ 115 | } 116 | 117 | 118 | /** 119 | * Switch User block 120 | */ 121 | 122 | div#content div#block-devel-switch-user ul.links, 123 | div#footer div#block-devel-switch-user ul.links { 124 | margin-left: 0; 125 | padding-left: 0; 126 | } 127 | 128 | div#content div#block-devel-switch-user ul.links li, 129 | div#footer div#block-devel-switch-user ul.links li { 130 | display: inline-block; 131 | margin-left: 0; 132 | margin-right: 1.5em; 133 | padding-right: 0; 134 | } 135 | 136 | div#footer div#block-devel-switch-user ul.links li a { 137 | margin: 0; 138 | padding: 0; 139 | border: none; 140 | } 141 | 142 | div#content div#block-devel-switch-user div.form-item-username, 143 | div#footer div#block-devel-switch-user div.form-item-username { 144 | float: left; 145 | margin-right: 2em; 146 | } 147 | 148 | div#content div#block-devel-switch-user #edit-submit, 149 | div#footer div#block-devel-switch-user #edit-submit { 150 | margin-top: 5px; 151 | } 152 | -------------------------------------------------------------------------------- /devel.drush.inc: -------------------------------------------------------------------------------- 1 | dt('Disable, Uninstall, and Install a list of projects.'), 14 | 'arguments' => array( 15 | 'projects' => dt('A space-separated list of project names.'), 16 | ), 17 | 'aliases' => array('dre'), 18 | ); 19 | $items['fn-hook'] = array( 20 | 'description' => 'List implementations of a given hook and explore source of specified one.', 21 | 'arguments' => array( 22 | 'hook' => 'The name of the hook to explore.' 23 | ), 24 | 'aliases' => array('fnh', 'hook'), 25 | ); 26 | $items['fn-view'] = array( 27 | 'description' => 'Show the source of specified function or method.', 28 | 'arguments' => array( 29 | 'function' => 'The name of the function or method to view.', 30 | ), 31 | 'options' => array( 32 | 'pipe' => 'Output just the filename of the function', 33 | 'format' => 'Specify how the filename should be printed. Available placeholders are !startline, !endline and !file', 34 | ), 35 | 'examples' => array( 36 | 'fn-view backdrop_set_breadcrumb' => 'View the source code for function "backdrop_set_breadcrumb"', 37 | 'vi `drush --pipe fn-view user_access --format=\'+!startline !file\'`' => 'Edit the file that contains the function "user_access"', 38 | 'fn-view NodeController::load' => 'View the source code for method load in the class NodeController' 39 | ), 40 | 'aliases' => array('fnv'), 41 | ); 42 | $items['devel-token'] = array( 43 | 'description' => dt('List available tokens'), 44 | 'aliases' => array('token'), 45 | 'core' => array(7), // Remove once 3.0 is released. 46 | ); 47 | return $items; 48 | } 49 | 50 | /** 51 | * A command callback for reinstalling one or more projects. 52 | * 53 | * This is faster than 3 separate bootstraps. 54 | */ 55 | function drush_devel_reinstall() { 56 | $projects = func_get_args(); 57 | 58 | $args = array_merge(array('pm-disable'), $projects); 59 | call_user_func_array('drush_invoke', $args); 60 | 61 | $args = array_merge(array('pm-uninstall'), $projects); 62 | call_user_func_array('drush_invoke', $args); 63 | 64 | $args = array_merge(array('pm-enable'), $projects); 65 | call_user_func_array('drush_invoke', $args); 66 | } 67 | 68 | /** 69 | * A command handler for showing hook implementations. 70 | */ 71 | function drush_devel_fn_hook($hook) { 72 | // Get implementations in the .install files as well. 73 | include_once './includes/install.inc'; 74 | backdrop_load_updates(); 75 | 76 | if ($hook_implementations = module_implements($hook)) { 77 | if ($choice = drush_choice(array_combine($hook_implementations, $hook_implementations), 'Enter the number of the hook implementation you wish to view.')) { 78 | return drush_devel_fn_view($choice . "_$hook"); 79 | } 80 | } 81 | else { 82 | drush_log(dt('No implementations.'), 'ok'); 83 | } 84 | } 85 | 86 | /** 87 | * A command handler for showing source code of a function or method. 88 | */ 89 | function drush_devel_fn_view($function_name) { 90 | // Get implementations in the .install files as well. 91 | include_once './core/includes/install.inc'; 92 | backdrop_load_updates(); 93 | 94 | if (strpos($function_name, '::') === FALSE) { 95 | if (!function_exists($function_name)) { 96 | return drush_set_error(dt('Function not found')); 97 | } 98 | $reflect = new ReflectionFunction($function_name); 99 | } 100 | else { 101 | list($class, $method) = explode('::', $function_name); 102 | if (!method_exists($class, $method)) { 103 | return drush_set_error(dt('Method not found')); 104 | } 105 | $reflect = new ReflectionMethod($class, $method); 106 | } 107 | $func_info = array('!file' => $reflect->getFileName(), '!startline' => $reflect->getStartLine(), '!endline' => $reflect->getEndLine()); 108 | $format = drush_get_option('format', '!file'); 109 | drush_print_pipe(dt($format, $func_info)); 110 | drush_print(dt("// file: !file, lines !startline-!endline", $func_info)); 111 | 112 | _drush_devel_print_function($reflect->getFileName(), $reflect->getStartLine(), $reflect->getEndLine()); 113 | } 114 | 115 | /** 116 | * A command callback for listing available tokens. 117 | */ 118 | function drush_devel_token() { 119 | $rows[] = array(dt('Group'), dt('Token'), dt('Name')); 120 | $all = token_info(); 121 | foreach ($all['tokens'] as $group => $tokens) { 122 | foreach ($tokens as $key => $token) { 123 | $rows[] = array($group, $key, $token['name']); 124 | } 125 | } 126 | drush_print_table($rows, TRUE); 127 | } 128 | 129 | 130 | /** 131 | * Prints a function including any Doxygen-style comments preceding it. 132 | */ 133 | function _drush_devel_print_function($file, $start_line, $end_line) { 134 | $line_num = 0; 135 | $doxygen = NULL; 136 | $fp = fopen( $file, 'r' ); 137 | 138 | while (!feof($fp) && ($line_num < ($start_line - 1))) { 139 | $line = fgets($fp); 140 | ++$line_num; 141 | 142 | if (substr($line,0,3) == '/**') { 143 | $doxygen = $line; 144 | } 145 | elseif (isset($doxygen)) { 146 | $doxygen .= $line; 147 | if ($line_num + 1 == $start_line) { 148 | drush_print(rtrim($doxygen)); 149 | } 150 | if (strstr($line, '*/') !== FALSE) { 151 | $doxygen = NULL; 152 | } 153 | } 154 | } 155 | while (!feof($fp) && ($line_num < $end_line)) { 156 | $line = fgets($fp); 157 | ++$line_num; 158 | drush_print(rtrim($line)); 159 | } 160 | } 161 | -------------------------------------------------------------------------------- /devel.info: -------------------------------------------------------------------------------- 1 | name = Devel 2 | description = Various blocks, pages, and functions for developers. 3 | package = Development 4 | backdrop = 1.x 5 | configure = admin/config/development/devel 6 | tags[] = developer 7 | type = module 8 | -------------------------------------------------------------------------------- /devel.install: -------------------------------------------------------------------------------- 1 | fields(array( 10 | 'weight' => 88, 11 | )) 12 | ->condition('type', 'module') 13 | ->condition('name', 'devel') 14 | ->execute(); 15 | } 16 | 17 | /** 18 | * Implements hook_disable(). 19 | */ 20 | function devel_disable() { 21 | // Disable theme debug if enabled (restore default). 22 | config_set('system.core', 'theme_debug', 0); 23 | } 24 | 25 | /** 26 | * Convert devel settings to config. 27 | */ 28 | function devel_update_1000() { 29 | $config = config('devel.settings'); 30 | 31 | // Set static_cache to TRUE to save disk reads. 32 | $config->set('_config_static', TRUE); 33 | 34 | // SQL Query display. 35 | $config->set('query_display', FALSE); 36 | $config->set('query_sort', update_variable_get('devel_query_sort', 0) ? 'duration' : 'source'); 37 | $config->set('query_slow_limit', (int) update_variable_get('devel_execution', 5)); 38 | update_variable_del('devel_query_display'); 39 | update_variable_del('devel_query_sort'); 40 | update_variable_del('devel_execution'); 41 | 42 | // XHProf settings. 43 | $config->set('xhprof_enabled', (bool) update_variable_get('devel_xhprof_enabled', FALSE)); 44 | $config->set('xhprof_directory', update_variable_get('devel_xhprof_directory', '')); 45 | $config->set('xhprof_url', update_variable_get('devel_xhprof_url', '')); 46 | update_variable_del('devel_xhprof_enabled'); 47 | update_variable_del('devel_xhprof_directory'); 48 | update_variable_del('devel_xhprof_url'); 49 | 50 | // API URL, not upgraded since it needs to point to a Backdrop code base. 51 | $config->set('api_url', 'api.backdropcms.org'); 52 | update_variable_del('devel_api_url'); 53 | 54 | // Page statistic options. 55 | $config->set('timer_display', (bool) update_variable_get('dev_timer', 0)); 56 | $config->set('memory_display', (bool) update_variable_get('dev_mem', 0)); 57 | $config->set('query_display', update_variable_get('devel_query_display')); 58 | update_variable_del('dev_timer'); 59 | update_variable_del('dev_mem'); 60 | update_variable_del('devel_query_display'); 61 | 62 | // Redirects and permissions. 63 | $config->set('redirect_page', (bool) update_variable_get('devel_redirect_page', 0)); 64 | $config->set('permission_raw_names', (bool) update_variable_get('devel_raw_names', FALSE)); 65 | update_variable_del('devel_redirect_page'); 66 | update_variable_del('devel_raw_names'); 67 | 68 | // Error handling. 69 | $config->set('error_handlers', array('standard')); 70 | $config->set('krumo_skin', update_variable_get('krumo_skin', 'default')); 71 | update_variable_del('error_handlers'); 72 | update_variable_del('krumo_skin'); 73 | 74 | // Mail settings. 75 | $config->set('debug_mail_file_format', update_variable_get('devel_debug_mail_file_format', '%to-%subject-%datetime.mail.txt')); 76 | $config->set('debug_mail_directory', update_variable_get('devel_debug_mail_file_format', 'temporary://devel-mails')); 77 | update_variable_del('debug_mail_file_format'); 78 | update_variable_del('debug_mail_file_format'); 79 | 80 | // Features that have been deleted from Backdrop devel module. 81 | update_variable_del('devel_page_alter'); 82 | update_variable_del('devel_use_uncompressed_jquery'); 83 | 84 | $config->save(); 85 | } 86 | 87 | /** 88 | * Enable static caching for the Devel config file. 89 | */ 90 | function devel_update_1001() { 91 | config('devel.settings') 92 | ->set('_config_static', TRUE) 93 | ->save(); 94 | } 95 | 96 | /** 97 | * Delete the Development menu and just put menu items in the Admin Bar. 98 | */ 99 | function devel_update_1002() { 100 | config('menu.menu.devel')->delete(); 101 | db_query("DELETE FROM {menu_links} WHERE menu_name = 'devel'"); 102 | } 103 | 104 | /** 105 | * Remove option for Krumo skin. 106 | */ 107 | function devel_update_1003() { 108 | config('devel.settings')->clear('krumo_skin')->save(); 109 | } 110 | 111 | /** 112 | * Convert the devel_show_query_args_first variable to config. 113 | */ 114 | function devel_update_1004() { 115 | $config = config('devel.settings'); 116 | $config->set('show_query_args_first', update_variable_get('devel_show_query_args_first', FALSE)); 117 | $config->save(); 118 | 119 | update_variable_del('devel_show_query_args_first'); 120 | } 121 | 122 | /** 123 | * Convert renamed 7.x variables to config. 124 | */ 125 | function devel_update_1005() { 126 | $config = config('devel.settings'); 127 | // These variables were renamed from `dev_timer` and `dev_mem` in the 7.x 128 | // version of devel. In devel_update_1000(), we only account for the former 129 | // names of these variables; they may still exist in the db with their newer 130 | // names though. 131 | $config->set('timer_display', (bool) update_variable_get('devel_timer', 0)); 132 | $config->set('memory_display', (bool) update_variable_get('devel_mem', 0)); 133 | $config->save(); 134 | 135 | update_variable_del('devel_query_sort'); 136 | update_variable_del('devel_execution'); 137 | } 138 | 139 | /** 140 | * Delete 'devel_xhprof_*' config settings, as they were removed from code. 141 | */ 142 | function devel_update_1006() { 143 | $config = config('devel.settings'); 144 | $config->clear('xhprof_directory'); 145 | $config->clear('xhprof_enabled'); 146 | $config->clear('xhprof_url'); 147 | $config->save(); 148 | } 149 | -------------------------------------------------------------------------------- /devel.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * Behaviors for Devel. 4 | */ 5 | 6 | (function ($) { 7 | 8 | /** 9 | * Explain link in query log. 10 | * 11 | * @type {Backdrop~behavior} 12 | */ 13 | Backdrop.behaviors.devel_explain = { 14 | attach: function() { 15 | $('a.dev-explain').click(function () { 16 | qid = $(this).attr("qid"); 17 | cell = $('#devel-query-' + qid); 18 | $('.dev-explain', cell).load(Backdrop.settings.basePath + '?q=devel/explain/' + Backdrop.settings.devel.request_id + '/' + qid).show(); 19 | $('.dev-placeholders', cell).hide(); 20 | $('.dev-arguments', cell).hide(); 21 | return false; 22 | }); 23 | } 24 | } 25 | 26 | /** 27 | * Arguments link in query log. 28 | * 29 | * @type {Backdrop~behavior} 30 | */ 31 | Backdrop.behaviors.devel_arguments = { 32 | attach: function() { 33 | $('a.dev-arguments').click(function () { 34 | qid = $(this).attr("qid"); 35 | cell = $('#devel-query-' + qid); 36 | $('.dev-arguments', cell).load(Backdrop.settings.basePath + '?q=devel/arguments/' + Backdrop.settings.devel.request_id + '/' + qid).show(); 37 | $('.dev-placeholders', cell).hide(); 38 | $('.dev-explain', cell).hide(); 39 | return false; 40 | }); 41 | } 42 | } 43 | 44 | /** 45 | * Placeholders link in query log. 46 | * 47 | * @type {Backdrop~behavior} 48 | */ 49 | Backdrop.behaviors.devel_placeholders = { 50 | attach: function() { 51 | $('a.dev-placeholders').click(function () { 52 | qid = $(this).attr("qid"); 53 | cell = $('#devel-query-' + qid); 54 | $('.dev-explain', cell).hide(); 55 | $('.dev-arguments', cell).hide(); 56 | $('.dev-placeholders', cell).show(); 57 | return false; 58 | }); 59 | } 60 | } 61 | 62 | })(jQuery); 63 | -------------------------------------------------------------------------------- /devel.mail.inc: -------------------------------------------------------------------------------- 1 | 'DevelMailLog', 12 | * ); 13 | * 14 | * Saves to temporary://devel-mails dir by default. Can be changed using 15 | * 'debug_mail_directory' config option. Filename pattern controlled by 16 | * 'debug_mail_file_format' config option. 17 | */ 18 | 19 | /** 20 | * Logs mail messages to the filesystem. 21 | */ 22 | class DevelMailLog extends DefaultMailSystem { 23 | 24 | /** 25 | * Converts a message array to a string. 26 | * 27 | * @param $message 28 | * The message array containing the body and headers. 29 | * 30 | * @return 31 | * The message as it will be printed in the file. 32 | */ 33 | public function composeMessage($message) { 34 | $mimeheaders = array(); 35 | $message['headers']['To'] = $message['to']; 36 | foreach ($message['headers'] as $name => $value) { 37 | $mimeheaders[] = $name . ': ' . mime_header_encode($value); 38 | } 39 | 40 | $line_endings = settings_get('mail_line_endings', MAIL_LINE_ENDINGS); 41 | $output = join($line_endings, $mimeheaders) . $line_endings; 42 | $output .= $message['subject'] . $line_endings; 43 | $output .= preg_replace('@\r?\n@', $line_endings, $message['body']); 44 | return $output; 45 | } 46 | 47 | /** 48 | * Gets a filename for a message using tokens. 49 | * 50 | * @param $message 51 | * The message that will supply values for token replacement. 52 | * 53 | * @return 54 | * The full path and filename after token replacement. 55 | */ 56 | public function getFileName($message) { 57 | $output_directory = $this->getOutputDirectory(); 58 | $this->makeOutputDirectory($output_directory); 59 | 60 | $output_file_format = config_get('devel.settings', 'devel_debug_mail_file_format'); 61 | $tokens = array( 62 | '%to' => $message['to'], 63 | '%subject' => $message['subject'], 64 | '%datetime' => date('y-m-d_his'), 65 | ); 66 | return $output_directory . '/' . $this->dirify(str_replace(array_keys($tokens), array_values($tokens), $output_file_format)); 67 | } 68 | 69 | /** 70 | * Convert a string to a valid directory name. 71 | * 72 | * @return 73 | * The sanitized string, replacing any characters not whitelisted with "_". 74 | */ 75 | private function dirify($string) { 76 | return preg_replace('/[^a-zA-Z0-9_\-\.@]/', '_', $string); 77 | } 78 | 79 | /** 80 | * Save a mail message to a file using Backdrop variables and default 81 | * settings. 82 | * 83 | * @param $message 84 | * A message array, as described in hook_mail_alter(). 85 | * @return 86 | * TRUE if the mail was successfully accepted, otherwise FALSE. 87 | * 88 | * @see http://php.net/manual/en/function.mail.php 89 | * @see backdrop_mail() 90 | */ 91 | public function mail(array $message) { 92 | $output = $this->composeMessage($message); 93 | $output_file = $this->getFileName($message); 94 | 95 | return file_put_contents($output_file, $output); 96 | } 97 | 98 | /** 99 | * Creates the directory to contain the message file if necessary. 100 | * 101 | * @throws Exception 102 | * Exception thrown when unable to create the destination directory. 103 | */ 104 | protected function makeOutputDirectory($output_directory) { 105 | if (!file_prepare_directory($output_directory, FILE_CREATE_DIRECTORY)) { 106 | throw new Exception("Unable to continue sending mail, $output_directory is not writable"); 107 | } 108 | } 109 | 110 | /** 111 | * Retrieves the directory that contains message files. 112 | * 113 | * @return 114 | * The path to mail messages; possibly using a file URI scheme. 115 | */ 116 | public function getOutputDirectory() { 117 | return config_get('devel.settings', 'devel_debug_mail_directory'); 118 | } 119 | } 120 | ?> 121 | -------------------------------------------------------------------------------- /devel.pages.inc: -------------------------------------------------------------------------------- 1 | $links)); 32 | } 33 | 34 | /** 35 | * Page callback: Called by the AJAX link in query log. 36 | */ 37 | function devel_querylog_explain($request_id, $qid) { 38 | if (!is_numeric($request_id)) { 39 | return MENU_ACCESS_DENIED; 40 | } 41 | 42 | $path = "temporary://devel_querylog/$request_id.txt"; 43 | $path = file_stream_wrapper_uri_normalize($path); 44 | 45 | $output = t('No explain log found.'); 46 | 47 | if (file_exists($path)) { 48 | $queries = json_decode(file_get_contents($path)); 49 | 50 | if ($queries !== FALSE && isset($queries[$qid])) { 51 | $header = $rows = array(); 52 | 53 | $query = $queries[$qid]; 54 | $result = db_query('EXPLAIN ' . $query->query, (array)$query->args)->fetchAllAssoc('table'); 55 | $i = 1; 56 | foreach ($result as $row) { 57 | $row = (array)$row; 58 | if ($i == 1) { 59 | $header = array_keys($row); 60 | } 61 | $rows[] = array_values($row); 62 | $i++; 63 | } 64 | 65 | $output = theme('table', array('header' => $header, 'rows' => $rows)); 66 | 67 | } 68 | } 69 | 70 | // Print and return nothing thus avoiding page wrapper. 71 | print $output; 72 | $GLOBALS['devel_shutdown'] = FALSE; 73 | } 74 | 75 | /** 76 | * Page callback: Called by the AJAX link in query log. 77 | */ 78 | function devel_querylog_arguments($request_id, $qid) { 79 | if (!is_numeric($request_id)) { 80 | return MENU_ACCESS_DENIED; 81 | } 82 | 83 | $path = "temporary://devel_querylog/$request_id.txt"; 84 | $path = file_stream_wrapper_uri_normalize($path); 85 | 86 | $output = t('No arguments log found.'); 87 | 88 | if (file_exists($path)) { 89 | $queries = json_decode(file_get_contents($path)); 90 | 91 | if ($queries !== FALSE && isset($queries[$qid])) { 92 | $query = $queries[$qid]; 93 | $conn = Database::getConnection(); 94 | $quoted = array(); 95 | foreach ((array)$query->args as $key => $val) { 96 | $quoted[$key] = $conn->quote($val); 97 | } 98 | $output = strtr($query->query, $quoted); 99 | } 100 | 101 | } 102 | 103 | // Print and return nothing thus avoiding page wrapper. 104 | print $output; 105 | $GLOBALS['devel_shutdown'] = FALSE; 106 | } 107 | 108 | /** 109 | * Form constructor for reinstalling any module from a dropdown. 110 | * 111 | * @see devel_reinstall_submit() 112 | * 113 | * @ingroup forms 114 | */ 115 | function devel_reinstall($form, &$form_state) { 116 | $output = ''; 117 | $modules = module_list(); 118 | sort($modules); 119 | $options = backdrop_map_assoc($modules); 120 | $form['list'] = array( 121 | '#type' => 'checkboxes', 122 | '#options' => $options, 123 | '#description' => t('Uninstall and then install the selected modules. hook_uninstall() and hook_install() will be executed and the schema version number will be set to the most recent update number. You may have to manually clear out any existing tables first if the module doesn\'t implement hook_uninstall().'), 124 | ); 125 | $form['submit'] = array( 126 | '#value' => t('Reinstall'), 127 | '#type' => 'submit', 128 | ); 129 | return $form; 130 | } 131 | 132 | /** 133 | * Form submission callback for devel_reinstall(). 134 | */ 135 | function devel_reinstall_submit($form, &$form_state) { 136 | // require_once './includes/install.inc'; 137 | $modules = array_filter($form_state['values']['list']); 138 | module_disable($modules, FALSE); 139 | backdrop_uninstall_modules($modules, FALSE); 140 | module_enable($modules, FALSE); 141 | backdrop_set_message(t('Uninstalled and installed: %names.', array('%names' => implode(', ', $modules)))); 142 | } 143 | 144 | /** 145 | * Page callback: Rebuilds the theme registry. 146 | */ 147 | function devel_theme_registry() { 148 | backdrop_theme_initialize(); 149 | $hooks = theme_get_registry(); 150 | ksort($hooks); 151 | return kprint_r($hooks, TRUE); 152 | } 153 | 154 | /** 155 | * Page callback: Returns information from hook_entity_info(). 156 | * 157 | * @param string $entity_type 158 | * (optional) Limit results to the specified entity type. The default is to 159 | * return information about all entity types. The $entity_type argument is not 160 | * currently used in the UI. 161 | * 162 | * @return 163 | * The results from kprint_r(). 164 | */ 165 | function devel_entity_info_page($entity_type = NULL) { 166 | $info = entity_get_info($entity_type); 167 | ksort($info); 168 | return kprint_r($info, TRUE); 169 | } 170 | 171 | /** 172 | * Page callback: Returns information about fields. 173 | */ 174 | function devel_field_info_page() { 175 | $info = field_info_fields(); 176 | $output = kprint_r($info, TRUE, t('Fields')); 177 | $info = field_info_instances(); 178 | $output .= kprint_r($info, TRUE, t('Instances')); 179 | $info = field_info_bundles(); 180 | $output .= kprint_r($info, TRUE, t('Bundles')); 181 | return $output; 182 | } 183 | 184 | /** 185 | * Page callback: Displays the session. 186 | */ 187 | function devel_session() { 188 | global $user; 189 | $output = kprint_r($_SESSION, TRUE); 190 | $headers = array(t('Session name'), t('Session ID')); 191 | $output .= theme('table', array('headers' => $headers, 'rows' => array(array(session_name(), session_id())))); 192 | return $output; 193 | } 194 | 195 | /** 196 | * Page callback: Prints the loaded structure of the current node/user. 197 | */ 198 | function devel_load_object($type, $object, $name = NULL) { 199 | $name = isset($name) ? $name : $type; 200 | return kdevel_print_object($object, '$'. $name .'->'); 201 | } 202 | 203 | /** 204 | * Page callback: Prints the render structure of the current object. 205 | * 206 | * @param string $type 207 | * The type of entity that will be displayed. 208 | * @param object $object 209 | * The entity to display. 210 | * @param string $name 211 | * (optional) The label to use when displaying the entity. 212 | * 213 | * @return 214 | * The results from kdevel_print_object(). 215 | */ 216 | function devel_render_object($type, $object, $name = NULL) { 217 | $name = isset($name) ? $name : $type; 218 | $function = $type . '_view'; 219 | 220 | switch ($function) { 221 | case 'comment_view': 222 | $node = node_load($object->nid); 223 | $build = $function($object, $node); 224 | break; 225 | 226 | default: 227 | $build = $function($object); 228 | } 229 | 230 | return kdevel_print_object($build, '$'. $name .'->'); 231 | } 232 | 233 | /** 234 | * Page callback: Returns information from hook_elements(). 235 | */ 236 | function devel_elements_page() { 237 | return kdevel_print_object(module_invoke_all('element_info')); 238 | } 239 | 240 | /** 241 | * Page callback: Returns the results from phpinfo(). 242 | */ 243 | function devel_phpinfo() { 244 | print phpinfo(); 245 | backdrop_exit(); 246 | } 247 | -------------------------------------------------------------------------------- /devel.rules.inc: -------------------------------------------------------------------------------- 1 | array( 14 | 'base' => 'devel_rules_debug_action', 15 | 'label' => t('Debug value'), 16 | 'group' => t('Devel'), 17 | 'parameter' => array( 18 | 'value' => array('type' => 'unknown', 'label' => t('Value to debug')), 19 | ), 20 | ), 21 | ); 22 | } 23 | 24 | /** 25 | * Rules action for debugging values. 26 | */ 27 | function devel_rules_debug_action($value) { 28 | dpm($value); 29 | } 30 | -------------------------------------------------------------------------------- /devel.test: -------------------------------------------------------------------------------- 1 | 'Devel Mail interface', 20 | 'description' => 'Test sending mails with debug interface', 21 | 'group' => 'Devel', 22 | ); 23 | } 24 | 25 | /** 26 | * {@inheritdoc} 27 | */ 28 | function setUp() { 29 | parent::setUp(); 30 | } 31 | 32 | /** 33 | * Test mail logging functionality. 34 | */ 35 | function testMail() { 36 | $path = backdrop_get_path('module', 'devel_generate'); 37 | require_once BACKDROP_ROOT . '/' . $path . '/devel.mail.inc'; 38 | $message = array(); 39 | $message['to'] = 'drupal@example.com'; 40 | $message['subject'] = 'Test mail'; 41 | $message['headers'] = array( 42 | 'From' => 'postmaster@example.com', 43 | 'X-stupid' => 'dumb', 44 | ); 45 | $message['body'] = "I am the body of this message"; 46 | $d = new DevelMailLog(); 47 | 48 | $filename = $d->getFileName($message); 49 | $content = $d->composeMessage($message); 50 | $expected_filename = $d->getOutputDirectory() . '/drupal@example.com-Test_mail-' . date('y-m-d_his') . '.mail.txt'; 51 | $this->assertEqual($filename, $expected_filename); 52 | $this->assertEqual($content, 'From: postmaster@example.com 53 | X-stupid: dumb 54 | To: drupal@example.com 55 | Test mail 56 | I am the body of this message'); 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /develDrushTest.php: -------------------------------------------------------------------------------- 1 | setUpDrupal(1, TRUE); 26 | $options = array( 27 | 'root' => $this->webroot(), 28 | 'uri' => key($sites), 29 | ); 30 | $this->drush('pm-download', array('devel'), $options + array('cache' => NULL)); 31 | $this->drush('pm-enable', array('devel'), $options + array('skip' => NULL, 'yes' => NULL)); 32 | 33 | $this->drush('fn-view', array('drush_main'), $options); 34 | $output = $this->getOutput(); 35 | $this->assertContains('@return', $output, 'Output contain @return Doxygen.'); 36 | $this->assertContains('function drush_main() {', $output, 'Output contains function drush_main() declaration'); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /devel_generate/devel_generate.drush.inc: -------------------------------------------------------------------------------- 1 | 'Create users.', 14 | 'arguments' => array( 15 | 'number_users' => 'Number of users to generate.', 16 | ), 17 | 'options' => array( 18 | 'kill' => 'Delete all users before generating new ones.', 19 | 'roles' => 'A comma delimited list of role IDs which should be granted to the new users. No need to specify authenticated user role.', 20 | 'pass' => 'Specify a password to be set for all generated users.', 21 | ), 22 | 'aliases' => array('genu'), 23 | ); 24 | $items['generate-terms'] = array( 25 | 'description' => 'Create terms in specified vocabulary.', 26 | 'arguments' => array( 27 | 'machine_name' => 'Vocabulary machine name into which new terms will be inserted.', 28 | 'number_terms' => 'Number of terms to insert. Defaults to 10.', 29 | ), 30 | 'options' => array( 31 | 'kill' => 'Delete all terms in specified vocabulary before generating.', 32 | 'feedback' => 'An integer representing interval for insertion rate logging. Defaults to 500', 33 | ), 34 | 'aliases' => array('gent'), 35 | 36 | ); 37 | $items['generate-vocabs'] = array( 38 | 'description' => 'Create vocabularies.', 39 | 'arguments' => array( 40 | 'num_vocabs' => 'Number of vocabularies to create. Defaults to 1.', 41 | ), 42 | 'options' => array( 43 | 'kill' => 'Delete all vocabularies before generating.', 44 | ), 45 | 'aliases' => array('genv'), 46 | ); 47 | $items['generate-content'] = array( 48 | 'description' => 'Create content.', 49 | 'drupal dependencies' => array('devel_generate'), 50 | 'arguments' => array( 51 | 'number_nodes' => 'Number of nodes to generate.', 52 | 'maximum_comments' => 'Maximum number of comments to generate.', 53 | ), 54 | 'options' => array( 55 | 'kill' => 'Delete all content before generating new content.', 56 | 'types' => 'A comma delimited list of content types to create. Defaults to page,post.', 57 | 'feedback' => 'An integer representing interval for insertion rate logging. Defaults to 500', 58 | 'skip-fields' => 'A comma delimited list of fields to omit when generating random values', 59 | 'languages' => 'A comma-separated list of language codes', 60 | ), 61 | 'aliases' => array('genc'), 62 | ); 63 | $items['generate-menus'] = array( 64 | 'description' => 'Create menus and menu items.', 65 | 'drupal dependencies' => array('devel_generate'), // Remove these once devel.module is moved down a directory. http://drupal.org/node/925246 66 | 'arguments' => array( 67 | 'number_menus' => 'Number of menus to generate. Defaults to 2.', 68 | 'number_links' => 'Number of links to generate. Defaults to 50.', 69 | 'max_depth' => 'Max link depth. Defaults to 3', 70 | 'max_width' => 'Max width of first level of links. Defaults to 8.', 71 | ), 72 | 'options' => array( 73 | 'kill' => 'Delete all previously generated menus and links before generating new menus and links.', 74 | ), 75 | 'aliases' => array('genm'), 76 | ); 77 | return $items; 78 | } 79 | 80 | 81 | /** 82 | * Command callback. Generate a number of users. 83 | */ 84 | function drush_devel_generate_users($num_users = NULL) { 85 | if (drush_generate_is_number($num_users) == FALSE) { 86 | return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', t('Invalid number of users.')); 87 | } 88 | drush_generate_include_devel(); 89 | $roles = drush_get_option('roles') ? explode(',', drush_get_option('roles')) : array(); 90 | $pass = drush_get_option('pass', NULL); 91 | devel_create_users($num_users, drush_get_option('kill'), 0, $roles, $pass); 92 | drush_log(t('Generated @number users.', array('@number' => $num_users)), 'success'); 93 | } 94 | 95 | /** 96 | * Command callback. Generate a number of terms in given vocabs. 97 | */ 98 | function drush_devel_generate_terms($vname = NULL, $num_terms = 10) { 99 | // Try to convert machine name to a vocab ID 100 | if (!$vocab = taxonomy_vocabulary_load($vname)) { 101 | return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', dt('Invalid vocabulary name: !name', array('!name' => $vname))); 102 | } 103 | if (drush_generate_is_number($num_terms) == FALSE) { 104 | return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', dt('Invalid number of terms: !num', array('!num' => $num_terms))); 105 | } 106 | 107 | drush_generate_include_devel(); 108 | $vocabs[$vocab->machine_name] = $vocab; 109 | devel_generate_term_data($vocabs, $num_terms, '12', drush_get_option('kill')); 110 | drush_log(dt('Generated @num_terms terms.', array('@num_terms' => $num_terms)), 'success'); 111 | } 112 | 113 | /** 114 | * Command callback. Generate a number of vocabularies. 115 | */ 116 | function drush_devel_generate_vocabs($num_vocab = 1) { 117 | if (drush_generate_is_number($num_vocab) == FALSE) { 118 | return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', dt('Invalid number of vocabularies: !num.', array('!num' => $num_vocab))); 119 | } 120 | drush_generate_include_devel(); 121 | devel_generate_vocab_data($num_vocab, '12', drush_get_option('kill')); 122 | drush_log(dt('Generated @num_vocab vocabularies.', array('@num_vocab' => $num_vocab)), 'success'); 123 | } 124 | 125 | /** 126 | * Command callback. Generate a number of nodes and comments. 127 | */ 128 | function drush_devel_generate_content($num_nodes = NULL, $max_comments = NULL) { 129 | if (drush_generate_is_number($num_nodes) == FALSE) { 130 | return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', dt('Invalid number of nodes')); 131 | } 132 | if (!empty($max_comments) && drush_generate_is_number($max_comments) == FALSE) { 133 | return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', dt('Invalid number of comments.')); 134 | } 135 | 136 | $add_language = drush_get_option('languages'); 137 | if (!empty($add_language)) { 138 | $add_language = explode(',', str_replace(' ', '', $add_language)); 139 | // Intersect with the enabled languages to make sure the language args 140 | // passed are actually enabled. 141 | $values['values']['add_language'] = array_intersect($add_language, array_keys(locale_language_list())); 142 | } 143 | 144 | // Load user 1; is needed for creating *published* comments. 145 | if ($max_comments) { 146 | global $user; 147 | $user_one = user_load(1); 148 | $user = $user_one; 149 | backdrop_save_session(FALSE); 150 | } 151 | 152 | $values['values']['kill_content'] = drush_get_option('kill'); 153 | $values['values']['title_length'] = 6; 154 | $values['values']['num_nodes'] = $num_nodes; 155 | $values['values']['max_comments'] = $max_comments; 156 | $values['values']['node_types'] = backdrop_map_assoc(explode(',', drush_get_option('types', 'page,post'))); 157 | drush_generate_include_devel(); 158 | devel_generate_content($values); 159 | drush_log(t('Generated @num_nodes nodes, @max_comments comments (or less) per node.', array('@num_nodes' => (int)$num_nodes, '@max_comments' => (int)$max_comments)), 'success'); 160 | } 161 | 162 | /** 163 | * Command callback. Generate a number of menus and menu links. 164 | */ 165 | function drush_devel_generate_menus($number_menus = 2, $number_links = 50, $max_depth = 3, $max_width = 8) { 166 | if (drush_generate_is_number($number_menus) == FALSE) { 167 | return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', dt('Invalid number of menus')); 168 | } 169 | if (drush_generate_is_number($number_links) == FALSE) { 170 | return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', dt('Invalid number of links')); 171 | } 172 | if (drush_generate_is_number($max_depth) == FALSE || $max_depth > 9 || $max_depth < 1) { 173 | return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', dt('Invalid maximum link depth. Use a value between 1 and 9')); 174 | } 175 | if (drush_generate_is_number($max_width) == FALSE || $max_width < 1) { 176 | return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', dt('Invalid maximum menu width. Use a positive numeric value.')); 177 | } 178 | 179 | global $user; 180 | $user_one = user_load(1); 181 | $user = $user_one; 182 | backdrop_save_session(FALSE); 183 | 184 | $kill = drush_get_option('kill'); 185 | drush_generate_include_devel(); 186 | $link_types = backdrop_map_assoc(array('node', 'front', 'external')); 187 | devel_generate_menu_data($number_menus, array(), $number_links, 12, $link_types, $max_depth, $max_width, $kill); 188 | drush_log(t('Generated @number_menus menus, @number_links links.', array('@number_menus' => (int)$number_menus, '@number_links' => (int)$number_links)), 'success'); 189 | } 190 | ////////////////////////////////////////////////////////////////////////////// 191 | // Helper functions 192 | 193 | // Verify if param is a number. 194 | function drush_generate_is_number($number) { 195 | if ($number == NULL) return FALSE; 196 | if (!is_numeric($number)) return FALSE; 197 | return TRUE; 198 | } 199 | 200 | // Include devel_generate.inc. 201 | function drush_generate_include_devel() { 202 | $path = backdrop_get_path('module', 'devel_generate'); 203 | require_once BACKDROP_ROOT . '/' . $path .'/devel_generate.inc'; 204 | } 205 | -------------------------------------------------------------------------------- /devel_generate/devel_generate.fields.inc: -------------------------------------------------------------------------------- 1 | {$field['field_name']} 66 | // is necessary here because the forum module has a bug where it 67 | // initializes the property with incorrect data. 68 | // @see http://drupal.org/node/652176 69 | $object->{$field['field_name']} = array( 70 | $field['translatable'] ? $object->language : LANGUAGE_NONE => $object_field, 71 | ); 72 | } 73 | } 74 | 75 | /** 76 | * A simple function to return multiple values for fields that use 77 | * custom multiple value widgets but don't need any other special multiple 78 | * values handling. This will call the field generation function 79 | * a random number of times and compile the results into a node array. 80 | */ 81 | function devel_generate_multiple($function, $object, $field, $instance, $bundle) { 82 | $object_field = array(); 83 | if (function_exists($function)) { 84 | switch ($field['cardinality']) { 85 | case FIELD_CARDINALITY_UNLIMITED: 86 | $max = rand(0, 3); //just an arbitrary number for 'unlimited' 87 | break; 88 | default: 89 | $max = $field['cardinality'] - 1; 90 | break; 91 | } 92 | for ($i = 0; $i <= $max; $i++) { 93 | $result = $function($object, $field, $instance, $bundle); 94 | if (!empty($result)) { 95 | $object_field[$i] = $result; 96 | } 97 | } 98 | } 99 | return $object_field; 100 | } 101 | -------------------------------------------------------------------------------- /devel_generate/devel_generate.info: -------------------------------------------------------------------------------- 1 | name = Devel Generate 2 | description = Generate dummy users, nodes, and taxonomy terms. 3 | package = Development 4 | backdrop = 1.x 5 | dependencies[] = devel 6 | configure = devel/generate 7 | type = module 8 | -------------------------------------------------------------------------------- /devel_generate/devel_generate.module: -------------------------------------------------------------------------------- 1 | 'Generate content', 11 | 'description' => 'Generate sample content for theming and development purposes.', 12 | 'page callback' => 'backdrop_get_form', 13 | 'page arguments' => array('devel_generate_content_form'), 14 | 'access arguments' => array('administer nodes'), 15 | 'file' => 'devel_generate.pages.inc', 16 | ); 17 | 18 | $items['admin/devel/generate/content'] = array( 19 | 'title' => 'Generate nodes', 20 | 'description' => 'Generate a given number of nodes and comments. Optionally delete current items.', 21 | 'page callback' => 'backdrop_get_form', 22 | 'page arguments' => array('devel_generate_content_form'), 23 | 'access arguments' => array('administer nodes'), 24 | 'type' => MENU_DEFAULT_LOCAL_TASK, 25 | 'file' => 'devel_generate.pages.inc', 26 | 'weight' => -1, 27 | ); 28 | $items['admin/devel/generate/user'] = array( 29 | 'title' => 'Generate users', 30 | 'description' => 'Generate a given number of users. Optionally delete current users.', 31 | 'page callback' => 'backdrop_get_form', 32 | 'page arguments' => array('devel_generate_users_form'), 33 | 'access arguments' => array('administer users'), 34 | 'type' => MENU_LOCAL_TASK, 35 | 'file' => 'devel_generate.pages.inc', 36 | 'weight' => 1, 37 | ); 38 | if (module_exists('taxonomy')) { 39 | $items['admin/devel/generate/taxonomy'] = array( 40 | 'title' => 'Generate terms', 41 | 'description' => 'Generate a given number of terms. Optionally delete current terms.', 42 | 'page callback' => 'backdrop_get_form', 43 | 'page arguments' => array('devel_generate_term_form'), 44 | 'access arguments' => array('administer taxonomy'), 45 | 'type' => MENU_LOCAL_TASK, 46 | 'file' => 'devel_generate.pages.inc', 47 | 'weight' => 2, 48 | ); 49 | $items['admin/devel/generate/vocabs'] = array( 50 | 'title' => 'Generate vocabularies', 51 | 'description' => 'Generate a given number of vocabularies. Optionally delete current vocabularies.', 52 | 'page callback' => 'backdrop_get_form', 53 | 'page arguments' => array('devel_generate_vocab_form'), 54 | 'access arguments' => array('administer taxonomy'), 55 | 'type' => MENU_LOCAL_TASK, 56 | 'file' => 'devel_generate.pages.inc', 57 | 'weight' => 3, 58 | ); 59 | } 60 | $items['admin/devel/generate/menu'] = array( 61 | 'title' => 'Generate menus', 62 | 'description' => 'Generate a given number of menus and menu links. Optionally delete current menus.', 63 | 'page callback' => 'backdrop_get_form', 64 | 'page arguments' => array('devel_generate_menu_form'), 65 | 'access arguments' => array('administer menu'), 66 | 'type' => MENU_LOCAL_TASK, 67 | 'file' => 'devel_generate.pages.inc', 68 | 'weight' => 4, 69 | ); 70 | 71 | return $items; 72 | } 73 | -------------------------------------------------------------------------------- /devel_generate/devel_generate.pages.inc: -------------------------------------------------------------------------------- 1 | 'number', 13 | '#title' => t('How many users would you like to generate?'), 14 | '#default_value' => 50, 15 | '#min' => 1, 16 | '#max' => 99999, 17 | ); 18 | $form['kill_users'] = array( 19 | '#type' => 'checkbox', 20 | '#title' => t('Delete all users (except user id 1) before generating new users.'), 21 | '#default_value' => FALSE, 22 | ); 23 | $options = user_roles(TRUE); 24 | unset($options[BACKDROP_AUTHENTICATED_ROLE]); 25 | $form['roles'] = array( 26 | '#type' => 'checkboxes', 27 | '#title' => t('Which roles should the users receive?'), 28 | '#description' => t('Users always receive the authenticated user role.'), 29 | '#options' => $options, 30 | ); 31 | 32 | $form['pass'] = array( 33 | '#type' => 'textfield', 34 | '#title' => t('Password to be set'), 35 | '#default_value' => NULL, 36 | '#size' => 32, 37 | '#description' => t('Leave this field empty, if you do not need to set a password.'), 38 | ); 39 | 40 | $options = array(1 => t('Now')); 41 | foreach (array(3600, 86400, 604800, 2592000, 31536000) as $interval) { 42 | $options[$interval] = format_interval($interval, 1) . ' ' . t('ago'); 43 | } 44 | $form['time_range'] = array( 45 | '#type' => 'select', 46 | '#title' => t('How old should user accounts be?'), 47 | '#description' => t('User ages will be distributed randomly from the current time, back to the selected time.'), 48 | '#options' => $options, 49 | '#default_value' => 31536000, 50 | ); 51 | 52 | $form['submit'] = array( 53 | '#type' => 'submit', 54 | '#value' => t('Generate'), 55 | ); 56 | return $form; 57 | } 58 | 59 | /** 60 | * FormAPI submission to generate users. 61 | */ 62 | function devel_generate_users_form_submit($form_id, &$form_state) { 63 | module_load_include('inc', 'devel_generate'); 64 | $values = $form_state['values']; 65 | $roles = array_keys(array_filter($values['roles'])); 66 | devel_create_users($values['num'], $values['kill_users'], $values['time_range'], $roles, $values['pass']); 67 | } 68 | 69 | /** 70 | * Generates nodes using FormAPI. 71 | */ 72 | function devel_generate_content_form($form, &$form_state) { 73 | $options = array(); 74 | 75 | $types = node_type_get_types(); 76 | $suffix = ''; 77 | foreach ($types as $type) { 78 | if (module_exists('comment')) { 79 | $default = $type->settings['comment_default']; 80 | $map = array(t('Hidden'), t('Closed'), t('Open')); 81 | $suffix = ' ('. t('Comments: ') . $map[$default]. ')'; 82 | } 83 | $options[$type->type] = t($type->name) . $suffix; 84 | } 85 | 86 | if (empty($options)) { 87 | backdrop_set_message(t('You do not have any content types that can be generated. Go create a new content type already!', array('@create-type' => url('admin/structure/types/add'))), 'error', FALSE); 88 | return $form; 89 | } 90 | 91 | $form['node_types'] = array( 92 | '#type' => 'checkboxes', 93 | '#title' => t('Content types'), 94 | '#options' => $options, 95 | '#default_value' => array_keys($options), 96 | ); 97 | if (module_exists('checkall')) $form['node_types']['#checkall'] = TRUE; 98 | $form['kill_content'] = array( 99 | '#type' => 'checkbox', 100 | '#title' => t('Delete all content in these content types before generating new content.'), 101 | '#default_value' => FALSE, 102 | ); 103 | $form['num_nodes'] = array( 104 | '#type' => 'number', 105 | '#title' => t('How many nodes would you like to generate?'), 106 | '#default_value' => 50, 107 | '#min' => 1, 108 | '#max' => 999999, 109 | ); 110 | 111 | $options = array(1 => t('Now')); 112 | foreach (array(3600, 86400, 604800, 2592000, 31536000) as $interval) { 113 | $options[$interval] = format_interval($interval, 1) . ' ' . t('ago'); 114 | } 115 | $form['time_range'] = array( 116 | '#type' => 'select', 117 | '#title' => t('How far back in time should the nodes be dated?'), 118 | '#description' => t('Node creation dates will be distributed randomly from the current time, back to the selected time.'), 119 | '#options' => $options, 120 | '#default_value' => 31536000, 121 | ); 122 | 123 | $form['max_comments'] = array( 124 | '#type' => module_exists('comment') ? 'number' : 'value', 125 | '#title' => t('Maximum number of comments per node.'), 126 | '#description' => t('Only content types that have comments enabled will receive comments. Note that some nodes will randomly receive zero comments. Some will receive the max.'), 127 | '#default_value' => 0, 128 | '#min' => 0, 129 | '#max' => 99999, 130 | '#access' => module_exists('comment'), 131 | ); 132 | $form['title_length'] = array( 133 | '#type' => 'number', 134 | '#title' => t('Maximum number of words in titles'), 135 | '#default_value' => 4, 136 | '#min' => 1, 137 | '#max' => 100, 138 | ); 139 | $form['add_alias'] = array( 140 | '#type' => 'checkbox', 141 | '#disabled' => !module_exists('path'), 142 | '#description' => t('Content types will use the default patterns when generated. Checking this box will add a custom alias to all content types that do not have a pattern specified.'), 143 | '#title' => t('Ensure all content has a URL alias.'), 144 | '#default_value' => FALSE, 145 | ); 146 | 147 | unset($options); 148 | $options[LANGUAGE_NONE] = t('Language neutral'); 149 | if (module_exists('locale')) { 150 | $languages = language_list(TRUE); 151 | foreach ($languages as $language) { 152 | $options[$language->langcode] = $language->name; 153 | } 154 | } 155 | $form['add_language'] = array( 156 | '#type' => 'checkboxes', 157 | '#title' => t('Set language on nodes'), 158 | '#multiple' => TRUE, 159 | '#access' => module_exists('locale'), 160 | '#description' => t('Requires locale.module'), 161 | '#options' => $options, 162 | '#default_value' => array(LANGUAGE_NONE), 163 | ); 164 | 165 | $form['submit'] = array( 166 | '#type' => 'submit', 167 | '#value' => t('Generate'), 168 | ); 169 | $form['#redirect'] = FALSE; 170 | 171 | return $form; 172 | } 173 | 174 | /** 175 | * FormAPI submission to generate nodes. 176 | */ 177 | function devel_generate_content_form_submit($form_id, &$form_state) { 178 | module_load_include('inc', 'devel_generate', 'devel_generate'); 179 | $form_state['values']['node_types'] = array_filter($form_state['values']['node_types']); 180 | if ($form_state['values']['num_nodes'] <= 50 && $form_state['values']['max_comments'] <= 10) { 181 | module_load_include('inc', 'devel_generate'); 182 | devel_generate_content($form_state); 183 | } 184 | else { 185 | module_load_include('inc', 'devel_generate', 'devel_generate_batch'); 186 | devel_generate_batch_content($form_state); 187 | } 188 | } 189 | 190 | /** 191 | * Generates taxonomy terms using FormAPI. 192 | */ 193 | function devel_generate_term_form($form, &$form_state) { 194 | $options = array(); 195 | foreach (taxonomy_get_vocabularies() as $vocab_machine_name => $vocab) { 196 | $options[$vocab_machine_name] = $vocab->name; 197 | } 198 | $form['vocabularies'] = array( 199 | '#type' => 'checkboxes', 200 | '#multiple' => TRUE, 201 | '#title' => t('Generate terms for these vocabularies'), 202 | '#required' => TRUE, 203 | '#options' => $options, 204 | ); 205 | $form['num_terms'] = array( 206 | '#type' => 'number', 207 | '#title' => t('Number of terms?'), 208 | '#default_value' => 10, 209 | '#min' => 1, 210 | '#max' => 99999, 211 | ); 212 | $form['title_length'] = array( 213 | '#type' => 'number', 214 | '#title' => t('Maximum number of characters in term names'), 215 | '#default_value' => 12, 216 | '#min' => 1, 217 | '#max' => 1000, 218 | ); 219 | $form['kill_taxonomy'] = array( 220 | '#type' => 'checkbox', 221 | '#title' => t('Delete existing terms in specified vocabularies before generating new terms.'), 222 | '#default_value' => FALSE, 223 | ); 224 | $form['submit'] = array( 225 | '#type' => 'submit', 226 | '#value' => t('Generate'), 227 | ); 228 | 229 | return $form; 230 | } 231 | 232 | /** 233 | * Generates taxonomy vocabularies using FormAPI. 234 | */ 235 | function devel_generate_vocab_form($form, &$form_state) { 236 | $form['num_vocabs'] = array( 237 | '#type' => 'number', 238 | '#title' => t('Number of vocabularies?'), 239 | '#default_value' => 1, 240 | '#min' => 1, 241 | '#max' => 999, 242 | ); 243 | $form['title_length'] = array( 244 | '#type' => 'number', 245 | '#title' => t('Maximum number of characters in vocabulary names'), 246 | '#default_value' => 12, 247 | '#min' => 1, 248 | '#max' => 1000, 249 | ); 250 | $form['kill_taxonomy'] = array( 251 | '#type' => 'checkbox', 252 | '#title' => t('Delete existing vocabularies before generating new ones.'), 253 | '#default_value' => FALSE, 254 | ); 255 | $form['submit'] = array( 256 | '#type' => 'submit', 257 | '#value' => t('Generate'), 258 | ); 259 | 260 | return $form; 261 | } 262 | 263 | /** 264 | * FormAPI submission to generate taxonomy terms. 265 | */ 266 | function devel_generate_term_form_submit($form_id, &$form_state) { 267 | module_load_include('inc', 'devel_generate'); 268 | $vocab_names = array_keys(array_filter($form_state['values']['vocabularies'])); 269 | $vocabs = taxonomy_vocabulary_load_multiple($vocab_names); 270 | devel_generate_term_data($vocabs, $form_state['values']['num_terms'], $form_state['values']['title_length'], $form_state['values']['kill_taxonomy']); 271 | } 272 | 273 | /** 274 | * FormAPI submission to generate taxonomy vocabularies. 275 | */ 276 | function devel_generate_vocab_form_submit($form_id, &$form_state) { 277 | module_load_include('inc', 'devel_generate'); 278 | devel_generate_vocab_data($form_state['values']['num_vocabs'], $form_state['values']['title_length'], $form_state['values']['kill_taxonomy']); 279 | } 280 | 281 | /** 282 | * Inserts nodes properly based on generation options. 283 | * 284 | * @param $node 285 | * The base node created on submit. Inspects $node->devel_generate. 286 | */ 287 | function devel_generate_node_insert($node) { 288 | if (isset($node->devel_generate)) { 289 | $results = $node->devel_generate; 290 | 291 | // Add comments if configured and enabled on the given type of node. 292 | if (!empty($results['max_comments']) && $node->comment >= COMMENT_NODE_OPEN) { 293 | devel_generate_add_comments($node, $results['users'], $results['max_comments'], $results['title_length']); 294 | } 295 | 296 | // Add an url alias. Cannot happen before save because we don't know the nid. 297 | if (!empty($results['add_alias'])) { 298 | // Check if an alias will be made automatically. 299 | module_load_include('inc', 'path'); 300 | if (function_exists('path_generate_entity_alias')) { 301 | $alias = path_generate_entity_alias($node); 302 | if (!$alias) { 303 | $path = array( 304 | 'source' => 'node/' . $node->nid, 305 | 'alias' => 'node-' . $node->nid . '-' . $node->type, 306 | ); 307 | path_save($path); 308 | } 309 | } 310 | } 311 | } 312 | } 313 | 314 | /** 315 | * Generates menus using FormAPI. 316 | */ 317 | function devel_generate_menu_form() { 318 | $menu_enabled = module_exists('menu'); 319 | if ($menu_enabled) { 320 | $menus = menu_get_menus() + array('__new-menu__' => t('Create new menu(s)')); 321 | } 322 | else { 323 | $menus = menu_list_system_menus(); 324 | } 325 | $form['existing_menus'] = array( 326 | '#type' => 'checkboxes', 327 | '#title' => t('Generate links for these menus'), 328 | '#options' => $menus, 329 | '#default_value' => array('__new-menu__'), 330 | '#required' => TRUE, 331 | ); 332 | if ($menu_enabled) { 333 | $form['num_menus'] = array( 334 | '#type' => 'number', 335 | '#title' => t('Number of new menus to create'), 336 | '#default_value' => 2, 337 | '#min' => 1, 338 | '#max' => 999, 339 | '#states' => array( 340 | 'visible' => array( 341 | ':input[name="existing_menus[__new-menu__]"]' => array('checked' => TRUE), 342 | ), 343 | ), 344 | ); 345 | } 346 | $form['num_links'] = array( 347 | '#type' => 'number', 348 | '#title' => t('Number of links to generate'), 349 | '#default_value' => 50, 350 | '#min' => 1, 351 | '#max' => 10000, 352 | '#required' => TRUE, 353 | ); 354 | $form['title_length'] = array( 355 | '#type' => 'number', 356 | '#title' => t('Maximum number of characters in menu and menu link names'), 357 | '#default_value' => 12, 358 | '#min' => 1, 359 | '#max' => 1000, 360 | '#required' => TRUE, 361 | ); 362 | $form['link_types'] = array( 363 | '#type' => 'checkboxes', 364 | '#title' => t('Types of links to generate'), 365 | '#options' => array( 366 | 'node' => t('Nodes'), 367 | 'front' => t('Front page'), 368 | 'external' => t('External'), 369 | ), 370 | '#default_value' => array('node', 'front', 'external'), 371 | '#required' => TRUE, 372 | ); 373 | $form['max_depth'] = array( 374 | '#type' => 'select', 375 | '#title' => t('Maximum link depth'), 376 | '#options' => range(0, MENU_MAX_DEPTH), 377 | '#default_value' => floor(MENU_MAX_DEPTH / 2), 378 | '#required' => TRUE, 379 | ); 380 | unset($form['max_depth']['#options'][0]); 381 | $form['max_width'] = array( 382 | '#type' => 'number', 383 | '#title' => t('Maximum menu width'), 384 | '#default_value' => 6, 385 | '#min' => 1, 386 | '#max' => 100, 387 | '#description' => t("Limit the width of the generated menu's first level of links to a certain number of items."), 388 | '#required' => TRUE, 389 | ); 390 | $form['kill'] = array( 391 | '#type' => 'checkbox', 392 | '#title' => t('Delete existing custom generated menus and menu links before generating new ones.'), 393 | '#default_value' => FALSE, 394 | ); 395 | $form['submit'] = array( 396 | '#type' => 'submit', 397 | '#value' => t('Generate'), 398 | ); 399 | return $form; 400 | } 401 | 402 | /** 403 | * FormAPI submission to generate menus. 404 | */ 405 | function devel_generate_menu_form_submit($form_id, &$form_state) { 406 | // If the create new menus checkbox is off, set the number of new menus to 0. 407 | if (!isset($form_state['values']['existing_menus']['__new-menu__']) || !$form_state['values']['existing_menus']['__new-menu__']) { 408 | $form_state['values']['num_menus'] = 0; 409 | } 410 | module_load_include('inc', 'devel_generate'); 411 | devel_generate_menu_data($form_state['values']['num_menus'], $form_state['values']['existing_menus'], $form_state['values']['num_links'], $form_state['values']['title_length'], $form_state['values']['link_types'], $form_state['values']['max_depth'], $form_state['values']['max_width'], $form_state['values']['kill']); 412 | } 413 | -------------------------------------------------------------------------------- /devel_generate/devel_generate_batch.inc: -------------------------------------------------------------------------------- 1 | t('Generating Content'), 30 | 'operations' => $operations, 31 | 'finished' => 'devel_generate_batch_finished', 32 | 'file' => backdrop_get_path('module', 'devel_generate') . '/devel_generate_batch.inc', 33 | ); 34 | batch_set($batch); 35 | } 36 | 37 | function devel_generate_batch_content_kill(&$context) { 38 | module_load_include('inc', 'devel_generate', 'devel_generate'); 39 | devel_generate_content_kill($context['results']); 40 | } 41 | 42 | function devel_generate_batch_content_pre_node($vars, &$context) { 43 | $context['results'] = $vars; 44 | $context['results']['num_nids'] = 0; 45 | module_load_include('inc', 'devel_generate', 'devel_generate'); 46 | devel_generate_content_pre_node($context['results']); 47 | } 48 | 49 | /** 50 | * Batch API callback: Generate nodes. 51 | */ 52 | function devel_generate_batch_content_add_node(&$context) { 53 | module_load_include('inc', 'devel_generate', 'devel_generate'); 54 | devel_generate_content_add_node($context['results']); 55 | $context['results']['num_nids'] ++; 56 | } 57 | 58 | /** 59 | * Display a message when a batch is complete. 60 | */ 61 | function devel_generate_batch_finished($success, $results, $operations) { 62 | if ($success) { 63 | $message = t('Finished @num_nids nodes created successfully.', array('@num_nids' => $results['num_nids'])); 64 | } 65 | else { 66 | $message = t('Finished with an error.'); 67 | } 68 | backdrop_set_message($message); 69 | } 70 | 71 | -------------------------------------------------------------------------------- /devel_generate/modules/date.devel_generate.inc: -------------------------------------------------------------------------------- 1 | getReferencableEntities(); 21 | if (is_array($referencable_entity) && !empty($referencable_entity)) { 22 | // $referencable_entity is keyed by bundle type. 23 | $random_bundle = array_rand($referencable_entity); 24 | if (!empty($random_bundle)) { 25 | $target_id = array_rand($referencable_entity[$random_bundle]); 26 | if (!empty($referencable_entity[$random_bundle][$target_id])) { 27 | $object_field['target_id'] = $target_id; 28 | } 29 | } 30 | } 31 | return $object_field; 32 | } 33 | -------------------------------------------------------------------------------- /devel_generate/modules/file.devel_generate.inc: -------------------------------------------------------------------------------- 1 | fid = NULL; 26 | $file->uri = $uri; 27 | $file->filename = backdrop_basename($uri); 28 | $file->filemime = file_get_mimetype($file->uri); 29 | // @todo Randomize file owner. 30 | $file->uid = 1; 31 | $file = file_save($file); 32 | } 33 | else { 34 | return FALSE; 35 | } 36 | } 37 | else { 38 | return FALSE; 39 | } 40 | } 41 | if (!$file) { 42 | // In case a previous file operation failed or no file is set, return FALSE 43 | return FALSE; 44 | } 45 | else { 46 | $object_field['fid'] = $file->fid; 47 | $object_field['display'] = $field['settings']['display_default']; 48 | $object_field['description'] = devel_create_greeking(10); 49 | 50 | return $object_field; 51 | } 52 | } 53 | 54 | /** 55 | * Private function for generating a random text file. 56 | */ 57 | function devel_generate_textfile($filesize = 1024) { 58 | if ($tmp_file = backdrop_tempnam('temporary://', 'filefield_')) { 59 | $destination = $tmp_file . '.txt'; 60 | file_unmanaged_move($tmp_file, $destination); 61 | 62 | $fp = fopen($destination, 'w'); 63 | fwrite($fp, str_repeat('01', $filesize/2)); 64 | fclose($fp); 65 | 66 | return $destination; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /devel_generate/modules/image.devel_generate.inc: -------------------------------------------------------------------------------- 1 | fid = NULL; 38 | $file->uri = $uri; 39 | $file->filename = backdrop_basename($uri); 40 | $file->filemime = file_get_mimetype($file->uri); 41 | // @todo Randomize file owner. 42 | $file->uid = 1; 43 | file_save($file); 44 | $images[$extension][$min_size][$max_size][$file->fid] = $file; 45 | } 46 | else { 47 | return FALSE; 48 | } 49 | } 50 | else { 51 | return FALSE; 52 | } 53 | } 54 | else { 55 | // Select one of the images we've already generated for this field. 56 | $file = new File(); 57 | $file->fid = array_rand($images[$extension][$min_size][$max_size]); 58 | } 59 | 60 | $object_field['fid'] = $file->fid; 61 | $object_field['alt'] = devel_create_greeking(4); 62 | $object_field['title'] = devel_create_greeking(4); 63 | return $object_field; 64 | } 65 | 66 | /** 67 | * Private function for creating a random image. 68 | * 69 | * This function only works with the GD toolkit. ImageMagick is not supported. 70 | */ 71 | function devel_generate_image($extension = 'png', $min_resolution = 0, $max_resolution = 100000) { 72 | if ($tmp_file = backdrop_tempnam('temporary://', 'imagefield_')) { 73 | $destination = $tmp_file . '.' . $extension; 74 | file_unmanaged_move($tmp_file, $destination, FILE_CREATE_DIRECTORY); 75 | 76 | $min = explode('x', $min_resolution); 77 | $max = explode('x', $max_resolution); 78 | 79 | $width = rand((int)$min[0], (int)$max[0]); 80 | $height = rand((int)$min[1], (int)$max[1]); 81 | 82 | $half_width = (int)($width/2); 83 | $half_height = (int)($height/2); 84 | 85 | // Make an image split into 4 sections with random colors. 86 | $im = imagecreate($width, $height); 87 | for ($n = 0; $n < 4; $n++) { 88 | $color = imagecolorallocate($im, rand(0, 255), rand(0, 255), rand(0, 255)); 89 | $x = (int)($half_width * ($n % 2)); 90 | $y = (int)($half_height * (int) ($n >= 2)); 91 | imagefilledrectangle($im, intval($x), intval($y), intval($x + $half_width), intval($y + $half_height), $color); 92 | } 93 | 94 | // Make a perfect circle in the image middle. 95 | $color = imagecolorallocate($im, rand(0, 255), rand(0, 255), rand(0, 255)); 96 | $smaller_dimension = min($width, $height); 97 | $smaller_dimension = (int)(($smaller_dimension % 2) ? $smaller_dimension : $smaller_dimension); 98 | imageellipse($im, intval($half_width), intval($half_height), intval($smaller_dimension), intval($smaller_dimension), $color); 99 | 100 | $save_function = 'image'. ($extension == 'jpg' ? 'jpeg' : $extension); 101 | $save_function($im, backdrop_realpath($destination)); 102 | 103 | $images[$extension][$min_size][$max_size][$destination] = $destination; 104 | } 105 | return $destination; 106 | } 107 | -------------------------------------------------------------------------------- /devel_generate/modules/link.devel_generate.inc: -------------------------------------------------------------------------------- 1 | url('', array('absolute' => TRUE)), 24 | 'attributes' => _link_default_attributes(), 25 | ); 26 | if ($instance['settings']['title'] != 'none') { 27 | $link['title'] = devel_create_greeking(mt_rand(1, 3), TRUE); 28 | } 29 | return $link; 30 | } 31 | -------------------------------------------------------------------------------- /devel_generate/modules/list.devel_generate.inc: -------------------------------------------------------------------------------- 1 | $vocabulary->machine_name))->fetchField()) { 23 | $candidate = mt_rand(1, $max); 24 | $query = db_select('taxonomy_term_data', 't'); 25 | $tid = $query 26 | ->fields('t', array('tid')) 27 | ->condition('t.vocabulary', $vocabulary->machine_name, '=') 28 | ->condition('t.tid', $candidate, '>=') 29 | ->range(0,1) 30 | ->execute() 31 | ->fetchField(); 32 | // If there are no terms for the taxonomy, the query will fail, in which 33 | // case we return NULL. 34 | if ($tid === FALSE) { 35 | return NULL; 36 | } 37 | $object_field['tid'] = (int) $tid; 38 | return $object_field; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /devel_generate/modules/text.devel_generate.inc: -------------------------------------------------------------------------------- 1 | tags. 29 | $include_p_tags = TRUE; 30 | if (array_key_exists('filter_html_escape', $format->filters)) { 31 | $include_p_tags = FALSE; 32 | } 33 | 34 | if ($instance['widget']['type'] != 'text_textfield') { 35 | // Textarea handling 36 | $object_field['value'] = devel_create_content($include_p_tags); 37 | if ($instance['widget']['type'] == 'text_textarea_with_summary' && !empty($instance['display_summary'])) { 38 | $object_field['summary'] = devel_create_content($include_p_tags); 39 | } 40 | } 41 | else { 42 | // Textfield handling. 43 | // Generate a value that respects max_length. 44 | if (empty($field['settings']['max_length'])) { 45 | $field['settings']['max_length'] = 12; 46 | } 47 | $object_field['value'] = user_password($field['settings']['max_length']); 48 | } 49 | $object_field['format'] = $format_name; 50 | return $object_field; 51 | } 52 | -------------------------------------------------------------------------------- /devel_krumo.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Krumo 3 | */ 4 | .krumo-version, 5 | .krumo-call { 6 | white-space: nowrap; 7 | } 8 | 9 | .krumo-nest { 10 | display: none; 11 | } 12 | -------------------------------------------------------------------------------- /devel_krumo.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * Behaviors for Devel. 4 | */ 5 | 6 | (function ($) { 7 | 8 | /** 9 | * Attaches double-click behavior to toggle full path of Krumo elements. 10 | * 11 | * @type {Backdrop~behavior} 12 | */ 13 | Backdrop.behaviors.devel = { 14 | attach: function (context, settings) { 15 | 16 | // Add hint to footnote. 17 | $('.krumo-footnote .krumo-call', context).once().before(''); 18 | 19 | var krumo_name = []; 20 | var krumo_type = []; 21 | 22 | function krumo_traverse(el) { 23 | krumo_name.push($(el).html()); 24 | krumo_type.push($(el).siblings('em').html().match(/\w*/)[0]); 25 | 26 | if ($(el).closest('.krumo-nest').length > 0) { 27 | krumo_traverse($(el).closest('.krumo-nest').prev().find('.krumo-name')); 28 | } 29 | } 30 | 31 | $('.krumo-child > div:first-child', context).once('krumo_path', 32 | function() { 33 | $('.krumo-child > div:first-child', context).dblclick( 34 | function(e) { 35 | if ($(this).find('> .krumo-php-path').length > 0) { 36 | // Remove path if shown. 37 | $(this).find('> .krumo-php-path').remove(); 38 | } 39 | else { 40 | // Get elements. 41 | krumo_traverse($(this).find('> a.krumo-name')); 42 | 43 | // Create path. 44 | var krumo_path_string = ''; 45 | for (var i = krumo_name.length - 1; i >= 0; --i) { 46 | // Start element. 47 | if ((krumo_name.length - 1) == i) 48 | krumo_path_string += '$' + krumo_name[i]; 49 | 50 | if (typeof krumo_name[(i-1)] !== 'undefined') { 51 | if (krumo_type[i] == 'Array') { 52 | krumo_path_string += "["; 53 | if (!/^\d*$/.test(krumo_name[(i-1)])) 54 | krumo_path_string += "'"; 55 | krumo_path_string += krumo_name[(i-1)]; 56 | if (!/^\d*$/.test(krumo_name[(i-1)])) 57 | krumo_path_string += "'"; 58 | krumo_path_string += "]"; 59 | } 60 | if (krumo_type[i] == 'Object') 61 | krumo_path_string += '->' + krumo_name[(i-1)]; 62 | } 63 | } 64 | $(this).append('
' + krumo_path_string + '
'); 65 | 66 | // Reset arrays. 67 | krumo_name = []; 68 | krumo_type = []; 69 | } 70 | }); 71 | }); 72 | 73 | // Events 74 | $('.krumo-element').once('krumo-events', function() { 75 | $(this).click(function() { 76 | krumo.toggle(this); 77 | }).mouseover(function() { 78 | krumo.over(this); 79 | }).mouseout(function() { 80 | krumo.out(this); 81 | }); 82 | }); // End krumo-events .once. 83 | } // End attach. 84 | }; // End behaviors.devel. 85 | 86 | })(jQuery); // End outer function. 87 | -------------------------------------------------------------------------------- /devel_node_access/README.md: -------------------------------------------------------------------------------- 1 | Devel Node Access 2 | ================= 3 | 4 | This module contains tools for developers using access control modules 5 | to restrict access to some nodes. It is intended to help catch some 6 | common mistakes and provide feedback to confirm that restricted nodes 7 | are in fact visible only to the intended users. 8 | 9 | Provides a summary page which queries the node_access table and 10 | reports common mistakes such as the presence of Backdrop's default entry 11 | which grants all users read access to all nodes. Also reports the 12 | presence of nodes not represented in node_access table. This may 13 | occur when an access control module is installed after nodes have 14 | already been created. 15 | 16 | Provides a block which shows all node_access entries for the nodes 17 | shown on a given page. This gives developers a quick check to see 18 | that grants are provided as they should be. This block auto-enables 19 | to the footer region. You may move it as desired. 20 | 21 | Allows browsing of nodes by realm, including those nodes not in the node_access 22 | table (NULL realm). 23 | 24 | Wishlist 25 | -------- 26 | 27 | * Automatically solve common problems. I.e. delete the "all" realm 28 | entry, and automatically save all nodes not in the node_access table. 29 | 30 | * Nicer feedback indicating whether nodes are visible to the public or 31 | not. I.e. use color coding or icons. 32 | 33 | * Summary does not differentiate between view grants and other types 34 | of grants. I personally use node_access only for view grants so I'm 35 | not sure exactly what else it should show. 36 | 37 | Maintainers 38 | ----------- 39 | 40 | This module is currently seeking maintainers. 41 | 42 | Originally written for Drupal by: 43 | 44 | Dave Cohen (https://www.drupal.org/user/18468) 45 | -------------------------------------------------------------------------------- /devel_node_access/devel_node_access.api.php: -------------------------------------------------------------------------------- 1 | realm == 'mymodule_myrealm') { 46 | if ($row->grant_view) { 47 | $role = user_role_load($row->gid); 48 | return 'Role ' . backdrop_placeholder($role->name) . ' may view this node.'; 49 | } 50 | else { 51 | return 'No access.'; 52 | } 53 | } 54 | } 55 | 56 | /** 57 | * Acknowledge ownership of 'alien' grant records. 58 | * 59 | * Some node access modules store grant records directly into the {node_access} 60 | * table rather than returning them through hook_node_access_records(). This 61 | * practice is not recommended and DNA will flag all such records as 'alien'. 62 | * 63 | * If this is unavoidable, a module can confess to being the owner of these 64 | * grant records, so that DNA can properly attribute them. 65 | * 66 | * @see hook_node_access_records() 67 | * 68 | * @ingroup node_access 69 | */ 70 | function hook_node_access_acknowledge($grant) { 71 | if ($grant['realm'] == 'mymodule_all' && $grant['nid'] == 0) { 72 | return TRUE; 73 | } 74 | } 75 | 76 | /** 77 | * @} End of "addtogroup hooks". 78 | */ 79 | -------------------------------------------------------------------------------- /devel_node_access/devel_node_access.info: -------------------------------------------------------------------------------- 1 | name = Devel Node Access 2 | description = Developer blocks and page illustrating relevant node_access records. 3 | package = Development 4 | backdrop = 1.x 5 | dependencies[] = menu 6 | configure = admin/config/development/devel 7 | type = module 8 | -------------------------------------------------------------------------------- /devel_node_access/devel_node_access.install: -------------------------------------------------------------------------------- 1 | ' 39 | + '' 40 | + Backdrop.t('Error: could not explain access') 41 | + '' 42 | + '' 43 | ) 44 | .addClass('ajax-processed'); 45 | // Call this function again. 46 | devel_node_access_user_ajax(context); 47 | } 48 | }, 49 | 3000 50 | ); 51 | 52 | } 53 | } 54 | 55 | /** 56 | * Attach the access by user behavior which initiates ajax. 57 | * 58 | * @type {Backdrop~behavior} 59 | */ 60 | Backdrop.behaviors.develNodeAccessUserAjax = { 61 | attach: function(context) { 62 | // Start the ajax. 63 | devel_node_access_user_ajax(context); 64 | } 65 | }; 66 | 67 | })(jQuery); 68 | -------------------------------------------------------------------------------- /lib/chromephp/ChromePhp.php: -------------------------------------------------------------------------------- 1 | 23 | */ 24 | class ChromePhp 25 | { 26 | /** 27 | * @var string 28 | */ 29 | const VERSION = '4.1.0'; 30 | 31 | /** 32 | * @var string 33 | */ 34 | const HEADER_NAME = 'X-ChromeLogger-Data'; 35 | 36 | /** 37 | * @var string 38 | */ 39 | const BACKTRACE_LEVEL = 'backtrace_level'; 40 | 41 | /** 42 | * @var string 43 | */ 44 | const LOG = 'log'; 45 | 46 | /** 47 | * @var string 48 | */ 49 | const WARN = 'warn'; 50 | 51 | /** 52 | * @var string 53 | */ 54 | const ERROR = 'error'; 55 | 56 | /** 57 | * @var string 58 | */ 59 | const GROUP = 'group'; 60 | 61 | /** 62 | * @var string 63 | */ 64 | const INFO = 'info'; 65 | 66 | /** 67 | * @var string 68 | */ 69 | const GROUP_END = 'groupEnd'; 70 | 71 | /** 72 | * @var string 73 | */ 74 | const GROUP_COLLAPSED = 'groupCollapsed'; 75 | 76 | /** 77 | * @var string 78 | */ 79 | const TABLE = 'table'; 80 | 81 | /** 82 | * @var string 83 | */ 84 | protected $_php_version; 85 | 86 | /** 87 | * @var int 88 | */ 89 | protected $_timestamp; 90 | 91 | /** 92 | * @var array 93 | */ 94 | protected $_json = array( 95 | 'version' => self::VERSION, 96 | 'columns' => array('log', 'backtrace', 'type'), 97 | 'rows' => array() 98 | ); 99 | 100 | /** 101 | * @var array 102 | */ 103 | protected $_backtraces = array(); 104 | 105 | /** 106 | * @var bool 107 | */ 108 | protected $_error_triggered = false; 109 | 110 | /** 111 | * @var array 112 | */ 113 | protected $_settings = array( 114 | self::BACKTRACE_LEVEL => 1 115 | ); 116 | 117 | /** 118 | * @var ChromePhp 119 | */ 120 | protected static $_instance; 121 | 122 | /** 123 | * Prevent recursion when working with objects referring to each other 124 | * 125 | * @var array 126 | */ 127 | protected $_processed = array(); 128 | 129 | /** 130 | * constructor 131 | */ 132 | private function __construct() 133 | { 134 | $this->_php_version = phpversion(); 135 | $this->_timestamp = $this->_php_version >= 5.1 ? $_SERVER['REQUEST_TIME'] : time(); 136 | $this->_json['request_uri'] = $_SERVER['REQUEST_URI']; 137 | } 138 | 139 | /** 140 | * gets instance of this class 141 | * 142 | * @return ChromePhp 143 | */ 144 | public static function getInstance() 145 | { 146 | if (self::$_instance === null) { 147 | self::$_instance = new self(); 148 | } 149 | return self::$_instance; 150 | } 151 | 152 | /** 153 | * logs a variable to the console 154 | * 155 | * @param mixed $data,... unlimited OPTIONAL number of additional logs [...] 156 | * @return void 157 | */ 158 | public static function log() 159 | { 160 | $args = func_get_args(); 161 | return self::_log('', $args); 162 | } 163 | 164 | /** 165 | * logs a warning to the console 166 | * 167 | * @param mixed $data,... unlimited OPTIONAL number of additional logs [...] 168 | * @return void 169 | */ 170 | public static function warn() 171 | { 172 | $args = func_get_args(); 173 | return self::_log(self::WARN, $args); 174 | } 175 | 176 | /** 177 | * logs an error to the console 178 | * 179 | * @param mixed $data,... unlimited OPTIONAL number of additional logs [...] 180 | * @return void 181 | */ 182 | public static function error() 183 | { 184 | $args = func_get_args(); 185 | return self::_log(self::ERROR, $args); 186 | } 187 | 188 | /** 189 | * sends a group log 190 | * 191 | * @param string value 192 | */ 193 | public static function group() 194 | { 195 | $args = func_get_args(); 196 | return self::_log(self::GROUP, $args); 197 | } 198 | 199 | /** 200 | * sends an info log 201 | * 202 | * @param mixed $data,... unlimited OPTIONAL number of additional logs [...] 203 | * @return void 204 | */ 205 | public static function info() 206 | { 207 | $args = func_get_args(); 208 | return self::_log(self::INFO, $args); 209 | } 210 | 211 | /** 212 | * sends a collapsed group log 213 | * 214 | * @param string value 215 | */ 216 | public static function groupCollapsed() 217 | { 218 | $args = func_get_args(); 219 | return self::_log(self::GROUP_COLLAPSED, $args); 220 | } 221 | 222 | /** 223 | * ends a group log 224 | * 225 | * @param string value 226 | */ 227 | public static function groupEnd() 228 | { 229 | $args = func_get_args(); 230 | return self::_log(self::GROUP_END, $args); 231 | } 232 | 233 | /** 234 | * sends a table log 235 | * 236 | * @param string value 237 | */ 238 | public static function table() 239 | { 240 | $args = func_get_args(); 241 | return self::_log(self::TABLE, $args); 242 | } 243 | 244 | /** 245 | * internal logging call 246 | * 247 | * @param string $type 248 | * @return void 249 | */ 250 | protected static function _log($type, array $args) 251 | { 252 | // nothing passed in, don't do anything 253 | if (count($args) == 0 && $type != self::GROUP_END) { 254 | return; 255 | } 256 | 257 | $logger = self::getInstance(); 258 | 259 | $logger->_processed = array(); 260 | 261 | $logs = array(); 262 | foreach ($args as $arg) { 263 | $logs[] = $logger->_convert($arg); 264 | } 265 | 266 | $backtrace = debug_backtrace(false); 267 | $level = $logger->getSetting(self::BACKTRACE_LEVEL); 268 | 269 | $backtrace_message = 'unknown'; 270 | if (isset($backtrace[$level]['file']) && isset($backtrace[$level]['line'])) { 271 | $backtrace_message = $backtrace[$level]['file'] . ' : ' . $backtrace[$level]['line']; 272 | } 273 | 274 | $logger->_addRow($logs, $backtrace_message, $type); 275 | } 276 | 277 | /** 278 | * converts an object to a better format for logging 279 | * 280 | * @param Object 281 | * @return array 282 | */ 283 | protected function _convert($object) 284 | { 285 | // if this isn't an object then just return it 286 | if (!is_object($object)) { 287 | return $object; 288 | } 289 | 290 | //Mark this object as processed so we don't convert it twice and it 291 | //Also avoid recursion when objects refer to each other 292 | $this->_processed[] = $object; 293 | 294 | $object_as_array = array(); 295 | 296 | // first add the class name 297 | $object_as_array['___class_name'] = get_class($object); 298 | 299 | // loop through object vars 300 | $object_vars = get_object_vars($object); 301 | foreach ($object_vars as $key => $value) { 302 | 303 | // same instance as parent object 304 | if ($value === $object || in_array($value, $this->_processed, true)) { 305 | $value = 'recursion - parent object [' . get_class($value) . ']'; 306 | } 307 | $object_as_array[$key] = $this->_convert($value); 308 | } 309 | 310 | $reflection = new ReflectionClass($object); 311 | 312 | // loop through the properties and add those 313 | foreach ($reflection->getProperties() as $property) { 314 | 315 | // if one of these properties was already added above then ignore it 316 | if (array_key_exists($property->getName(), $object_vars)) { 317 | continue; 318 | } 319 | $type = $this->_getPropertyKey($property); 320 | 321 | if ($this->_php_version >= 5.3) { 322 | $property->setAccessible(true); 323 | } 324 | 325 | try { 326 | $value = $property->getValue($object); 327 | } catch (ReflectionException $e) { 328 | $value = 'only PHP 5.3 can access private/protected properties'; 329 | } 330 | 331 | // same instance as parent object 332 | if ($value === $object || in_array($value, $this->_processed, true)) { 333 | $value = 'recursion - parent object [' . get_class($value) . ']'; 334 | } 335 | 336 | $object_as_array[$type] = $this->_convert($value); 337 | } 338 | return $object_as_array; 339 | } 340 | 341 | /** 342 | * takes a reflection property and returns a nicely formatted key of the property name 343 | * 344 | * @param ReflectionProperty 345 | * @return string 346 | */ 347 | protected function _getPropertyKey(ReflectionProperty $property) 348 | { 349 | $static = $property->isStatic() ? ' static' : ''; 350 | if ($property->isPublic()) { 351 | return 'public' . $static . ' ' . $property->getName(); 352 | } 353 | 354 | if ($property->isProtected()) { 355 | return 'protected' . $static . ' ' . $property->getName(); 356 | } 357 | 358 | if ($property->isPrivate()) { 359 | return 'private' . $static . ' ' . $property->getName(); 360 | } 361 | } 362 | 363 | /** 364 | * adds a value to the data array 365 | * 366 | * @var mixed 367 | * @return void 368 | */ 369 | protected function _addRow(array $logs, $backtrace, $type) 370 | { 371 | // if this is logged on the same line for example in a loop, set it to null to save space 372 | if (in_array($backtrace, $this->_backtraces)) { 373 | $backtrace = null; 374 | } 375 | 376 | // for group, groupEnd, and groupCollapsed 377 | // take out the backtrace since it is not useful 378 | if ($type == self::GROUP || $type == self::GROUP_END || $type == self::GROUP_COLLAPSED) { 379 | $backtrace = null; 380 | } 381 | 382 | if ($backtrace !== null) { 383 | $this->_backtraces[] = $backtrace; 384 | } 385 | 386 | $row = array($logs, $backtrace, $type); 387 | 388 | $this->_json['rows'][] = $row; 389 | $this->_writeHeader($this->_json); 390 | } 391 | 392 | protected function _writeHeader($data) 393 | { 394 | header(self::HEADER_NAME . ': ' . $this->_encode($data)); 395 | } 396 | 397 | /** 398 | * encodes the data to be sent along with the request 399 | * 400 | * @param array $data 401 | * @return string 402 | */ 403 | protected function _encode($data) 404 | { 405 | return base64_encode(utf8_encode(json_encode($data))); 406 | } 407 | 408 | /** 409 | * adds a setting 410 | * 411 | * @param string key 412 | * @param mixed value 413 | * @return void 414 | */ 415 | public function addSetting($key, $value) 416 | { 417 | $this->_settings[$key] = $value; 418 | } 419 | 420 | /** 421 | * add ability to set multiple settings in one call 422 | * 423 | * @param array $settings 424 | * @return void 425 | */ 426 | public function addSettings(array $settings) 427 | { 428 | foreach ($settings as $key => $value) { 429 | $this->addSetting($key, $value); 430 | } 431 | } 432 | 433 | /** 434 | * gets a setting 435 | * 436 | * @param string key 437 | * @return mixed 438 | */ 439 | public function getSetting($key) 440 | { 441 | if (!isset($this->_settings[$key])) { 442 | return null; 443 | } 444 | return $this->_settings[$key]; 445 | } 446 | } 447 | -------------------------------------------------------------------------------- /lib/firephp/fb.php: -------------------------------------------------------------------------------- 1 | , Copyright 2007, New BSD License 4 | // - qbbr, Sokolov Innokenty , Copyright 2011, New BSD License 5 | // - cadorn, Christoph Dorn , Copyright 2011, MIT License 6 | 7 | /** 8 | * ***** BEGIN LICENSE BLOCK ***** 9 | * 10 | * [MIT License](http://www.opensource.org/licenses/mit-license.php) 11 | * 12 | * Copyright (c) 2007+ [Christoph Dorn](http://www.christophdorn.com/) 13 | * 14 | * Permission is hereby granted, free of charge, to any person obtaining a copy 15 | * of this software and associated documentation files (the "Software"), to deal 16 | * in the Software without restriction, including without limitation the rights 17 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 18 | * copies of the Software, and to permit persons to whom the Software is 19 | * furnished to do so, subject to the following conditions: 20 | * 21 | * The above copyright notice and this permission notice shall be included in 22 | * all copies or substantial portions of the Software. 23 | * 24 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 29 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 30 | * THE SOFTWARE. 31 | * 32 | * ***** END LICENSE BLOCK ***** 33 | * 34 | * @copyright Copyright (C) 2007+ Christoph Dorn 35 | * @author Christoph Dorn 36 | * @license [MIT License](http://www.opensource.org/licenses/mit-license.php) 37 | * @package FirePHPCore 38 | */ 39 | 40 | if (!class_exists('FirePHP', false)) { 41 | require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'FirePHP.class.php'; 42 | } 43 | 44 | /** 45 | * Sends the given data to the FirePHP Firefox Extension. 46 | * The data can be displayed in the Firebug Console or in the 47 | * "Server" request tab. 48 | * 49 | * @see http://www.firephp.org/Wiki/Reference/Fb 50 | * @param mixed $Object 51 | * @return true 52 | * @throws Exception 53 | */ 54 | function fb() 55 | { 56 | $instance = FirePHP::getInstance(true); 57 | 58 | $args = func_get_args(); 59 | return call_user_func_array(array($instance, 'fb'), $args); 60 | } 61 | 62 | 63 | class FB 64 | { 65 | /** 66 | * Set an Insight console to direct all logging calls to 67 | * 68 | * @param object $console The console object to log to 69 | * @return void 70 | */ 71 | public static function setLogToInsightConsole($console) 72 | { 73 | FirePHP::getInstance(true)->setLogToInsightConsole($console); 74 | } 75 | 76 | /** 77 | * Enable and disable logging to Firebug 78 | * 79 | * @see FirePHP->setEnabled() 80 | * @param boolean $enabled TRUE to enable, FALSE to disable 81 | * @return void 82 | */ 83 | public static function setEnabled($enabled) 84 | { 85 | FirePHP::getInstance(true)->setEnabled($enabled); 86 | } 87 | 88 | /** 89 | * Check if logging is enabled 90 | * 91 | * @see FirePHP->getEnabled() 92 | * @return boolean TRUE if enabled 93 | */ 94 | public static function getEnabled() 95 | { 96 | return FirePHP::getInstance(true)->getEnabled(); 97 | } 98 | 99 | /** 100 | * Specify a filter to be used when encoding an object 101 | * 102 | * Filters are used to exclude object members. 103 | * 104 | * @see FirePHP->setObjectFilter() 105 | * @param string $class The class name of the object 106 | * @param array $filter An array or members to exclude 107 | * @return void 108 | */ 109 | public static function setObjectFilter($class, $filter) 110 | { 111 | FirePHP::getInstance(true)->setObjectFilter($class, $filter); 112 | } 113 | 114 | /** 115 | * Set some options for the library 116 | * 117 | * @see FirePHP->setOptions() 118 | * @param array $options The options to be set 119 | * @return void 120 | */ 121 | public static function setOptions($options) 122 | { 123 | FirePHP::getInstance(true)->setOptions($options); 124 | } 125 | 126 | /** 127 | * Get options for the library 128 | * 129 | * @see FirePHP->getOptions() 130 | * @return array The options 131 | */ 132 | public static function getOptions() 133 | { 134 | return FirePHP::getInstance(true)->getOptions(); 135 | } 136 | 137 | /** 138 | * Log object to firebug 139 | * 140 | * @see http://www.firephp.org/Wiki/Reference/Fb 141 | * @param mixed $object 142 | * @return true 143 | * @throws Exception 144 | */ 145 | public static function send() 146 | { 147 | $args = func_get_args(); 148 | return call_user_func_array(array(FirePHP::getInstance(true), 'fb'), $args); 149 | } 150 | 151 | /** 152 | * Start a group for following messages 153 | * 154 | * Options: 155 | * Collapsed: [true|false] 156 | * Color: [#RRGGBB|ColorName] 157 | * 158 | * @param string $name 159 | * @param array $options OPTIONAL Instructions on how to log the group 160 | * @return true 161 | */ 162 | public static function group($name, $options=null) 163 | { 164 | return FirePHP::getInstance(true)->group($name, $options); 165 | } 166 | 167 | /** 168 | * Ends a group you have started before 169 | * 170 | * @return true 171 | * @throws Exception 172 | */ 173 | public static function groupEnd() 174 | { 175 | return self::send(null, null, FirePHP::GROUP_END); 176 | } 177 | 178 | /** 179 | * Log object with label to firebug console 180 | * 181 | * @see FirePHP::LOG 182 | * @param mixed $object 183 | * @param string $label 184 | * @return true 185 | * @throws Exception 186 | */ 187 | public static function log($object, $label=null) 188 | { 189 | return self::send($object, $label, FirePHP::LOG); 190 | } 191 | 192 | /** 193 | * Log object with label to firebug console 194 | * 195 | * @see FirePHP::INFO 196 | * @param mixed $object 197 | * @param string $label 198 | * @return true 199 | * @throws Exception 200 | */ 201 | public static function info($object, $label=null) 202 | { 203 | return self::send($object, $label, FirePHP::INFO); 204 | } 205 | 206 | /** 207 | * Log object with label to firebug console 208 | * 209 | * @see FirePHP::WARN 210 | * @param mixed $object 211 | * @param string $label 212 | * @return true 213 | * @throws Exception 214 | */ 215 | public static function warn($object, $label=null) 216 | { 217 | return self::send($object, $label, FirePHP::WARN); 218 | } 219 | 220 | /** 221 | * Log object with label to firebug console 222 | * 223 | * @see FirePHP::ERROR 224 | * @param mixed $object 225 | * @param string $label 226 | * @return true 227 | * @throws Exception 228 | */ 229 | public static function error($object, $label=null) 230 | { 231 | return self::send($object, $label, FirePHP::ERROR); 232 | } 233 | 234 | /** 235 | * Dumps key and variable to firebug server panel 236 | * 237 | * @see FirePHP::DUMP 238 | * @param string $key 239 | * @param mixed $variable 240 | * @return true 241 | * @throws Exception 242 | */ 243 | public static function dump($key, $variable) 244 | { 245 | return self::send($variable, $key, FirePHP::DUMP); 246 | } 247 | 248 | /** 249 | * Log a trace in the firebug console 250 | * 251 | * @see FirePHP::TRACE 252 | * @param string $label 253 | * @return true 254 | * @throws Exception 255 | */ 256 | public static function trace($label) 257 | { 258 | return self::send($label, FirePHP::TRACE); 259 | } 260 | 261 | /** 262 | * Log a table in the firebug console 263 | * 264 | * @see FirePHP::TABLE 265 | * @param string $label 266 | * @param string $table 267 | * @return true 268 | * @throws Exception 269 | */ 270 | public static function table($label, $table) 271 | { 272 | return self::send($table, $label, FirePHP::TABLE); 273 | } 274 | 275 | } 276 | -------------------------------------------------------------------------------- /lib/krumo/INSTALL: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | 3 | SETUP: How to install Krumo ? 4 | 5 | ------------------------------------------------------------------------------ 6 | 7 | In order to use Krumo you have to put it on your (development) server, and 8 | include it in your script. You can put it somewhere in the INCLUDE_PATH, or 9 | specify the full path to the "class.krumo.php" file. 10 | 11 | You have to modify the "krumo.ini" file too. It is the configuration file for 12 | Krumo. The first option is choosing a skin: 13 | 14 | [skin] 15 | selected = "orange" 16 | 17 | The value for this setting has to be the name of one of the sub-folders from the 18 | "Krumo/skins/" folder. If the value provided for the skin results in not finding 19 | the skin, the `default` skin will be used instead. 20 | 21 | The second option is used to set the correct web path to the folder where Krumo 22 | is installed. This is used in order to make the images from Krumo's CSS skins 23 | web-accessible. 24 | 25 | [css] 26 | url = "http://www.example.com/Krumo/" 27 | 28 | So far those two are the only configuration options. 29 | 30 | All the CSS files ("skin.css") from the "Krumo/skins/" sub-folders must have the 31 | proper permissions in order to be readable from Krumo. Same applies for 32 | "krumo.ini" and "krumo.js" files. -------------------------------------------------------------------------------- /lib/krumo/README: -------------------------------------------------------------------------------- 1 | ============================================================================= 2 | 3 | Krumo 4 | version 0.2.1a 5 | 6 | ============================================================================= 7 | 8 | You probably got this package from... 9 | http://www.sourceforge.net/projects/krumo/ 10 | 11 | If there is no licence agreement with this package please download 12 | a version from the location above. You must read and accept that 13 | licence to use this software. The file is titled simply LICENSE. 14 | 15 | OVERVIEW 16 | ------------------------------------------------------------------------------ 17 | To put it simply, Krumo is a replacement for print_r() and var_dump(). By 18 | definition Krumo is a debugging tool (for PHP5), which displays structured 19 | information about any PHP variable. 20 | 21 | A lot of developers use print_r() and var_dump() in the means of debugging 22 | tools. Although they were intended to present human readble information about a 23 | variable, we can all agree that in general they are not. Krumo is an 24 | alternative: it does the same job, but it presents the information beautified 25 | using CSS and DHTML. 26 | 27 | EXAMPLES 28 | ------------------------------------------------------------------------------ 29 | Here's a basic example, which will return a report on the array variable passed 30 | as argument to it: 31 | 32 | krumo(array('a1'=> 'A1', 3, 'red')); 33 | 34 | You can dump simultaneously more then one variable - here's another example: 35 | 36 | krumo($_SERVER, $_REQUEST); 37 | 38 | You probably saw from the examples above that some of the nodes are expandable, 39 | so if you want to inspect the nested information, click on them and they will 40 | expand; if you do not need that information shown simply click again on it to 41 | collapse it. Here's an example to test this: 42 | 43 | $x1->x2->x3->x4->x5->x6->x7->x8->x9 = 'X10'; 44 | krumo($x1); 45 | 46 | The krumo() is the only standalone function from the package, and this is 47 | because basic dumps about variables (like print_r() or var_dump()) are the most 48 | common tasks such functionality is used for. The rest of the functionality can 49 | be called using static calls to the Krumo class. Here are several more examples: 50 | 51 | // print a debug backgrace 52 | krumo::backtrace(); 53 | 54 | // print all the included(or required) files 55 | krumo::includes(); 56 | 57 | // print all the included functions 58 | krumo::functions(); 59 | 60 | // print all the declared classes 61 | krumo::classes(); 62 | 63 | // print all the defined constants 64 | krumo::defines(); 65 | 66 | ... and so on, etc. 67 | 68 | A full PHPDocumenter API documentation exists both in this package and at the 69 | project's website. 70 | 71 | INSTALL 72 | ------------------------------------------------------------------------------ 73 | Read the INSTALL file. 74 | 75 | DOCUMENTATION 76 | ------------------------------------------------------------------------------ 77 | As I said, a full PHPDocumenter API documentation can be found both in this 78 | package and at the project's website. 79 | 80 | SKINS 81 | ------------------------------------------------------------------------------ 82 | There are several skins pre-installed with this package, but if you wish you can 83 | create skins of your own. The skins are simply CSS files that are prepended to 84 | the result that Krumo prints. If you want to use images in your CSS (for 85 | background, list-style, etc), you have to put "%URL%" in front of the image URL 86 | in order hook it up to the skin folder and make the image web-accessible. 87 | 88 | Here's an example: 89 | 90 | ul.krumo-first {background: url(%url%bg.gif);} 91 | 92 | TODO 93 | ------------------------------------------------------------------------------ 94 | You can find the list of stuff that is going to be added to this project in the 95 | TODO file from this very package. 96 | 97 | CONTRIBUTION 98 | ----------------------------------------------------------------------------- 99 | If you download and use and possibly even extend this tool, please let us know. 100 | Any feedback, even bad, is always welcome and your suggestions are going to be 101 | considered for our next release. Please use our SourceForge page for that: 102 | 103 | http://www.sourceforge.net/projects/krumo/ 104 | -------------------------------------------------------------------------------- /lib/krumo/TODO: -------------------------------------------------------------------------------- 1 | ****************************************************************************** 2 | 3 | Krumo: TODO 4 | 5 | ****************************************************************************** 6 | 7 | BUGS 8 | ---------------- 9 | - watch the SourceForge.net Bug Tracker 10 | 11 | Features: PHP 12 | ---------------- 13 | - Try to detect anonymous (lambda) functions 14 | - Try to detect whether an array is indexed or associated 15 | - Add var_export support for arrays and objects 16 | - Add JSON support for arrays and objects 17 | 18 | Features: GUI 19 | ---------------- 20 | - Nicer and friendlier skin(s) 21 | - Add top-level links for collapsing and expanding the whole tree 22 | - Add object & array -level links for collapsing and expanding all the 23 | nested nodes 24 | - Print all parent classes for the rendered objects -------------------------------------------------------------------------------- /lib/krumo/VERSION: -------------------------------------------------------------------------------- 1 | 0.2.1a -------------------------------------------------------------------------------- /lib/krumo/docs/Krumo/_class.krumo.php.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Docs for page class.krumo.php 7 | 8 | 9 | 85 | 86 | 87 |
88 |

File/class.krumo.php

89 | 90 | 91 |
92 |
Description
93 | 99 |
100 | 101 |

Krumo: Structured information display solution

102 |

Krumo is a debugging tool (PHP5 only), which displays structured information about any PHP variable. It is a nice replacement for print_r() or var_dump() which are used by a lot of PHP developers.

103 | 108 | 109 |
110 |
111 | 112 | 113 |
114 |
Classes
115 | 121 |
122 | 123 | 124 | 125 | 126 | 127 | 128 | 134 | 137 | 138 |
ClassDescription
129 |  class 132 | krumo 133 | 135 | Krumo API 136 |
139 |
140 |
141 | 142 | 143 | 144 |
145 |
Constants
146 | 152 |
153 | 154 |
155 | 156 |
157 | 158 | 159 | DIR_SEP = DIRECTORY_SEPARATOR 160 | (line 22) 161 | 162 |
163 | 164 | 165 |

backward compatibility: the DIR_SEP constant isn't used anymore

166 | 167 | 168 |
169 | 170 |
171 | 172 |
173 | 174 | 175 | KRUMO_DIR = dirname(__FILE__).DIRECTORY_SEPARATOR 176 | (line 39) 177 | 178 |
179 | 180 | 181 |

Set the KRUMO_DIR constant up with the absolute path to Krumo files. If it is not defined, include_path will be used. Set KRUMO_DIR only if any other module or application has not already set it up.

182 | 183 | 184 |
185 | 186 |
187 | 188 |
189 | 190 | 191 | KRUMO_TRUNCATE_LENGTH = 50 192 | (line 48) 193 | 194 |
195 | 196 | 197 |

This constant sets the maximum strings of strings that will be shown as they are. Longer strings will be truncated with this length, and their `full form` will be shown in a child node.

198 | 199 | 200 |
201 | 202 |
203 | 204 |
205 | 206 | 207 | PATH_SEPARATOR = OS_WINDOWS?';':':' 208 | (line 28) 209 | 210 |
211 | 212 | 213 |

backward compatibility: the PATH_SEPARATOR constant is availble since 4.3.0RC2

214 | 215 | 216 |
217 |
218 |
219 | 220 | 221 | 222 |
223 |
Functions
224 | 230 |
231 | 232 |
233 | 234 |
235 | 236 | krumo (line 1295) 237 |
238 | 239 | 240 |

Alias of krumo::dump()

241 | 244 |
245 | void 246 | 247 | krumo 248 | 249 | ([mixed $data,... = ]) 250 |
251 | 252 |
    253 |
  • 254 | mixed 255 | $data,...
  • 256 |
257 | 258 | 259 |
260 |
261 |
262 | 263 |

264 | Documentation generated on Sun, 02 Dec 2007 09:43:24 +0200 by phpDocumentor 1.4.0a2 265 |

266 |
267 | -------------------------------------------------------------------------------- /lib/krumo/docs/blank.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Krumo 4 | 5 | 6 | 7 | 8 |

Krumo

9 | Welcome to Krumo!
10 |
11 | This documentation was generated by phpDocumentor v1.4.0a2
12 | 13 | -------------------------------------------------------------------------------- /lib/krumo/docs/classtrees_Krumo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

13 | 14 |

15 |

Root class krumo

16 | 18 | 19 |

20 | Documentation generated on Sun, 02 Dec 2007 09:43:24 +0200 by phpDocumentor 1.4.0a2 21 |

22 | 23 | -------------------------------------------------------------------------------- /lib/krumo/docs/errors.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | phpDocumentor Parser Errors and Warnings 7 | 8 | 9 | 10 | Post-parsing
11 |

12 | Documentation generated on Sun, 02 Dec 2007 09:43:25 +0200 by phpDocumentor 1.4.0a2 13 |

14 | 15 | -------------------------------------------------------------------------------- /lib/krumo/docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | Krumo 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | <H2>Frame Alert</H2> 20 | <P>This document is designed to be viewed using the frames feature. 21 | If you see this message, you are using a non-frame-capable web client.</P> 22 | 23 | 24 | -------------------------------------------------------------------------------- /lib/krumo/docs/li_Krumo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 86 | 87 | 88 |

Krumo

89 |
90 | 149 |
150 |

151 | Generated by 152 | phpDocumentor 1.4.0a2 153 |

154 | 155 | -------------------------------------------------------------------------------- /lib/krumo/docs/media/banner.css: -------------------------------------------------------------------------------- 1 | body 2 | { 3 | background-color: #EEEEEE; 4 | margin: 0px; 5 | padding: 0px; 6 | } 7 | 8 | /* Banner (top bar) classes */ 9 | 10 | .banner { } 11 | 12 | .banner-menu 13 | { 14 | clear: both; 15 | padding: .5em; 16 | border-top: 2px solid #AAAAAA; 17 | } 18 | 19 | .banner-title 20 | { 21 | text-align: right; 22 | font-size: 20pt; 23 | font-weight: bold; 24 | margin: .2em; 25 | } 26 | 27 | .package-selector 28 | { 29 | background-color: #DDDDDD; 30 | border: 1px solid #AAAAAA; 31 | color: #000090; 32 | } 33 | -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/AbstractClass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/AbstractClass.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/AbstractClass_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/AbstractClass_logo.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/AbstractMethod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/AbstractMethod.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/AbstractPrivateClass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/AbstractPrivateClass.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/AbstractPrivateClass_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/AbstractPrivateClass_logo.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/AbstractPrivateMethod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/AbstractPrivateMethod.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/Class.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/Class.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/Class_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/Class_logo.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/Constant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/Constant.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/Constructor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/Constructor.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/Destructor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/Destructor.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/Function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/Function.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/Global.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/Global.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/I.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/I.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/Index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/Index.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/Interface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/Interface.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/Interface_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/Interface_logo.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/L.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/L.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/Lminus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/Lminus.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/Lplus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/Lplus.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/Method.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/Method.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/Page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/Page.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/Page_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/Page_logo.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/PrivateClass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/PrivateClass.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/PrivateClass_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/PrivateClass_logo.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/PrivateMethod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/PrivateMethod.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/PrivateVariable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/PrivateVariable.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/StaticMethod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/StaticMethod.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/StaticVariable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/StaticVariable.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/T.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/T.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/Tminus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/Tminus.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/Tplus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/Tplus.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/Variable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/Variable.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/blank.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/class_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/class_folder.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/empty.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/file.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/folder.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/function_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/function_folder.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/minus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/minus.gif -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/next_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/next_button.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/next_button_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/next_button_disabled.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/package.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/package.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/package_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/package_folder.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/plus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/plus.gif -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/previous_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/previous_button.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/previous_button_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/previous_button_disabled.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/private_class_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/private_class_logo.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/tutorial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/tutorial.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/tutorial_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/tutorial_folder.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/images/up_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/docs/media/images/up_button.png -------------------------------------------------------------------------------- /lib/krumo/docs/media/stylesheet.css: -------------------------------------------------------------------------------- 1 | a { color: #000090; text-decoration: none; } 2 | a:hover, a:active, a:focus { color: highlighttext; background-color: highlight; text-decoration: none; } 3 | 4 | body { background : #FFFFFF; } 5 | body, table { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt; } 6 | 7 | a img { border: 0px; } 8 | 9 | /* Page layout/boxes */ 10 | 11 | .info-box { } 12 | .info-box-title { margin: 1em 0em 0em 0em; font-weight: normal; font-size: 14pt; color: #999999; border-bottom: 2px solid #999999; } 13 | .info-box-body { border: 1px solid #999999; padding: .5em; } 14 | .nav-bar { font-size: 8pt; white-space: nowrap; text-align: right; padding: .2em; margin: 0em 0em 1em 0em; } 15 | 16 | .oddrow { background-color: #F8F8F8; border: 1px solid #AAAAAA; padding: .5em; margin-bottom: 1em} 17 | .evenrow { border: 1px solid #AAAAAA; padding: .5em; margin-bottom: 1em} 18 | 19 | .page-body { max-width: 800px; margin: auto; } 20 | .tree { } 21 | 22 | /* Index formatting classes */ 23 | 24 | .index-item-body { margin-top: .5em; margin-bottom: .5em} 25 | .index-item-description { margin-top: .25em } 26 | .index-item-details { font-weight: normal; font-style: italic; font-size: 8pt } 27 | .index-letter-section { background-color: #EEEEEE; border: 1px dotted #999999; padding: .5em; margin-bottom: 1em} 28 | .index-letter-title { font-size: 12pt; font-weight: bold } 29 | .index-letter-menu { text-align: center; margin: 1em } 30 | .index-letter { font-size: 12pt } 31 | 32 | /* Docbook classes */ 33 | 34 | .description {} 35 | .short-description { font-weight: bold; color: #666666; } 36 | .tags { padding-left: 0em; margin-left: 3em; color: #666666; list-style-type: square; } 37 | .parameters { padding-left: 0em; margin-left: 3em; color: #014fbe; list-style-type: square; } 38 | .redefinitions { font-size: 8pt; padding-left: 0em; margin-left: 2em; } 39 | .package { font-weight: bold; } 40 | .package-title { font-weight: bold; font-size: 14pt; border-bottom: 1px solid black } 41 | .sub-package { font-weight: bold; } 42 | .tutorial { border-width: thin; border-color: #0066ff; } 43 | .tutorial-nav-box { width: 100%; border: 1px solid #999999; background-color: #F8F8F8; } 44 | 45 | /* Generic formatting */ 46 | 47 | .field { font-weight: bold; } 48 | .detail { font-size: 8pt; } 49 | .notes { font-style: italic; font-size: 8pt; } 50 | .separator { background-color: #999999; height: 2px; } 51 | .warning { color: #FF6600; } 52 | .disabled { font-style: italic; color: #999999; } 53 | 54 | /* Code elements */ 55 | 56 | .line-number { } 57 | 58 | .class-table { width: 100%; } 59 | .class-table-header { border-bottom: 1px dotted #666666; text-align: left} 60 | .class-name { color: #0000AA; font-weight: bold; } 61 | 62 | .method-summary { color: #009000; padding-left: 1em; font-size: 8pt; } 63 | .method-header { } 64 | .method-definition { margin-bottom: .2em } 65 | .method-title { color: #009000; font-weight: bold; } 66 | .method-name { font-weight: bold; } 67 | .method-signature { font-size: 85%; color: #666666; margin: .5em 0em } 68 | .method-result { font-style: italic; } 69 | 70 | .var-summary { padding-left: 1em; font-size: 8pt; } 71 | .var-header { } 72 | .var-title { color: #014fbe; margin-bottom: .3em } 73 | .var-type { font-style: italic; } 74 | .var-name { font-weight: bold; } 75 | .var-default {} 76 | .var-description { font-weight: normal; color: #000000; } 77 | 78 | .include-title { color: #014fbe;} 79 | .include-type { font-style: italic; } 80 | .include-name { font-weight: bold; } 81 | 82 | .const-title { color: #FF6600; } 83 | .const-name { font-weight: bold; } 84 | 85 | /* Syntax highlighting */ 86 | 87 | .src-code { font-family: 'Courier New', Courier, monospace; font-weight: normal; } 88 | .src-line { font-family: 'Courier New', Courier, monospace; font-weight: normal; } 89 | 90 | .src-code a:link { padding: 1px; text-decoration: underline; color: #0000DD; } 91 | .src-code a:visited { text-decoration: underline; color: #0000DD; } 92 | .src-code a:active { background-color: #FFFF66; color: #008000; } 93 | .src-code a:hover { background-color: #FFFF66; text-decoration: overline underline; color: #008000; } 94 | 95 | .src-comm { color: #666666; } 96 | .src-id { color: #FF6600; font-style: italic; } 97 | .src-inc { color: #0000AA; font-weight: bold; } 98 | .src-key { color: #0000AA; font-weight: bold; } 99 | .src-num { color: #CC0000; } 100 | .src-str { color: #CC0000; } 101 | .src-sym { } 102 | .src-var { } 103 | 104 | .src-php { font-weight: bold; } 105 | 106 | .src-doc { color: #666666; } 107 | .src-doc-close-template { color: #666666 } 108 | .src-doc-coretag { color: #008000; } 109 | .src-doc-inlinetag {} 110 | .src-doc-internal {} 111 | .src-doc-tag { color: #0080CC; } 112 | .src-doc-template { color: #666666 } 113 | .src-doc-type { font-style: italic; color: #444444 } 114 | .src-doc-var { color: #444444 } 115 | 116 | .tute-tag { color: #009999 } 117 | .tute-attribute-name { color: #0000FF } 118 | .tute-attribute-value { color: #0099FF } 119 | .tute-entity { font-weight: bold; } 120 | .tute-comment { font-style: italic } 121 | .tute-inline-tag { color: #636311; font-weight: bold } 122 | 123 | /* tutorial */ 124 | 125 | .authors { } 126 | .author { font-style: italic; font-weight: bold } 127 | .author-blurb { margin: .5em 0em .5em 2em; font-size: 85%; font-weight: normal; font-style: normal } 128 | .example { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; } 129 | .listing { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; white-space: nowrap; } 130 | .release-info { font-size: 85%; font-style: italic; margin: 1em 0em } 131 | .ref-title-box { } 132 | .ref-title { } 133 | .ref-purpose { font-style: italic; color: #666666 } 134 | .ref-synopsis { } 135 | .title { font-weight: bold; border-bottom: 1px solid #999999; color: #999999; } 136 | .cmd-synopsis { margin: 1em 0em } 137 | .cmd-title { font-weight: bold } 138 | .toc { margin-left: 2em; padding-left: 0em } 139 | 140 | /*------------------------------------------------------------------------------ 141 | webfx-tree 142 | ------------------------------------------------------------------------------*/ 143 | 144 | .webfx-tree-container { 145 | margin: 0px; 146 | padding: 0px; 147 | white-space: nowrap; 148 | font: icon; 149 | } 150 | 151 | .webfx-tree-item { 152 | padding: 0px; 153 | margin: 0px; 154 | color: black; 155 | white-space: nowrap; 156 | font: icon; 157 | } 158 | 159 | .webfx-tree-item a { 160 | margin-left: 3px; 161 | padding: 1px 2px 1px 2px; 162 | color: black; 163 | text-decoration: none; 164 | } 165 | 166 | .webfx-tree-item a:hover, .webfx-tree-item a:active { 167 | color: highlighttext; 168 | background: highlight; 169 | text-decoration: none 170 | } 171 | 172 | .webfx-tree-item img { 173 | vertical-align: middle; 174 | border: 0px; 175 | } 176 | 177 | .webfx-tree-icon { 178 | width: 16px; 179 | height: 16px; 180 | } 181 | 182 | -------------------------------------------------------------------------------- /lib/krumo/docs/packages.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 39 | 40 | -------------------------------------------------------------------------------- /lib/krumo/docs/ric_INSTALL.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |

INSTALL

11 |
12 | ------------------------------------------------------------------------------
13 | 
14 |                      SETUP: How to install Krumo ?
15 | 
16 | ------------------------------------------------------------------------------
17 | 
18 | In order to use Krumo you have to put it on your (development) server, and 
19 | include it in your script. You can put it somewhere in the INCLUDE_PATH, or 
20 | specify the full path to the "class.krumo.php" file.
21 | 
22 | You have to modify the "krumo.ini" file too. It is the configuration file for 
23 | Krumo. The first option is choosing a skin:
24 | 
25 |  [skin]
26 |  selected = "orange"
27 | 
28 | The value for this setting has to be the name of one of the sub-folders from the 
29 | "Krumo/skins/" folder. If the value provided for the skin results in not finding 
30 | the skin, the `default` skin will be used instead.
31 | 
32 | The second option is used to set the correct web path to the folder where Krumo 
33 | is installed. This is used in order to make the images from Krumo's CSS skins 
34 | web-accessible.
35 | 
36 |  [css]
37 |  url = "http://www.example.com/Krumo/"
38 | 
39 | So far those two are the only configuration options.
40 | 
41 | All the CSS files ("skin.css") from the "Krumo/skins/" sub-folders must have the 
42 | proper permissions in order to be readable from Krumo. Same applies for 
43 | "krumo.ini" and "krumo.js" files.
44 | 
45 |

46 | Documentation generated on Sun, 02 Dec 2007 09:43:22 +0200 by phpDocumentor 1.4.0a2 47 |

48 | 49 | -------------------------------------------------------------------------------- /lib/krumo/docs/ric_README.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |

README

11 |
 12 | =============================================================================
 13 | 
 14 |                                Krumo
 15 |                             version 0.2.1a
 16 | 
 17 | =============================================================================
 18 | 
 19 | You probably got this package from...
 20 | http://www.sourceforge.net/projects/krumo/
 21 | 
 22 | If there is no licence agreement with this package please download
 23 | a version from the location above. You must read and accept that
 24 | licence to use this software. The file is titled simply LICENSE.
 25 | 
 26 | OVERVIEW
 27 | ------------------------------------------------------------------------------
 28 | To put it simply, Krumo is a replacement for print_r() and var_dump(). By 
 29 | definition Krumo is a debugging tool (for PHP5), which displays structured 
 30 | information about any PHP variable.
 31 | 
 32 | A lot of developers use print_r() and var_dump() in the means of debugging 
 33 | tools. Although they were intended to present human readble information about a 
 34 | variable, we can all agree that in general they are not. Krumo is an 
 35 | alternative: it does the same job, but it presents the information beautified 
 36 | using CSS and DHTML. 
 37 | 
 38 | EXAMPLES
 39 | ------------------------------------------------------------------------------
 40 | Here's a basic example, which will return a report on the array variable passed 
 41 | as argument to it:
 42 | 
 43 |  krumo(array('a1'=> 'A1', 3, 'red'));
 44 | 
 45 | You can dump simultaneously more then one variable - here's another example:
 46 | 
 47 |  krumo($_SERVER, $_REQUEST);
 48 | 
 49 | You probably saw from the examples above that some of the nodes are expandable, 
 50 | so if you want to inspect the nested information, click on them and they will 
 51 | expand; if you do not need that information shown simply click again on it to 
 52 | collapse it. Here's an example to test this:
 53 | 
 54 |  $x1->x2->x3->x4->x5->x6->x7->x8->x9 = 'X10';
 55 |  krumo($x1);
 56 | 
 57 | The krumo() is the only standalone function from the package, and this is 
 58 | because basic dumps about variables (like print_r() or var_dump()) are the most 
 59 | common tasks such functionality is used for. The rest of the functionality can 
 60 | be called using static calls to the Krumo class. Here are several more examples:
 61 | 
 62 |  // print a debug backgrace
 63 |  krumo::backtrace();
 64 | 
 65 |  // print all the included(or required) files
 66 |  krumo::includes();
 67 |  
 68 |  // print all the included functions
 69 |  krumo::functions();
 70 |  
 71 |  // print all the declared classes
 72 |  krumo::classes();
 73 |  
 74 |  // print all the defined constants
 75 |  krumo::defines();
 76 | 
 77 |  ... and so on, etc.
 78 | 
 79 | A full PHPDocumenter API documentation exists both in this package and at the 
 80 | project's website.
 81 | 
 82 | INSTALL
 83 | ------------------------------------------------------------------------------
 84 | Read the INSTALL file.
 85 | 
 86 | DOCUMENTATION
 87 | ------------------------------------------------------------------------------
 88 | As I said, a full PHPDocumenter API documentation can be found both in this
 89 | package and at the project's website.
 90 | 
 91 | SKINS
 92 | ------------------------------------------------------------------------------
 93 | There are several skins pre-installed with this package, but if you wish you can 
 94 | create skins of your own. The skins are simply CSS files that are prepended to 
 95 | the result that Krumo prints. If you want to use images in your CSS (for 
 96 | background, list-style, etc), you have to put "%URL%" in front of the image URL 
 97 | in order hook it up to the skin folder and make the image web-accessible.
 98 | 
 99 | Here's an example:
100 | 
101 |  ul.krumo-first {background: url(%url%bg.gif);}
102 | 
103 | TODO
104 | ------------------------------------------------------------------------------
105 | You can find the list of stuff that is going to be added to this project in the 
106 | TODO file from this very package.
107 | 
108 | CONTRIBUTION
109 | -----------------------------------------------------------------------------
110 | If you download and use and possibly even extend this tool, please let us know. 
111 | Any feedback, even bad, is always welcome and your suggestions are going to be 
112 | considered for our next release. Please use our SourceForge page for that:
113 |  
114 |  http://www.sourceforge.net/projects/krumo/
115 | 
116 | 
117 |

118 | Documentation generated on Sun, 02 Dec 2007 09:43:23 +0200 by phpDocumentor 1.4.0a2 119 |

120 | 121 | -------------------------------------------------------------------------------- /lib/krumo/docs/ric_TODO.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |

TODO

11 |
12 | ******************************************************************************
13 | 
14 |                                  Krumo: TODO
15 | 
16 | ******************************************************************************
17 | 
18 | BUGS
19 | ----------------
20 |  - watch the SourceForge.net Bug Tracker
21 | 
22 | Features: PHP
23 | ----------------
24 |  - Try to detect anonymous (lambda) functions
25 |  - Try to detect whether an array is indexed or associated
26 |  - Add var_export support for arrays and objects
27 |  - Add JSON support for arrays and objects
28 |  
29 | Features: GUI
30 | ----------------
31 |  - Nicer and friendlier skin(s)
32 |  - Add top-level links for collapsing and expanding the whole tree
33 |  - Add object & array -level links for collapsing and expanding all the
34 |  	nested nodes
35 |  - Print all parent classes for the rendered objects
36 | 
37 |

38 | Documentation generated on Sun, 02 Dec 2007 09:43:23 +0200 by phpDocumentor 1.4.0a2 39 |

40 | 41 | -------------------------------------------------------------------------------- /lib/krumo/docs/ric_VERSION.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |

VERSION

11 |
12 | 0.2.1a
13 | 
14 |

15 | Documentation generated on Sun, 02 Dec 2007 09:43:23 +0200 by phpDocumentor 1.4.0a2 16 |

17 | 18 | -------------------------------------------------------------------------------- /lib/krumo/krumo.ini: -------------------------------------------------------------------------------- 1 | ; 2 | ; KRUMO CONFIGURATION FILE 3 | ; 4 | 5 | [skin] 6 | selected = "white" 7 | ; 8 | ; Change the above value to set the CSS skin used to render 9 | ; Krumo layout. If the skin is not found, then the "default" one 10 | ; is going to be used. 11 | ; 12 | 13 | [css] 14 | url = "http://www.example.com/Krumo/" 15 | ; 16 | ; This value is used to set the URL path to 17 | ; where the Krumo folder is. This is required in 18 | ; order to have web access to Krumo's CSS and 19 | ; image files. 20 | ; 21 | -------------------------------------------------------------------------------- /lib/krumo/krumo.js: -------------------------------------------------------------------------------- 1 | /** 2 | * JavaScript routines for Krumo 3 | * 4 | * @link http://sourceforge.net/projects/krumo 5 | */ 6 | 7 | ///////////////////////////////////////////////////////////////////////////// 8 | 9 | /** 10 | * Krumo JS Class 11 | */ 12 | function krumo() { 13 | } 14 | 15 | // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 16 | 17 | /** 18 | * Add a CSS class to an HTML element 19 | * 20 | * @param HtmlElement el 21 | * @param string className 22 | * @return void 23 | */ 24 | krumo.reclass = function(el, className) { 25 | if (el.className.indexOf(className) < 0) { 26 | el.className += (' ' + className); 27 | } 28 | } 29 | 30 | // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 31 | 32 | /** 33 | * Remove a CSS class to an HTML element 34 | * 35 | * @param HtmlElement el 36 | * @param string className 37 | * @return void 38 | */ 39 | krumo.unclass = function(el, className) { 40 | if (el.className.indexOf(className) > -1) { 41 | el.className = el.className.replace(className, ''); 42 | } 43 | } 44 | 45 | // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 46 | 47 | /** 48 | * Toggle the nodes connected to an HTML element 49 | * 50 | * @param HtmlElement el 51 | * @return void 52 | */ 53 | krumo.toggle = function(el) { 54 | var ul = el.parentNode.getElementsByTagName('ul'); 55 | for (var i=0; i 5 | */ 6 | 7 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 8 | 9 | ul.krumo-node { 10 | margin: 0px; 11 | padding: 0px; 12 | } 13 | ul.krumo-node ul { 14 | margin-left: 20px; 15 | } 16 | * html ul.krumo-node ul { 17 | margin-left: 24px; 18 | } 19 | div.krumo-root { 20 | border: solid 1px black; 21 | margin: 1em 0em; 22 | } 23 | ul.krumo-first { 24 | font: normal 12px arial; 25 | border: solid 2px white; 26 | border-top-width:1px; 27 | background: url(%url%bg.gif); 28 | } 29 | 30 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 31 | 32 | li.krumo-child { 33 | display:block; 34 | list-style: none; 35 | padding: 0px; 36 | margin: 0px; 37 | overflow:hidden; 38 | } 39 | div.krumo-element { 40 | cursor:default; 41 | 42 | line-height: 24px; 43 | display:block; 44 | 45 | clear:both; 46 | white-space:nowrap; 47 | 48 | border-top: solid 1px white; 49 | background: #BFDFFF; 50 | padding-left: 10px; 51 | } 52 | * html div.krumo-element { 53 | padding-bottom: 3px; 54 | } 55 | a.krumo-name { 56 | color:navy; 57 | font: bold 13px Arial; 58 | } 59 | a.krumo-name big { 60 | font: bold 20pt Georgia; 61 | line-height: 14px; 62 | position:relative; 63 | top:2px; 64 | left:-2px; 65 | } 66 | * html a.krumo-name big { 67 | font: bold 19pt Georgia; 68 | top: 5px; 69 | left: 0px; 70 | line-height: 9px; 71 | height: 12px; 72 | padding: 0px; 73 | margin: 0px; 74 | } 75 | div.krumo-expand { 76 | background: #AAD5FF; 77 | cursor:pointer; 78 | } 79 | div.krumo-hover { 80 | background: #FFBE7D; 81 | } 82 | 83 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 84 | 85 | div.krumo-preview { 86 | font: normal 13px courier new; 87 | padding: 5px 5px 14px 5px; 88 | background: white; 89 | border-top: 0px; 90 | overflow:auto; 91 | white-space: pre; 92 | } 93 | * html div.krumo-preview { 94 | padding-top: 2px; 95 | } 96 | 97 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 98 | 99 | li.krumo-footnote { 100 | background:white; 101 | padding: 2px 5px; 102 | list-style:none; 103 | border-top: solid 1px #bebebe; 104 | margin-top:2px; 105 | cursor:default; 106 | } 107 | * html li.krumo-footnote { 108 | line-height: 13px; 109 | } 110 | div.krumo-version { 111 | float:right; 112 | } 113 | li.krumo-footnote h6 { 114 | font: bold 11px verdana; 115 | margin: 0px; 116 | padding: 0px; 117 | color:navy; 118 | display:inline; 119 | } 120 | * html li.krumo-footnote h6 { 121 | margin-right: 3px; 122 | } 123 | li.krumo-footnote a { 124 | font: bold 10px arial; 125 | color: #434343; 126 | text-decoration:none; 127 | } 128 | li.krumo-footnote a:hover { 129 | color:black; 130 | } 131 | 132 | li.krumo-footnote span.krumo-call { 133 | font:normal 11px verdana; 134 | position: relative; 135 | top: 1px; 136 | } 137 | li.krumo-footnote span.krumo-call code { 138 | font-weight:bold; 139 | } 140 | 141 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 142 | 143 | div.krumo-title { 144 | font: normal 11px verdana ; 145 | position:relative; 146 | top:9px; 147 | cursor:default; 148 | line-height:2px; 149 | } 150 | 151 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 152 | 153 | strong.krumo-array-length, 154 | strong.krumo-string-length { 155 | font-weight: normal; 156 | } 157 | 158 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 159 | -------------------------------------------------------------------------------- /lib/krumo/skins/default/bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/skins/default/bg.gif -------------------------------------------------------------------------------- /lib/krumo/skins/default/skin.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Krumo Default Skin 3 | * 4 | * @author Kaloyan K. Tsvetkov 5 | */ 6 | 7 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 8 | 9 | ul.krumo-node { 10 | margin: 0px; 11 | padding: 0px; 12 | } 13 | ul.krumo-node ul { 14 | margin-left: 20px; 15 | } 16 | * html ul.krumo-node ul { 17 | margin-left: 24px; 18 | } 19 | div.krumo-root { 20 | border: solid 1px black; 21 | margin: 1em 0em; 22 | } 23 | ul.krumo-first { 24 | font: normal 12px arial; 25 | border: solid 2px white; 26 | border-top-width:1px; 27 | background: url(%url%bg.gif); 28 | } 29 | 30 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 31 | 32 | li.krumo-child { 33 | display:block; 34 | list-style: none; 35 | padding: 0px; 36 | margin: 0px; 37 | overflow:hidden; 38 | } 39 | div.krumo-element { 40 | cursor:default; 41 | 42 | line-height: 24px; 43 | display:block; 44 | 45 | clear:both; 46 | white-space:nowrap; 47 | 48 | border-top: solid 1px white; 49 | background: #E8E8E8; 50 | padding-left: 10px; 51 | } 52 | * html div.krumo-element { 53 | padding-bottom: 3px; 54 | } 55 | a.krumo-name { 56 | color:#2C5858; 57 | font: bold 13px Arial; 58 | } 59 | a.krumo-name big { 60 | font: bold 20pt Georgia; 61 | line-height: 14px; 62 | position:relative; 63 | top:2px; 64 | left:-2px; 65 | } 66 | * html a.krumo-name big { 67 | font: bold 19pt Georgia; 68 | top: 5px; 69 | left: 0px; 70 | line-height: 9px; 71 | height: 12px; 72 | padding: 0px; 73 | margin: 0px; 74 | } 75 | div.krumo-expand { 76 | background: #CCCCCC; 77 | cursor:pointer; 78 | } 79 | div.krumo-hover { 80 | background: #B7DBDB; 81 | } 82 | 83 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 84 | 85 | div.krumo-preview { 86 | font: normal 13px courier new; 87 | padding: 5px 5px 14px 5px; 88 | background: white; 89 | border-top: 0px; 90 | overflow:auto; 91 | white-space: pre; 92 | } 93 | * html div.krumo-preview { 94 | padding-top: 2px; 95 | } 96 | 97 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 98 | 99 | li.krumo-footnote { 100 | background:white; 101 | padding: 2px 5px; 102 | list-style:none; 103 | border-top: solid 1px #bebebe; 104 | margin-top:2px; 105 | cursor:default; 106 | } 107 | * html li.krumo-footnote { 108 | line-height: 13px; 109 | } 110 | div.krumo-version { 111 | float:right; 112 | } 113 | li.krumo-footnote h6 { 114 | font: bold 11px verdana; 115 | margin: 0px; 116 | padding: 0px; 117 | color:#366D6D; 118 | display:inline; 119 | } 120 | * html li.krumo-footnote h6 { 121 | margin-right: 3px; 122 | } 123 | li.krumo-footnote a { 124 | font: bold 10px arial; 125 | color: #434343; 126 | text-decoration:none; 127 | } 128 | li.krumo-footnote a:hover { 129 | color:black; 130 | } 131 | 132 | li.krumo-footnote span.krumo-call { 133 | font:normal 11px verdana; 134 | position: relative; 135 | top: 1px; 136 | } 137 | li.krumo-footnote span.krumo-call code { 138 | font-weight:bold; 139 | } 140 | 141 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 142 | 143 | div.krumo-title { 144 | font: normal 11px verdana ; 145 | position:relative; 146 | top:9px; 147 | cursor:default; 148 | line-height:2px; 149 | } 150 | 151 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 152 | 153 | strong.krumo-array-length, 154 | strong.krumo-string-length { 155 | font-weight: normal; 156 | } 157 | 158 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 159 | -------------------------------------------------------------------------------- /lib/krumo/skins/green/bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/skins/green/bg.gif -------------------------------------------------------------------------------- /lib/krumo/skins/green/skin.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Krumo "Green" Skin 3 | * 4 | * @author Kaloyan K. Tsvetkov 5 | */ 6 | 7 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 8 | 9 | ul.krumo-node { 10 | margin: 0px; 11 | padding: 0px; 12 | } 13 | ul.krumo-node ul { 14 | margin-left: 20px; 15 | } 16 | * html ul.krumo-node ul { 17 | margin-left: 24px; 18 | } 19 | div.krumo-root { 20 | border: solid 1px black; 21 | margin: 1em 0em; 22 | } 23 | ul.krumo-first { 24 | font: normal 12px arial; 25 | border: solid 2px white; 26 | border-top-width:1px; 27 | background: url(%url%bg.gif); 28 | } 29 | 30 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 31 | 32 | li.krumo-child { 33 | display:block; 34 | list-style: none; 35 | padding: 0px; 36 | margin: 0px; 37 | overflow:hidden; 38 | } 39 | div.krumo-element { 40 | cursor:default; 41 | 42 | line-height: 24px; 43 | display:block; 44 | 45 | clear:both; 46 | white-space:nowrap; 47 | 48 | border-top: solid 1px white; 49 | background: #D7F4CA; 50 | padding-left: 10px; 51 | } 52 | * html div.krumo-element { 53 | padding-bottom: 3px; 54 | } 55 | a.krumo-name { 56 | color:#004000; 57 | font: bold 13px Arial; 58 | } 59 | a.krumo-name big { 60 | font: bold 20pt Georgia; 61 | line-height: 14px; 62 | position:relative; 63 | top:2px; 64 | left:-2px; 65 | } 66 | * html a.krumo-name big { 67 | font: bold 19pt Georgia; 68 | top: 5px; 69 | left: 0px; 70 | line-height: 9px; 71 | height: 12px; 72 | padding: 0px; 73 | margin: 0px; 74 | } 75 | div.krumo-expand { 76 | background: #C0EEAC; 77 | cursor:pointer; 78 | } 79 | div.krumo-hover { 80 | background: gold; 81 | } 82 | 83 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 84 | 85 | div.krumo-preview { 86 | font: normal 13px courier new; 87 | padding: 5px 5px 14px 5px; 88 | background: white; 89 | border-top: 0px; 90 | overflow:auto; 91 | white-space: pre; 92 | } 93 | * html div.krumo-preview { 94 | padding-top: 2px; 95 | } 96 | 97 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 98 | 99 | li.krumo-footnote { 100 | background:white; 101 | padding: 2px 5px; 102 | list-style:none; 103 | border-top: solid 1px #bebebe; 104 | margin-top:2px; 105 | cursor:default; 106 | } 107 | * html li.krumo-footnote { 108 | line-height: 13px; 109 | } 110 | div.krumo-version { 111 | float:right; 112 | } 113 | li.krumo-footnote h6 { 114 | font: bold 11px verdana; 115 | margin: 0px; 116 | padding: 0px; 117 | color:#008040; 118 | display:inline; 119 | } 120 | * html li.krumo-footnote h6 { 121 | margin-right: 3px; 122 | } 123 | li.krumo-footnote a { 124 | font: bold 10px arial; 125 | color: #434343; 126 | text-decoration:none; 127 | } 128 | li.krumo-footnote a:hover { 129 | color:black; 130 | } 131 | 132 | li.krumo-footnote span.krumo-call { 133 | font:normal 11px verdana; 134 | position: relative; 135 | top: 1px; 136 | } 137 | li.krumo-footnote span.krumo-call code { 138 | font-weight:bold; 139 | } 140 | 141 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 142 | 143 | div.krumo-title { 144 | font: normal 11px verdana ; 145 | position:relative; 146 | top:9px; 147 | cursor:default; 148 | line-height:2px; 149 | } 150 | 151 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 152 | 153 | strong.krumo-array-length, 154 | strong.krumo-string-length { 155 | font-weight: normal; 156 | } 157 | 158 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 159 | -------------------------------------------------------------------------------- /lib/krumo/skins/orange/bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/skins/orange/bg.gif -------------------------------------------------------------------------------- /lib/krumo/skins/orange/skin.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Krumo "Orange" Skin 3 | * 4 | * @author Kaloyan K. Tsvetkov 5 | */ 6 | 7 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 8 | 9 | ul.krumo-node { 10 | margin: 0px; 11 | padding: 0px; 12 | } 13 | ul.krumo-node ul { 14 | margin-left: 20px; 15 | } 16 | * html ul.krumo-node ul { 17 | margin-left: 24px; 18 | } 19 | div.krumo-root { 20 | border: solid 1px black; 21 | margin: 1em 0em; 22 | } 23 | ul.krumo-first { 24 | font: normal 12px arial; 25 | border: solid 2px white; 26 | border-top-width:1px; 27 | background: url(%url%bg.gif); 28 | } 29 | 30 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 31 | 32 | li.krumo-child { 33 | display:block; 34 | list-style: none; 35 | padding: 0px; 36 | margin: 0px; 37 | overflow:hidden; 38 | } 39 | div.krumo-element { 40 | cursor:default; 41 | 42 | line-height: 24px; 43 | display:block; 44 | 45 | clear:both; 46 | white-space:nowrap; 47 | 48 | border-top: solid 1px white; 49 | background: #FCEBA9; 50 | padding-left: 10px; 51 | } 52 | * html div.krumo-element { 53 | padding-bottom: 3px; 54 | } 55 | a.krumo-name { 56 | color:#404000; 57 | font: bold 13px Arial; 58 | } 59 | a.krumo-name big { 60 | font: bold 20pt Georgia; 61 | line-height: 14px; 62 | position:relative; 63 | top:2px; 64 | left:-2px; 65 | } 66 | * html a.krumo-name big { 67 | font: bold 19pt Georgia; 68 | top: 5px; 69 | left: 0px; 70 | line-height: 9px; 71 | height: 12px; 72 | padding: 0px; 73 | margin: 0px; 74 | } 75 | div.krumo-expand { 76 | background: #FADB61; 77 | cursor:pointer; 78 | } 79 | div.krumo-hover { 80 | background: #FF8A4B; 81 | } 82 | 83 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 84 | 85 | div.krumo-preview { 86 | font: normal 13px courier new; 87 | padding: 5px 5px 14px 5px; 88 | background: white; 89 | border-top: 0px; 90 | overflow:auto; 91 | white-space: pre; 92 | } 93 | * html div.krumo-preview { 94 | padding-top: 2px; 95 | } 96 | 97 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 98 | 99 | li.krumo-footnote { 100 | background:white; 101 | padding: 2px 5px; 102 | list-style:none; 103 | border-top: solid 1px #bebebe; 104 | margin-top:2px; 105 | cursor:default; 106 | } 107 | * html li.krumo-footnote { 108 | line-height: 13px; 109 | } 110 | div.krumo-version { 111 | float:right; 112 | } 113 | li.krumo-footnote h6 { 114 | font: bold 11px verdana; 115 | margin: 0px; 116 | padding: 0px; 117 | color:#E87400; 118 | display:inline; 119 | } 120 | * html li.krumo-footnote h6 { 121 | margin-right: 3px; 122 | } 123 | li.krumo-footnote a { 124 | font: bold 10px arial; 125 | color: #434343; 126 | text-decoration:none; 127 | } 128 | li.krumo-footnote a:hover { 129 | color:black; 130 | } 131 | 132 | li.krumo-footnote span.krumo-call { 133 | font:normal 11px verdana; 134 | position: relative; 135 | top: 1px; 136 | } 137 | li.krumo-footnote span.krumo-call code { 138 | font-weight:bold; 139 | } 140 | 141 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 142 | 143 | div.krumo-title { 144 | font: normal 11px verdana ; 145 | position:relative; 146 | top:9px; 147 | cursor:default; 148 | line-height:2px; 149 | } 150 | 151 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 152 | 153 | strong.krumo-array-length, 154 | strong.krumo-string-length { 155 | font-weight: normal; 156 | } 157 | 158 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 159 | -------------------------------------------------------------------------------- /lib/krumo/skins/white/collapsed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/skins/white/collapsed.gif -------------------------------------------------------------------------------- /lib/krumo/skins/white/dotted.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/skins/white/dotted.gif -------------------------------------------------------------------------------- /lib/krumo/skins/white/empty.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/skins/white/empty.gif -------------------------------------------------------------------------------- /lib/krumo/skins/white/expanded.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backdrop-contrib/devel/8dadd0c195f2eee7a4c308f4050e68e83cf9d057/lib/krumo/skins/white/expanded.gif -------------------------------------------------------------------------------- /lib/krumo/skins/white/skin.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Krumo `Schablon.com` Skin 3 | * 4 | * @author Kaloyan K. Tsvetkov 5 | */ 6 | 7 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 8 | 9 | ul.krumo-node { 10 | margin: 0px; 11 | padding: 0px; 12 | background-color: white; 13 | } 14 | ul.krumo-node ul { 15 | margin-left: 20px; 16 | } 17 | * html ul.krumo-node ul { 18 | margin-left: 24px; 19 | } 20 | div.krumo-root { 21 | border: solid 1px black; 22 | margin: 1em 0em; 23 | } 24 | ul.krumo-first { 25 | font: normal 11px tahoma, verdana; 26 | border: solid 1px white; 27 | } 28 | 29 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 30 | 31 | li.krumo-child { 32 | display:block; 33 | list-style: none; 34 | padding: 0px; 35 | margin: 0px; 36 | overflow:hidden; 37 | } 38 | div.krumo-element { 39 | cursor:default; 40 | display:block; 41 | clear:both; 42 | white-space:nowrap; 43 | 44 | background-color: white; 45 | background-image: url(%url%empty.gif); 46 | background-repeat: no-repeat; 47 | background-position: 6px 5px; 48 | padding: 2px 0px 3px 20px; 49 | } 50 | * html div.krumo-element { 51 | padding-bottom: 3px; 52 | line-height: 13px; 53 | } 54 | div.krumo-expand { 55 | background-image: url(%url%collapsed.gif); 56 | cursor:pointer; 57 | } 58 | div.krumo-hover { 59 | background-color: #BFDFFF; 60 | } 61 | div.krumo-opened { 62 | background-image: url(%url%expanded.gif); 63 | } 64 | a.krumo-name { 65 | color:navy; 66 | font: bold 13px courier new; 67 | line-height:12px; 68 | } 69 | a.krumo-name big { 70 | font: bold 16pt Georgia; 71 | line-height: 10px; 72 | position:relative; 73 | top:2px; 74 | left:-2px; 75 | } 76 | * html a.krumo-name big { 77 | font: bold 15pt Georgia; 78 | float:left; 79 | top: -5px; 80 | left: 0px; 81 | padding: 0px; 82 | margin: 0px; 83 | } 84 | em.krumo-type { 85 | font-style:normal; 86 | margin: 0px 2px; 87 | } 88 | 89 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 90 | 91 | div.krumo-preview { 92 | font: normal 13px courier new; 93 | padding: 5px ; 94 | background: lightyellow; 95 | border: solid 1px #808000; 96 | overflow:auto; 97 | margin: 5px 1em 1em 0px; 98 | white-space: pre; 99 | } 100 | * html div.krumo-preview { 101 | padding-top: 2px; 102 | } 103 | 104 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 105 | 106 | li.krumo-footnote { 107 | background: white url(%url%dotted.gif) repeat-x; 108 | padding: 4px 5px 3px 5px; 109 | list-style:none; 110 | cursor:default; 111 | } 112 | * html li.krumo-footnote { 113 | line-height: 13px; 114 | } 115 | div.krumo-version { 116 | float:right; 117 | } 118 | li.krumo-footnote h6 { 119 | font: bold 11px verdana; 120 | margin: 0px; 121 | padding: 0px; 122 | color:navy; 123 | display:inline; 124 | } 125 | * html li.krumo-footnote h6 { 126 | margin-right: 3px; 127 | } 128 | li.krumo-footnote a { 129 | font: bold 10px arial; 130 | color: #434343; 131 | text-decoration:none; 132 | } 133 | li.krumo-footnote a:hover { 134 | color:black; 135 | } 136 | 137 | 138 | li.krumo-footnote span.krumo-call { 139 | font:normal 11px tahoma, verdana; 140 | position: relative; 141 | top: 1px; 142 | } 143 | li.krumo-footnote span.krumo-call code { 144 | font-weight:bold; 145 | } 146 | 147 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 148 | 149 | div.krumo-title { 150 | font: normal 11px tahoma, verdana; 151 | position:relative; 152 | top:9px; 153 | cursor:default; 154 | line-height:2px; 155 | } 156 | 157 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 158 | 159 | strong.krumo-array-length, 160 | strong.krumo-string-length { 161 | font-weight: normal; 162 | color: #000099; 163 | } 164 | 165 | /* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- */ 166 | --------------------------------------------------------------------------------