You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lychee/php/Access/Installation.php

45 lines
840 B

<?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);
}
}
?>