lychee/php/Access/Installation.php

44 lines
741 B
PHP
Raw Normal View History

2014-04-30 09:10:31 +00:00
<?php
namespace Lychee\Access;
2014-04-30 09:10:31 +00:00
use Lychee\Modules\Config;
use Lychee\Modules\Module;
2014-04-30 09:10:31 +00:00
final class Installation implements Access {
2014-04-30 09:10:31 +00:00
public function check($fn) {
switch ($fn) {
case 'Config::create': $this->configCreate(); break;
2014-04-30 09:10:31 +00:00
# Error
default: $this->init(); break;
2014-04-30 09:10:31 +00:00
}
return true;
}
private function configCreate() {
2014-04-30 09:10:31 +00:00
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']);
2014-04-30 09:10:31 +00:00
}
2015-03-06 22:29:55 +00:00
private function init() {
$return = array(
'status' => LYCHEE_STATUS_NOCONFIG
);
echo json_encode($return);
}
2014-04-30 09:10:31 +00:00
}
?>