diff --git a/app/Controllers/HomeController.php b/app/Controllers/HomeController.php index 7031b741ae3492b68da17e59370ca0b195021cd9..a2d4f87296c6feb526729ed9a54f63db24f4df2d 100644 --- a/app/Controllers/HomeController.php +++ b/app/Controllers/HomeController.php @@ -18,10 +18,9 @@ class HomeController extends BaseController { public function index(): RedirectResponse | string { - $connections = \CodeIgniter\Database\Config::getConnections(); $db = db_connect(); - if ($connections === [] || ! $db->tableExists('podcasts')) { - // Cannot connect to the database or cannot find the podcasts table + if ($db->getDatabase() === '' || ! $db->tableExists('podcasts')) { + // Database connection has not been set or could not find the podcasts table // Redirecting to install page because it is likely that Castopod Host has not been installed yet. // NB: as base_url wouldn't have been defined here, redirect to install wizard manually $route = Services::routes()->reverseRoute('install');