XMF Cookbook
  • Introduction
  • XMF Cookbook
  • Basic Ingredients
    • Namespaces
    • Autoloading
    • Debugging
    • Forward Compatibility
  • Recipes
    • Introducing Module Helpers
    • Using the Permission Helper
      • Checking Permissions
      • Managing Item Permissions
    • Using the Session Helper
    • Using JSON Web Tokens
    • Altering Database Tables
    • Migrating a Module's Database
    • Loading Initial Data
    • Module Admin Pages
      • Hide and Seek with Icons
      • Standard Admin Pages
    • Manage Metadata
    • Highlighting Content
  • Reference
    • Assert
      • Assertions
    • Database
      • Migrate
      • TableLoad
      • Tables
        • Getting Started
        • Table Operations
        • Working with Columns
        • Working with Indexes
        • Changing Table Data
        • Interacting with the Work Queue
        • Error Info and Debugging
    • Debug
    • FilterInput
    • Highlighter
    • IPAddress
    • Jwt
      • JsonWebToken
      • KeyFactory
      • TokenFactory
      • TokenReader
    • Key
      • ArrayStorage
      • Basic
      • FileStorage
      • KeyAbstract
      • StorageInterface
    • Language
    • Metagen
      • Extracting Data
      • Applying Data
    • Module
      • Admin
      • Helper
      • Helper
        • AbstractHelper
        • Cache
        • GenericHelper
        • Permission
        • Session
    • ProxyCheck
    • Random
    • Request
    • StopWords
    • Uuid
    • Yaml
  • Credits
  • License:
  • Table of Content
Powered by GitBook
On this page
  1. Basic Ingredients

Debugging

PreviousAutoloadingNextForward Compatibility

Last updated 6 years ago

When you are coding, things happen. When code goes live, things happen. Sometime, when those things happen it isn't practical, or in some cases even possible, to use XDebug in a fancy IDE. The old fashioned, light weight approach of echoing variables from deep inside the code comes to the rescue. But, echo and var_export have are not the most friendly or productive tools. This is where Xmf\Debug is your friend.

    \Xmf\Debug::dump($GLOBALS['xoopsModule']);

Output this when executed:

Clicking on the dump line opens it:

You can dump multiple variable in one line:

    \Xmf\Debug::dump($counter, $output, $handler);

Need to take a look at your inputs?

    \Xmf\Debug::dump($_POST);

How did we get here?

    \Xmf\Debug::backtrace();

Always there, Xmf\Debug can be a handy tool to keep in mind.

dump output
dump output