Ejemplo n.º 1
0
 function cache($id = False, $type = "globals")
 {
     core_setOption("cachedebug");
     $this->ID = $id ? "cache-{$id}" : "cache-" . ++$GLOBALS["cachClassCounter"];
     $this->type = preg_match("/^g/i", $type) ? "g" : "s";
     $this->debug = core_getOption("cachedebug") || core_getOption("debug") > 99;
     $this->dbg("constructor", "--------------------");
     if (!$GLOBALS[$this->cacheID]) {
         $GLOBALS[$this->cacheID] = array();
     }
 }
Ejemplo n.º 2
0
function core_dbgArray($r, $name = '', $forced = 0, $showEmptyValues = False, $showNumIndex = False)
{
    global $prevDbg, $core_tableDbg;
    if (!$r) {
        return;
    }
    if (!$forced && !core_getOption('debug')) {
        return;
    }
    if (!$name) {
        $name = 'dbgArray';
    }
    $prevDbg = '?';
    $core_dbgSV2 = core_getOption('debug');
    core_setOption('debug', $forced, $forced);
    for ($pass = 0; $pass < 2; $pass++) {
        $nlines = 0;
        foreach ($r as $k => $v) {
            if (!$v && !$showEmptyValues) {
                continue;
            }
            if (preg_match("/^[0-9]*\$/i", $k) && !$showNumIndex) {
                continue;
            }
            if (preg_match("/^[0-9]*\$/i", $k)) {
                $k = '[]';
            }
            $nlines++;
            if (True && is_array($v)) {
                core_dbgArray($v, $name);
            } else {
                core_tdbg($name, $k, $v);
            }
        }
        if ($nlines) {
            break;
        }
        $showNumIndex = True;
    }
    if ($core_tableDbg) {
        $core_tableDbg->close('</div>');
    }
    $core_tableDbg = False;
    core_setOption('debug', $core_dbgSV2, True);
}