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.
44 lines
741 B
44 lines
741 B
<?php
|
|
|
|
namespace Lychee\Access;
|
|
|
|
use Lychee\Modules\Config;
|
|
use Lychee\Modules\Module;
|
|
|
|
final class Installation implements Access {
|
|
|
|
public function check($fn) {
|
|
|
|
switch ($fn) {
|
|
|
|
case 'Config::create': $this->configCreate(); break;
|
|
|
|
# Error
|
|
default: $this->init(); break;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
private function configCreate() {
|
|
|
|
Module::dependencies(isset($_POST['dbHost'], $_POST['dbUser'], $_POST['dbPassword'], $_POST['dbName'], $_POST['dbTablePrefix']));
|
|
echo Config::create($_POST['dbHost'], $_POST['dbUser'], $_POST['dbPassword'], $_POST['dbName'], $_POST['dbTablePrefix']);
|
|
|
|
}
|
|
|
|
private function init() {
|
|
|
|
$return = array(
|
|
'status' => LYCHEE_STATUS_NOCONFIG
|
|
);
|
|
|
|
echo json_encode($return);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|