-
Notifications
You must be signed in to change notification settings - Fork 653
Expand file tree
/
Copy pathInstallation.php
More file actions
45 lines (25 loc) · 840 Bytes
/
Installation.php
File metadata and controls
45 lines (25 loc) · 840 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
36
37
38
39
40
41
42
43
44
45
<?php
namespace Lychee\Access;
use Lychee\Modules\Config;
use Lychee\Modules\Response;
use Lychee\Modules\Validator;
final class Installation extends Access {
public static function init($fn) {
switch ($fn) {
case 'Config::create': self::configCreateAction(); break;
default: self::initAction(); break;
}
self::fnNotFound();
}
private static function configCreateAction() {
Validator::required(isset($_POST['dbHost'], $_POST['dbUser'], $_POST['dbPassword'], $_POST['dbName'], $_POST['dbTablePrefix']), __METHOD__);
Response::json(Config::create($_POST['dbHost'], $_POST['dbUser'], $_POST['dbPassword'], $_POST['dbName'], $_POST['dbTablePrefix']));
}
private static function initAction() {
$return = array(
'status' => LYCHEE_STATUS_NOCONFIG
);
Response::json($return);
}
}
?>