-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdetails.php
89 lines (71 loc) · 2.39 KB
/
details.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
85
86
87
88
89
<?php defined('BASEPATH') or exit('No direct script access allowed');
/**
* Deploy Details File
*
* @package PyroCMS
* @subpackage Deploy
* @author Dan Sullivan
*/
class Module_Deploy extends Module {
public $version = '1.0';
// --------------------------------------------------------------------------
public function info()
{
return array(
'name' => array(
'en' => 'Deploy'
),
'description' => array(
'en' => 'Git Deploy module'
),
'frontend' => true,
'backend' => true,
'menu' => 'data',
'author' => 'Dan Sullivan',
'roles' => array(
'deploy', 'migrate', 'clear_log'
),
);
}
// --------------------------------------------------------------------------
public function install()
{
$migrations = "
CREATE TABLE ".$this->db->dbprefix('deploy_migration')." (
`version` int(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
";
$insert_migration = "
INSERT INTO ".$this->db->dbprefix('deploy_migration')." VALUES('1')
";
$log = "
CREATE TABLE ".$this->db->dbprefix('deploy_log')." (
`id` int(11) NOT NULL AUTO_INCREMENT,
`msg` varchar(255) NOT NULL COLLATE utf8_unicode_ci,
`date` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
";
if ($this->db->query($migrations) and $this->db->query($insert_migration) and $this->db->query($log))
{
return true;
}
}
// --------------------------------------------------------------------------
public function uninstall()
{
$this->dbforge->drop_table('deploy_migration');
$this->dbforge->drop_table('deploy_log');
return true;
}
// --------------------------------------------------------------------------
public function upgrade($old_version)
{
return true;
}
// --------------------------------------------------------------------------
public function help()
{
return "No documentation has been added for this module.<br/>Contact the module developer for assistance.";
}
}