-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.php
84 lines (74 loc) · 2.41 KB
/
build.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
<?php
//-----------------------------------------------------------------------
// Copyright (c) 2017-2019 TEAM A72
// This file is part of YeziiBot. YeziiBot is distributed with the hope of
// attracting more community contributions to the core ecosystem
// of the HeXiaoling Project.
// YeziiBot is free software: you can redistribute it and/or modify
// it under the terms of the Affero GNU General Public License version 3
// as published by the Free Software Foundation.
// YeziiBot is distributed WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Affero General Public License for more details.
// You should have received a copy of the GNU Affero General Public License
// along with YeziiBot. If not, see <http://www.gnu.org/licenses/>.
//-----------------------------------------------------------------------
//file_put_contents("composer-installer", fopen("https://getcomposer.org/installer", 'r'));
//exec("php composer-installer");
//exec("php composer.phar install");
exec("mkdir storage\\");
exec("mkdir storage\\data\\");
exec("mkdir storage\\cache\\");
fopen("storage/data/black.txt","a");
$db = new SQLite3('storage/data/stat.db');
$sql=<<<EOF
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE record(
user_id BIGINT NOT NULL,
command TEXT NOT NULL,
count NOT NULL
);
COMMIT;
EOF;
$db->query($sql);
$db->close();
$dbx = new SQLite3('storage/data/kjbot.db');
$sqlx=<<<EOF
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE "credits" (
"qid" INTEGER NOT NULL,
"coin" INTEGER NOT NULL DEFAULT 0,
"xp" INTEGER NOT NULL DEFAULT 0,
"lastcheck" INTEGER NOT NULL DEFAULT 0,
"ex1" INTEGER DEFAULT 0,
"sc1" INTEGER DEFAULT 0,
"sc2" INTEGER DEFAULT 0,
"api_key" TEXT UNIQUE,
"badge" TEXT,
"energy" INTEGER DEFAULT 200,
"energy_last_deduct" INTEGER DEFAULT 0,
PRIMARY KEY("qid")
);
CREATE TABLE `tickets` (
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE,
`sender` INTEGER NOT NULL,
`text` TEXT NOT NULL,
`status` INTEGER NOT NULL
);
CREATE TABLE "replies" (
"question" TEXT NOT NULL,
"answer" TEXT NOT NULL,
"status" INTEGER NOT NULL DEFAULT 1,
PRIMARY KEY("question")
);
CREATE TABLE `global_special_users` (
`qid` INTEGER NOT NULL,
`gid` INTEGER NOT NULL
);
COMMIT;
EOF;
$dbx->query($sqlx);
$dbx->close();
?>