Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
/* vim: set expandtab tabstop=4 shiftwidth=4: */
3
// +----------------------------------------------------------------------+
4
// | PHP version 4                                                        |
5
// +----------------------------------------------------------------------+
6
// | Copyright (c) 1997-2006 The PHP Group                                |
7
// +----------------------------------------------------------------------+
8
// | This source file is subject to version 3.0 of the PHP license,       |
9
// | that is bundled with this package in the file LICENSE, and is        |
10
// | available through the world-wide-web at the following url:           |
11
// | http://www.php.net/license/3_0.txt.                                  |
12
// | If you did not receive a copy of the PHP license and are unable to   |
13
// | obtain it through the world-wide-web, please send a note to          |
14
// | license@php.net so we can mail you a copy immediately.               |
15
// +----------------------------------------------------------------------+
16
// | Authors: Frederic Poeydomenge <fpoeydomenge@free.fr>                 |
17
// +----------------------------------------------------------------------+
18
 
19
/**
20
 * Wrapper for the var_dump function.
21
 *
22
 * " The var_dump function displays structured information about expressions
23
 * that includes its type and value. Arrays are explored recursively
24
 * with values indented to show structure. "
25
 *
26
 * The Var_Dump class captures the output of the var_dump function,
27
 * by using output control functions, and then uses external renderer
28
 * classes for displaying the result in various graphical ways :
29
 * simple text, HTML/XHTML text, HTML/XHTML table, XML, ...
30
 *
31
 * @category  PHP
32
 * @package   Var_Dump
33
 * @author    Frederic Poeydomenge <fpoeydomenge@free.fr>
34
 * @copyright 1997-2006 The PHP Group
35
 * @license   http://www.php.net/license/3_0.txt PHP License 3.0
36
 * @version   CVS: $Id: HTML4_Table.php 233111 2007-04-02 09:38:10Z fredericpoeydome $
37
 * @link      http://pear.php.net/package/Var_Dump
38
 */
39
 
40
/**
41
 * Include Table Renderer class
42
 */
43
 
44
require_once 'Var_Dump/Renderer/Table.php';
45
 
46
/**
47
 * A concrete renderer for Var_Dump
48
 *
49
 * Returns a table-based representation of a variable in HTML 4
50
 * Extends the 'Table' renderer, with just a predefined set of options,
51
 * that are empty by default. You can also directly call the 'Table' renderer
52
 * with the corresponding configuration options.
53
 *
54
 * @category  PHP
55
 * @package   Var_Dump
56
 * @author    Frederic Poeydomenge <fpoeydomenge@free.fr>
57
 * @copyright 1997-2006 The PHP Group
58
 * @license   http://www.php.net/license/3_0.txt PHP License 3.0
59
 * @version   CVS: $Id: HTML4_Table.php 233111 2007-04-02 09:38:10Z fredericpoeydome $
60
 * @link      http://pear.php.net/package/Var_Dump
61
 */
62
 
63
class Var_Dump_Renderer_HTML4_Table extends Var_Dump_Renderer_Table
64
{
65
 
66
    /**
67
     * Class constructor.
68
     *
69
     * @param array $options Parameters for the rendering.
70
     * @access public
71
     */
72
    function Var_Dump_Renderer_HTML4_Table($options = array())
73
    {
74
        // See Var_Dump/Renderer/Table.php for the complete list of options
75
        $this->defaultOptions = array_merge(
76
            $this->defaultOptions,
77
            array(
78
                'before_num_key' => '<b>',
79
                'after_num_key'  => '</b>',
80
                'before_str_key' => '<b>',
81
                'after_str_key'  => '</b>',
82
                'before_type'    => '<font color="#000000">',
83
                'after_type'     => '</font>',
84
                'before_value'   => '<font color="#006600">',
85
                'after_value'    => '</font>',
86
                'start_table'    =>
87
                    '<table border="0" cellpadding="1" cellspacing="0"' .
88
                    ' bgcolor="black"><tr><td>' .
89
                    '<table border="0" cellpadding="4" cellspacing="0"' .
90
                    ' width="100%">',
91
                'end_table'      => '</table></td></tr></table>',
92
                'start_tr'       => '<tr valign="top" bgcolor="#F8F8F8">',
93
                'start_tr_alt'   => '<tr valign="top" bgcolor="#E8E8E8">',
94
                'start_td_key'   => '<td bgcolor="#CCCCCC">',
95
                'start_caption'  => '<caption style="color:white;background:#339900;">'
96
            )
97
        );
98
        $this->setOptions($options);
99
    }
100
 
101
}
102
 
103
?>