forked from xpressengine/xe-module-profiler
-
Notifications
You must be signed in to change notification settings - Fork 1
/
profiler.class.php
71 lines (57 loc) · 1.44 KB
/
profiler.class.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
<?php
/* Copyright (C) NAVER <http://www.navercorp.com> */
/**
* @class profiler
* @author NAVER ([email protected])
* @brief Profiler module high class.
*/
class profiler extends ModuleObject
{
private $triggers = array(
array('XE.writeSlowlog', 'profiler', 'controller', 'triggerWriteSlowlog', 'after')
);
function moduleInstall()
{
$oModuleController = getController('module');
foreach($this->triggers as $trigger)
{
$oModuleController->insertTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]);
}
return new Object();
}
function checkUpdate()
{
$oModuleModel = getModel('module');
foreach($this->triggers as $trigger)
{
if(!$oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]))
{
return TRUE;
}
}
return FALSE;
}
function moduleUpdate()
{
$oModuleModel = getModel('module');
$oModuleController = getController('module');
foreach($this->triggers as $trigger)
{
if(!$oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]))
{
$oModuleController->insertTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]);
}
}
return new Object(0, 'success_updated');
}
function moduleUninstall()
{
return new Object();
}
function recompileCache()
{
return new Object();
}
}
/* End of file profiler.class.php */
/* Location: ./modules/profiler/profiler.class.php */