-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSetup.php
executable file
·56 lines (48 loc) · 1.48 KB
/
Setup.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
<?php
namespace alexkar598\babxenforo;
use XF\AddOn\StepResult;
use XF\AddOn\StepRunnerInstallTrait;
use XF\AddOn\StepRunnerUninstallTrait;
class Setup extends \XF\AddOn\AbstractSetup
{
use StepRunnerInstallTrait;
use StepRunnerUninstallTrait;
const TABLE_CONNECTED_ACCOUNT_PROVIDER = 'xf_connected_account_provider';
const TABLE_USER_CONNECTED_ACCOUNT = 'xf_user_connected_account';
const PROVIDER_ID = 'BAB';
const PROVIDER_CLASS = 'alexkar598\\babxenforo:Provider\\BAB';
const PROVIDER_DISPLAY_ORDER = '500';
public function installStep1()
{
$this
->db()
->insert(
self::TABLE_CONNECTED_ACCOUNT_PROVIDER,
array(
'provider_id' => self::PROVIDER_ID,
'provider_class' => self::PROVIDER_CLASS,
'display_order' => self::PROVIDER_DISPLAY_ORDER,
'options' => ''
)
);
}
public function upgrade(array $stepParams = []) {}
public function uninstallStep1()
{
$this
->db()
->delete(
self::TABLE_CONNECTED_ACCOUNT_PROVIDER,
'provider_id = \'' . self::PROVIDER_ID . '\''
);
}
public function uninstallStep2()
{
$this
->db()
->delete(
self::TABLE_USER_CONNECTED_ACCOUNT,
'provider_key = \'' . self::PROVIDER_ID . '\''
);
}
}