Files
core/f_install/j_install_status.php
T
2020-03-28 19:48:09 +09:00

38 lines
667 B
PHP

<?php
namespace sammo;
require(__DIR__.'/../vendor/autoload.php');
if(!class_exists('\\sammo\\RootDB')){
Json::die([
'step'=>'config'
]);
}
$rootDB = RootDB::db();
$rootDB->throw_exception_on_nonsql_error = false;
$rootDB->nonsql_error_handler = function($params){
Json::die([
'step'=>'conn_fail'
]);
};
$rootDB->error_handler = function($params){
Json::die([
'step'=>'sql_fail'
]);
};
$memberCnt = $rootDB->queryFirstField('SELECT count(`NO`) from member');
if($memberCnt == 0){
Json::die([
'step'=>'admin',
'globalSalt'=>RootDB::getGlobalSalt()
]);
}
Json::die([
'step'=>'done'
]);