-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.php
More file actions
96 lines (78 loc) · 2.44 KB
/
install.php
File metadata and controls
96 lines (78 loc) · 2.44 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
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
85
86
87
88
89
90
91
92
93
94
95
96
<?php
/**
* Created by JetBrains PhpStorm.
* User: Guillaume
* Date: 21/07/13
* Time: 15:58
* To change this template use File | Settings | File Templates.
*/
// this File is to create tables in the db.
// 1- you have to change file: model/sql_connector.php
// 2-modify it with you user password and host then save it.
// 3- execute this script to create Tables.
// to simplfy the systeme the content of .sql is not charged and I use a simple varriable that content a precharged file.
$queryText = '
-- phpMyAdmin SQL Dump
-- version 3.4.8
-- http://www.phpmyadmin.net
--
-- Host: mysql2.alwaysdata.com
-- Generation Time: Jul 21, 2013 at 04:07 PM
-- Server version: 5.1.66
-- PHP Version: 5.3.6-11
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `loquii_wol`
--
-- --------------------------------------------------------
--
-- Table structure for table `jobs`
--
CREATE TABLE IF NOT EXISTS `jobs` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user` text NOT NULL,
`name` text NOT NULL,
`mac` text NOT NULL,
`ip` text NOT NULL,
`port` int(11) NOT NULL,
`dateExpire` text NOT NULL,
`configs` text NOT NULL,
`createdOn` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ;
--
-- Dumping data for table `jobs`
--
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` text NOT NULL,
`pass` text NOT NULL,
`joined` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`valid` tinyint(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ;
--
-- Dumping data for table `users`
--
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
';
// Then we can parse this text.
$requetes = explode(';', $queryText);
foreach($requetes as $requete){
$req = $bdd->prepare($requete);
$req->execute();
}
$bdd->close();
//After that the mysql Base may have tables created.
//You can now use the service !