-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall.php
More file actions
executable file
·52 lines (41 loc) · 1.07 KB
/
Copy pathinstall.php
File metadata and controls
executable file
·52 lines (41 loc) · 1.07 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
<?php
session_start();
define('WWW_ROOT', 'http://'.$_SERVER['SERVER_NAME'].(strlen(dirname($_SERVER['SCRIPT_NAME'])) > 1 ? dirname($_SERVER['SCRIPT_NAME']) : '').'/');
define('FS_ROOT', realpath('.').DIRECTORY_SEPARATOR);
define('YNPROJECT', 1);
define('AJAXMODE', 0);
header('Content-Type: text/html; charset=utf-8');
require_once('config.php');
$tables = db::get()->showTables();
echo"<pre>";
print_r($tables);
echo"</pre>";
if(!in_array("tasks", $tables)){
db::get()->query("
CREATE TABLE tasks (
id INTEGER UNSIGNED PRIMARY KEY,
uid INTEGER UNSIGNED,
parent INTEGER UNSIGNED,
title TEXT,
body TEXT,
urgency VARCHAR(255),
state VARCHAR(255),
deleted CHAR(1) DEFAULT '0',
date INT UNSIGNED
)
");
echo"<div>таблица <b>tasks</b> создана</div>";
}
if(!in_array("comments", $tables)){
db::get()->query("
CREATE TABLE comments (
id INTEGER UNSIGNED PRIMARY KEY,
uid INTEGER UNSIGNED,
trg INTEGER UNSIGNED,
body TEXT,
date INT UNSIGNED
)
");
echo"<div>таблица <b>comments</b> создана</div>";
}
?>