forked from ddrake/cobble
-
Notifications
You must be signed in to change notification settings - Fork 0
/
controller.php
51 lines (38 loc) · 1.42 KB
/
controller.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
<?php
defined('C5_EXECUTE') or die(_("Access Denied."));
class CobblePackage extends Package {
protected $pkgHandle = 'cobble';
protected $appVersionRequired = '5.3.2';
protected $pkgVersion = '1.09';
public function getPackageDescription() {
return t('Analyzes the site\'s themes, page types, pages and areas from both file system and database perspectives; Provides queries for help with troubleshooting.');
}
public function getPackageName() {
return t('Cobble');
}
public function install() {
$pkg = parent::install();
//Install dashboard page
Loader::model('single_page');
$newC = SinglePage::add('/dashboard/cobble', $pkg);
$newC->update(array('cDescription' => 'A Diagnostic Tool for Concrete 5 '));
}
public function upgrade() {
// In case the schema changed, drop all cobble tables
$db = Loader::db();
$db->Execute('DROP TABLE CobblePageThemes, CobblePageTypes, CobbleAreas, CobblePages, CobbleTemplateAreas');
// This needs to be called AFTER dropping tables!
parent::upgrade();
// not using the job any more so remove it if it exists...
Loader::model('job');
$job = Job::getByHandle('cobble_refresh');
if (!empty($job)) {
$job->uninstall();
}
}
public function uninstall() {
parent::uninstall();
$db = Loader::db();
$db->Execute('DROP TABLE CobblePageThemes, CobblePageTypes, CobbleAreas, CobblePages, CobbleTemplateAreas');
}
}