-
Notifications
You must be signed in to change notification settings - Fork 1
/
Amslib_FirePHP.php
executable file
·98 lines (88 loc) · 2.34 KB
/
Amslib_FirePHP.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
<?php
/*******************************************************************************
* Copyright (c) {15/03/2008} {Christopher Thomas}
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* Contributors/Author:
* {Christopher Thomas} - Creator - [email protected]
*
*******************************************************************************/
/**
* class: Amslib_Form_Profile
*
* group: core
*
* file: Amslib_Form_Profile.php
*
* description: Wrapper around FirePHP
*
* todo: write documentation
*
*/
class Amslib_FirePHP extends FirePHP
{
/**
* method: __construct
*
* todo: write documentation
*/
public function __construct()
{
parent::__construct();
}
/**
* method: backtrace
*
* todo: write documentation
*/
public static function backtrace($levels=false)
{
$e = new Exception();
$trace = (is_numeric($levels) && $levels > 0)
? array_slice($e->getTrace(),0,(int)$levels)
: $e->getTrace();
self::output("backtrace",$trace);
}
/**
* method: output
*
* todo: write documentation
*/
public static function output($name,$data){
$a=func_get_args();
try{
$n = array_shift($a);
self::$instance->log(count($a) > 1 ? $a : current($a),$n);
}catch(Exception $e){
Amslib_Debug::log("stack_trace","exception occured whilst outputting firephp variables");
}
}
/**
* method: init
*
* todo: write documentation
*/
public static function init()
{
parent::init();
$options = array( 'maxObjectDepth' => 5,
'maxArrayDepth' => 10,
'maxDepth' => 10,
'useNativeJsonEncode' => true,
'includeLineNumbers' => true);
self::$instance->setOptions($options);
}
}
Amslib_FirePHP::init();