From 46f6c1dda7b977d6c14040a3c8181b01a97aed87 Mon Sep 17 00:00:00 2001 From: Martin-4Spaces Date: Wed, 21 Aug 2019 08:00:42 +0200 Subject: [PATCH] CI4 Issue https://github.com/codeigniter4/CodeIgniter4/issues/2158 --- Hooks.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Hooks.php b/Hooks.php index 4548c99..6052aa3 100644 --- a/Hooks.php +++ b/Hooks.php @@ -76,16 +76,16 @@ public static function preSystem() { */ self::$config = Config::get('RestExtension'); - /* - * Setup Database connection - */ - self::$database = Database::connect(self::$config->databaseGroupName ?? 'default'); - /* * Api Routing */ if(self::$config) { + /* + * Setup Database connection + */ + self::$database = Database::connect(self::$config->databaseGroupName ?? 'default'); + $routes = Services::routes(true); if(self::$config->enableApiRouting && self::$database->tableExists('api_routes')) {