-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextension.php
42 lines (36 loc) · 1.08 KB
/
extension.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
<?php
class DemoExtension extends Minz_Extension {
public function install() {
$files_to_install = array(
'/data/config-user.custom.php' => DATA_PATH . '/config-user.custom.php',
'/data/default-feeds.opml.xml' => DATA_PATH . '/opml.xml',
);
foreach ($files_to_install as $src_file => $dest_file) {
$res = copy($this->getPath() . $src_file, $dest_file);
if (!$res) {
return false;
}
}
return true;
}
public function uninstall() {
$files_to_unlink = array(
DATA_PATH . '/config-user.custom.php',
DATA_PATH . '/opml.xml',
);
foreach ($files_to_unlink as $file) {
if (file_exists($file)) {
$res = unlink($file);
if (!$res) {
return false;
}
}
}
return true;
}
public function init() {
$this->registerController('extension');
$this->registerController('user');
$this->registerViews();
}
}