-
Notifications
You must be signed in to change notification settings - Fork 2
/
extension.driver.php
76 lines (64 loc) · 1.43 KB
/
extension.driver.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
<?php
/**
* Created by Symphony Extension Developer.
* 2013-02-04
*/
class Extension_Id_field extends Extension {
/**
* About information
* For if you want to create a pre-2.3-extension
*/
public function about() {
return array(
'name' => 'ID Field',
'version' => '1.0',
'release-date' => '2013-02-04',
'author' => array(
array(
'name' => 'Twisted Interactive',
'website' => 'http://www.twisted.nl'
)
)
);
}
/**
* Get the subscribed delegates
* @return array
*/
public function getSubscribedDelegates() {
return array(
);
}
/**
* Installation instructions
*/
public function install() {
// Create field database:
Symphony::Database()->query("
CREATE TABLE IF NOT EXISTS `tbl_fields_id_field` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`field_id` INT(11) UNSIGNED NOT NULL,
PRIMARY KEY (`id`),
KEY `field_id` (`field_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
");
}
/**
* Uninstall instructions
*/
public function uninstall() {
// Drop tables:
Symphony::Database()->query("DROP TABLE `tbl_fields_id_field`");
}
/**
* Update instructions
* @param $previousVersion
* The version that is currently installed in this Symphony installation
* @return boolean
*/
public function update($previousVersion) {
if (version_compare($previousVersion, '1.1', '<')) {
// Update from pre-1.1 to 1.1:
}
}
}