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