-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.ext.php
More file actions
53 lines (39 loc) · 1.08 KB
/
debug.ext.php
File metadata and controls
53 lines (39 loc) · 1.08 KB
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
<?php
class EXT_Debug
{
//--------------------------------------------------------------------------
private $_cookie_name = 'ff_debug';
private $_status = FALSE;
//--------------------------------------------------------------------------
public function __construct()
{
// if ( ! empty($_COOKIE[$this->_cookie_name]))
// {
// $this->status(TRUE);
// }
if ( ! empty($_REQUEST[$this->_cookie_name]))
{
$this->status(TRUE);
}
}
//--------------------------------------------------------------------------
public function render_log($status = NULL)
{
if ($this->status($status))
{
return sys::$lib->load->template(EXT_PATH . 'debug/templates/debug');
}
}
//--------------------------------------------------------------------------
public function status($status = NULL)
{
if ($status !== NULL)
{
setcookie($this->_cookie_name, $status, 0, '/');
$_COOKIE[$this->_cookie_name] = $status;
$this->_status = (bool)$status;
}
return $this->_status;
}
//--------------------------------------------------------------------------
}