2017-03-15 06:17:16 +01:00
|
|
|
<?php
|
|
|
|
use RedBeanPHP\Facade as RedBean;
|
|
|
|
|
2017-05-12 06:58:40 +02:00
|
|
|
/**
|
|
|
|
* @api {post} /system/installation-done Installation done
|
2019-03-06 16:47:24 +01:00
|
|
|
* @apiVersion 4.4.0
|
2017-05-12 06:58:40 +02:00
|
|
|
*
|
|
|
|
* @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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2017-03-15 06:17:16 +01:00
|
|
|
class InstallationDoneController extends Controller {
|
|
|
|
const PATH = '/installation-done';
|
|
|
|
const METHOD = 'POST';
|
|
|
|
|
2017-03-29 23:46:26 +02:00
|
|
|
public static function isInstallationDone() {
|
|
|
|
return RedBean::testConnection() && !Setting::isTableEmpty() && !Staff::isTableEmpty();
|
|
|
|
}
|
|
|
|
|
2017-03-15 06:17:16 +01:00
|
|
|
public function validations() {
|
|
|
|
return [
|
|
|
|
'permission' => 'any',
|
|
|
|
'requestData' => []
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function handler() {
|
2017-03-29 23:46:26 +02:00
|
|
|
if(InstallationDoneController::isInstallationDone()) {
|
2017-03-15 06:17:16 +01:00
|
|
|
Response::respondSuccess(1);
|
|
|
|
} else {
|
|
|
|
Response::respondSuccess(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|