opensupports/server/controllers/system/installation-done.php
Guillermo Giuliana 6a34c24d7d
update script and change 4.6 to 4.7 (#809)
* update script and change 4.6 to 4.7

* fix 4.7.0 script
2020-06-16 21:26:04 -03:00

42 lines
997 B
PHP
Executable File

<?php
use RedBeanPHP\Facade as RedBean;
/**
* @api {post} /system/installation-done Installation done
* @apiVersion 4.7.0
*
* @apiName Installation done
*
* @apiGroup System
*
* @apiDescription This path checks if the installation is already done.
*
* @apiPermission any
*
* @apiSuccess {Boolean} data Indicates if the installation is already done.
*
*/
class InstallationDoneController extends Controller {
const PATH = '/installation-done';
const METHOD = 'POST';
public static function isInstallationDone() {
return RedBean::testConnection() && !Setting::isTableEmpty() && !Staff::isTableEmpty();
}
public function validations() {
return [
'permission' => 'any',
'requestData' => []
];
}
public function handler() {
if(InstallationDoneController::isInstallationDone()) {
Response::respondSuccess(1);
} else {
Response::respondSuccess(0);
}
}
}