Ejemplo n.º 1
0
                $retval .= "<br />" . $prefix . " [" . $key . "] = ";
                $retval .= self::dump($value, $indent);
            }
        } elseif (is_object($data)) {
            $retval .= "Object (" . get_class($data) . ")";
            $indent++;
            foreach ($data as $key => $value) {
                $retval .= "<br />" . $prefix . " " . $key . " -> ";
                $retval .= self::dump($value, $indent);
            }
        } else {
            $retval .= "not suported";
        }
        return $retval;
    }
    public static function trace_conv_size($size, $unit = "")
    {
        if (!$unit && $size >= 1 << 30 || $unit == "GB") {
            return number_format($size / (1 << 30), 2) . "GB";
        }
        if (!$unit && $size >= 1 << 20 || $unit == "MB") {
            return number_format($size / (1 << 20), 2) . "MB";
        }
        if (!$unit && $size >= 1 << 10 || $unit == "KB") {
            return number_format($size / (1 << 10), 2) . "KB";
        }
        return number_format($size) . " bytes";
    }
}
Trace::$script_start = microtime(true);