-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaintain.class.php
47 lines (38 loc) · 1008 Bytes
/
maintain.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
<?php
defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
class online_users_maintain extends PluginMaintain
{
private $table;
function __construct($plugin_id)
{
parent::__construct($plugin_id); // always call parent constructor
global $prefixeTable;
// Class members can't be declared with computed values so initialization is done here
$this->table = $prefixeTable . 'online_users';
}
function install($plugin_version, &$errors=array())
{
// add a new table
pwg_query('
CREATE TABLE IF NOT EXISTS `'. $this->table .'` (
`user_uuid` varchar(255) not null,
`last_visit` datetime not null,
PRIMARY KEY (`user_uuid`)
) ENGINE=MEMORY DEFAULT CHARSET=utf8
;');
}
function activate($plugin_version, &$errors=array())
{
}
function deactivate()
{
}
function update($old_version, $new_version, &$errors=array())
{
$this->install($new_version, $errors);
}
function uninstall()
{
pwg_query('DROP TABLE `'. $this->table .'`;');
}
}