opensupports/server/controllers/system/installation-done.php
Guillermo Giuliana 791e0969e9
add script and change 4.7.0 to 4.8.0 (#848)
* add script and change 4.7.0 to 4.8

* change end of line 4.8.0 script

* Delete main.py
2020-07-22 07:32:18 -03:00

42 lines
997 B
PHP
Executable File

<?php
use RedBeanPHP\Facade as RedBean;
/**
* @api {post} /system/installation-done Installation done
* @apiVersion 4.8.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);
}
}
}