Inspect

Component ID

1296504

Component name

Inspect

Component type

module

Maintenance status

Development status

Component security advisory coverage

covered

Downloads

11202

Component created

Component changed

Component body

Get instructive and well formatted variable dumps, deep stack traces, and execution time profiles - to watchdog, file or screen.

Inspect variables and stack traces, and get better error handling

  • analyzes all kinds of variables, safely
  • provides deep back traces and error traces
  • logging vars and traces upon errors makes for better code and easier bug fixing

Doesn't show, doesn't fail - applicable in production

  • manage who gets to see and log inspections via the module's user role permissions
  • Inspect always hides the value of object/array buckets keyed 'pass' and 'password'
  • always attempts to hide paths when displaying dumps/traces
  • doesn't fail on dumping $GLOBALS (~ objects/arrays having self-referring values)
  • doesn't fail on dumping large arrays, degrades gracefully*

Tidy and manageable dump output

  • expansible/collapsible branches, buttons for displaying
    all descendants vs. immediate children
  • exhibits variable key paths, like
    array['conf']['language_default']->language

Includes powerful frontend (Javascript) inspector

  • inspect variables; and get full error stack tracing (except for IE)
  • inspect jQuery events
  • log frontend inspections and errors to the backend log

Don't worry anymore...

about forgotten var_dump()s and print_r()s after development and debugging sessions.
If you've set user role permissions sensibly: the ordinary site visitor will never see a dump.

* Inspectors and tracers stop - and do a second attempt using less depth+more truncation - when producing overly long output. And they abort if time is closing in to PHP's maximum execution time.

User/permissions suggestions

Direct inspection

  1. create 'tester' role
  2. allow 'tester's to log inspections/traces
  3. create user having the 'tester' role as well as the role relevant for the scenario you want to investigate (anonymous or authenticated user, or some dedicated user role)
  4. test the relevant pages/features, and check screen outputs or Recent log messages

Indirect inspection - gather information during users' visits

  1. allow the appropriate role to log inspections/traces
  2. do something else, for minutes/hours/days
  3. revoke the role's inspection permission (prevent log flooding)
  4. check Recent log messages and study the inspections gathered during real life use of your site

Sponsorship

Inspect version 7.x-5.0 was sponsored by Københavns Kommune, Koncernservice (Copenhagen Municipality, Corporate Services).

Related modules



Documentation

Requirements

PHP 5.3+