/var/www-protected/php-debug.com/www/PHP/Debug/Renderer/HTML/TableConfig.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
<?php
 
/**
 * Configuration file for HTML_Table renderer
 *
 * @package PHP_Debug
 * @category PHP
 * @author Loic Vernet <qrf_coil at yahoo dot fr>
 * @since V2.0.0 - 10 Apr 2006
 * 
 * @package PHP_Debug
 * @filesource
 * 
 * @version    CVS: $Id: TableConfig.php,v 1.1 2008/05/02 14:26:37 c0il Exp $
 */
 
class PHP_Debug_Renderer_HTML_TableConfig
{    
    /**
     * Config container for Debug_Renderer_HTML_Table
     * 
     * @var array
     * @since V2.0.0 - 11 apr 2006
     */
    protected static $options = array();
    
    /**
     * Static Instance of class
     *  
     * @var array
     * @since V2.0.0 - 11 apr 2006
     */
    protected static $instance = null;
        
    /**
     * Debug_Renderer_HTML_Table_Config class constructor
     * 
     * @since V2.0.0 - 11 apr 2006
     */
    protected function __construct()
    {
        /**
         * Enable or disable Credits in debug infos 
         */
        self::$options['HTML_TABLE_disable_credits'] = false;
 
        /**
         * Enable or disable included and required files
         */ 
        self::$options['HTML_TABLE_show_templates'] = true;
        
        /**
         * Enable or disable pattern removing in included files
         */
        self::$options['HTML_TABLE_remove_templates_pattern'] = false;
        
        /**
         * Pattern list to remove in the display of included files
         * if HTML_TABLE_remove_templates_pattern is set to true
         */ 
        self::$options['HTML_TABLE_templates_pattern'] = array(); 
 
        /**
         * Enable or disable visualisation of $globals var in debug
         */
        self::$options['HTML_TABLE_show_globals'] = false;   
 
        /** 
         * Enable or disable search in debug 
         */ 
        self::$options['HTML_TABLE_enable_search'] = true; 
 
        /** 
         * Enable or disable view of super arrays 
         */
        self::$options['HTML_TABLE_show_super_array'] = true;
 
        /** 
         * Enable or disable the use of $_REQUEST array instead of 
         * $_POST + _$GET + $_COOKIE + $_FILES
         */
        self::$options['HTML_TABLE_use_request_arr'] = false;  
 
        /** 
         * View Source script path
         */
        self::$options['HTML_TABLE_view_source_script_path'] = '.';  
        
        /** 
         * View source script file name
         */     
        self::$options['HTML_TABLE_view_source_script_name'] = 'PHP_Debug_ShowSource.php'; 
 
        /** 
         * css path
         */     
        self::$options['HTML_TABLE_css_path'] = 'css'; 
 
        /** 
         * Tabsize for view source script
         */     
        self::$options['HTML_TABLE_view_source_tabsize'] = 4; 
 
        /** 
         * Tabsize for view source script
         */     
        self::$options['HTML_TABLE_view_source_numbers'] = 2; //HL_NUMBERS_TABLE 
 
       /** 
        * Define wether the display must be forced for the debug type when
        * in search mode
        */
        self::$options['HTML_TABLE_search_forced_type'] = array( 
            PHP_DebugLine::TYPE_STD         => false, 
            PHP_DebugLine::TYPE_QUERY       => false, 
            PHP_DebugLine::TYPE_QUERYREL    => false,
            PHP_DebugLine::TYPE_ENV         => false,
            PHP_DebugLine::TYPE_APPERROR    => false,
            PHP_DebugLine::TYPE_CREDITS     => false,
            PHP_DebugLine::TYPE_SEARCH      => true,
            PHP_DebugLine::TYPE_DUMP        => false,
            PHP_DebugLine::TYPE_PROCESSPERF => false,
            PHP_DebugLine::TYPE_TEMPLATES   => false,
            PHP_DebugLine::TYPE_PAGEACTION  => false,
            PHP_DebugLine::TYPE_SQLPARSE    => false,
            PHP_DebugLine::TYPE_WATCH       => false,
            PHP_DebugLine::TYPE_PHPERROR    => false
        );    
 
        /**
         * After this goes all HTML related variables
         * 
         * 
         * HTML code for header 
         */         
         self::$options['HTML_TABLE_header'] = '
<div id="pd-div">
<br />
<a name="pd-anchor" id="pd-anchor" />
<table class="pd-table" cellspacing="0" cellpadding="0" width="100%">
  <tr>
    <td class="pd-table-header" align="center">File</td>
    <td class="pd-table-header" align="center">Line</td>
    <td class="pd-table-header" align="center">Inside/From function</td>
    <td class="pd-table-header" align="center">Inside/From Class</td>  
    <td class="pd-table-header" align="center">Type</td>  
    <td class="pd-table-header" align="center">Debug information</td>
    <td class="pd-table-header" align="center">Execution time (sec)</td>
  </tr>
        ';
 
        /**
         * HTML code for footer 
         */         
         self::$options['HTML_TABLE_credits'] = '
        PHP_Debug ['. PHP_Debug::PEAR_RELEASE .'] | By COil (2007) | 
        <a href="http://www.coilblog.com">http://www.coilblog.com</a> | 
        <a href="http://phpdebug.sourceforge.net/">PHP_Debug Project Home</a> 
        ';
 
        /**
         * HTML code for a basic header 
         */         
         self::$options['HTML_TABLE_simple_header'] = '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title>Pear::PHP_Debug</title>
';
 
        /**
         * HTML code for a basic footer 
         */         
         self::$options['HTML_TABLE_simple_footer'] = '
</body>
</html>
';
 
        /**
         * HTML pre-row code for debug column file 
         */         
         self::$options['HTML_TABLE_prerow'] = '
  <tr>';
 
        /**
         * HTML pre-row code for debug column file 
         */         
         self::$options['HTML_TABLE_interrow_file'] = '
    <td class="pd-td" align="center">';
 
        /**
         * HTML post-row code for debug column line (centered)
         */         
        self::$options['HTML_TABLE_interrow_line'] = '
    </td>
    <td class="pd-td" align="center">';
 
        self::$options['HTML_TABLE_interrow_function'] = self::$options['HTML_TABLE_interrow_line']; 
        self::$options['HTML_TABLE_interrow_class']    = self::$options['HTML_TABLE_interrow_line']; 
        self::$options['HTML_TABLE_interrow_type']     = self::$options['HTML_TABLE_interrow_line']; 
        self::$options['HTML_TABLE_interrow_time']     = self::$options['HTML_TABLE_interrow_line']; 
 
        /**
         * HTML pre-row code for debug column info
         */         
        self::$options['HTML_TABLE_interrow_info'] = '
    </td>
    <td class="pd-td" align="left">';
 
 
        /**
         * HTML post-row code for debugline 
         */         
         self::$options['HTML_TABLE_postrow'] = '
    </td>
  </tr>
';
 
        /**
         * HTML code for footer 
         */         
         self::$options['HTML_TABLE_footer'] = '
</table>
</div>
';
 
    }
 
    /**
     * returns the static instance of the class
     *
     * @since V2.0.0 - 11 apr 2006
     * @see PHP_Debug
     */
    public static function singleton()
    {
        if (!isset(self::$instance)) {
            $class = __CLASS__;
            self::$instance = new $class;
        }
        return self::$instance;
    }
    
    /**
     * returns the configuration
     *
     * @since V2.0.0 - 07 apr 2006
     * @see PHP_Debug
     */
    public static function getConfig()
    {
        return self::$options;
    }
    
    /**
     * HTML_Table_Config
     * 
     * @since V2.0.0 - 26 Apr 2006
     */
    public function __toString()
    {
        return '<pre>'. PHP_Debug::dumpVar(
            $this->singleton()->getConfig(), 
            __CLASS__, 
            false,
            PHP_DEBUG_DUMP_ARR_STR). '</pre>';
    }   
}