-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontroller.php
More file actions
executable file
·35 lines (25 loc) · 918 Bytes
/
controller.php
File metadata and controls
executable file
·35 lines (25 loc) · 918 Bytes
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
<?php defined('C5_EXECUTE') or die("Access Denied.");
class ApiBaseConfigPackage extends Package {
protected $pkgHandle = 'api_base_config';
protected $appVersionRequired = '5.6.0';
protected $pkgVersion = '0.9';
public function getPackageName() {
return t("Api:Base:Config");
}
public function getPackageDescription() {
return t("Provides API config management.");
}
public function install() {
$installed = Package::getByHandle('api');
if(!is_object($installed)) {
throw new Exception(t('Please install the "API" package before installing %s', $this->getPackageName()));
}
parent::install();
$pkg = Package::getByHandle($this->pkgHandle);
ApiRoute::add('config', t('List, Add, and Edit Config Entries'), $pkg);
}
public function uninstall() {
ApiRouteList::removeByPackage($this->pkgHandle);//remove all the apis
parent::uninstall();
}
}