Skip to content

Commit

Permalink
✨ Add action to check install status
Browse files Browse the repository at this point in the history
Signed-off-by: mathieu.brunot <[email protected]>
  • Loading branch information
madmath03 authored and mriedmann committed Sep 10, 2020
1 parent 4f16a5b commit 79e7d46
Showing 1 changed file with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@
*/
class InstallController extends Controller
{

/**
* @inheritdoc
*/
public $defaultAction = 'status';

/**
* Finished install without input. Useful for testing.
*/
Expand All @@ -44,7 +50,7 @@ public function actionAuto()

return ExitCode::OK;
}

/**
* Tries to open a connection to given db.
* On success: Writes given settings to config-file and reloads it.
Expand Down Expand Up @@ -137,6 +143,23 @@ public function actionSetBaseUrl($base_url){
return ExitCode::OK;
}

/**
* Checks install status
*/
public function actionStatus(){
$config = DynamicConfig::load();

if (!isset($config['params']['databaseInstalled']) || empty($config['params']['databaseInstalled'])) {
$this->stdout("HumHub database is not installed", Console::FG_YELLOW);
} elseif (!isset($config['params']['installed']) || empty($config['params']['installed'])) {
$this->stdout("HumHub is not installed", Console::FG_YELLOW);
} else {
$this->stdout("HumHub is installed");
}

return ExitCode::OK;
}

/**
* Sets application in installed state (disables installer)
*/
Expand Down

0 comments on commit 79e7d46

Please sign in to comment.