Plugin Directory

Changeset 645528


Ignore:
Timestamp:
12/28/2012 08:12:41 PM (13 years ago)
Author:
misternifty
Message:

Added false and empty string indicators to defined constants mode.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • debug-this/branches/dev/_inc/extensions.php

    r645515 r645528  
    1313        add_debug_extension('cache', __('Object Cache', 'debug-this'), __('Object Cache stats', 'debug-this'), array($this, 'cache'), 'Cache');
    1414        add_debug_extension('constants', __('Constants', 'debug-this'), __('Defined Constants', 'debug-this'), array($this, 'constants'), 'PHP');
    15         add_debug_extension('constants-wp', __('WordPress Constants', 'debug-this'), __('Defined WordPress Constants', 'debug-this'), array($this, 'constants_wordpress'), 'PHP');
     15        add_debug_extension('constants-wp', __('Constants (WordPress)', 'debug-this'), __('Defined WordPress Constants', 'debug-this'), array($this, 'constants_wordpress'), 'PHP');
    1616        add_debug_extension('content-width', __('Content Width', 'debug-this'), __('global $content_width', 'debug-this'), array($this, 'content_width'), 'Themes');
    1717        add_debug_extension('context', __('Context', 'debug-this'), __('Conditional Context Tags', 'debug-this'), array($this, 'context'), 'Query');
     
    173173
    174174    public function constants(){
    175         $debug = print_r(get_defined_constants(), true);
     175        $constants = get_defined_constants();
     176        foreach($constants as $constant => $value)
     177            if($value === false)
     178                $constants[$constant] = '<span class="error">'.__('false', 'debug-this').'</span>';
     179            elseif($value === '')
     180                $constants[$constant] = '<span class="error">'.__('empty string', 'debug-this').'</span>';
     181        $debug = print_r($constants, true);
    176182        return $debug;
    177183    }
Note: See TracChangeset for help on using the changeset viewer.