예제 #1
0
파일: dump.php 프로젝트: justinlyon/scc
/**
 * Add a variable to the list of variables that will be shown in the debug window
 * @param mixed $var The variable you want to dump
 * @param mixed $name The name of the variable you want to dump
 */
function dump($var = null, $name = '(unknown name)', $type = null, $level = 0)
{
    global $mainframe;
    include_once JPATH_PLUGINS . DS . 'system' . DS . 'dump' . DS . 'node.php';
    $source = '';
    if (function_exists('debug_backtrace')) {
        $trace = debug_backtrace();
        $source = DumpHelper::getSourceFunction($trace);
        //$source .= '@';
        $source .= DumpHelper::getSourcePath($trace);
    }
    // create a new node array
    $node =& DumpNode::getNode($var, $name, $type, $level, $source);
    //get the current userstate
    $userstate = $mainframe->getUserState('dump.nodes');
    // append the node to the array
    $userstate[] = $node;
    // set the userstate to the new array
    $mainframe->setUserState('dump.nodes', $userstate);
}
예제 #2
0
파일: dump.php 프로젝트: romuland/khparts
/**
 * Add a variable to the list of variables that will be shown in the debug window
 * @param mixed $var The variable you want to dump
 * @param mixed $name The name of the variable you want to dump
 */
function dump($var = null, $name = '(unknown name)', $type = null, $level = 0)
{
    $mainframe = JFactory::getApplication();
    $option = JRequest::getCmd('option');
    require_once JPATH_ADMINISTRATOR . '/components/com_dump/node.php';
    $source = '';
    if (function_exists('debug_backtrace')) {
        $trace = debug_backtrace();
        $source = DumpHelper::getSourceFunction($trace);
        //$source .= '@';
        $source .= DumpHelper::getSourcePath($trace);
    }
    // create a new node array
    $node = DumpNode::getNode($var, $name, $type, $level, $source);
    //get the current userstate
    $userstate = $mainframe->getUserState('dump.nodes');
    // append the node to the array
    $userstate[] = $node;
    // set the userstate to the new array
    $mainframe->setUserState('dump.nodes', $userstate);
}