Installation.php 741 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace Lychee\Access;
  3. use Lychee\Modules\Config;
  4. use Lychee\Modules\Module;
  5. final class Installation implements Access {
  6. public function check($fn) {
  7. switch ($fn) {
  8. case 'Config::create': $this->configCreate(); break;
  9. # Error
  10. default: $this->init(); break;
  11. }
  12. return true;
  13. }
  14. private function configCreate() {
  15. Module::dependencies(isset($_POST['dbHost'], $_POST['dbUser'], $_POST['dbPassword'], $_POST['dbName'], $_POST['dbTablePrefix']));
  16. echo Config::create($_POST['dbHost'], $_POST['dbUser'], $_POST['dbPassword'], $_POST['dbName'], $_POST['dbTablePrefix']);
  17. }
  18. private function init() {
  19. $return = array(
  20. 'status' => LYCHEE_STATUS_NOCONFIG
  21. );
  22. echo json_encode($return);
  23. }
  24. }
  25. ?>