From 587d46c2cb6a6f53b733f5010ea3e4c0b754933e Mon Sep 17 00:00:00 2001 From: Turan Karatug Date: Wed, 17 Jul 2019 16:16:29 +0300 Subject: [PATCH] v2.3.1 updates --- System/Kernel/Constants.php | 2 +- System/Libs/Database/DB.php | 7 ++++--- System/Libs/Http/Request.php | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/System/Kernel/Constants.php b/System/Kernel/Constants.php index 538efa2..00af489 100644 --- a/System/Kernel/Constants.php +++ b/System/Kernel/Constants.php @@ -42,7 +42,7 @@ define('ENV', 'development'); // Framework Version -define('VERSION', '2.3.0'); +define('VERSION', '2.3.1'); // Default Timezone define('TIMEZONE', 'Europe/Istanbul'); diff --git a/System/Libs/Database/DB.php b/System/Libs/Database/DB.php index b5daafb..0118847 100644 --- a/System/Libs/Database/DB.php +++ b/System/Libs/Database/DB.php @@ -79,9 +79,7 @@ class DB */ public function __construct() { - // Getting db config items - $this->config = config('database.' . $this->con); - + // Connect $this->connect(); } @@ -108,6 +106,9 @@ public function connection($connection) */ public function connect() { + // Getting db config items + $this->config = config('database.' . $this->con); + $this->config['db_driver'] = ($this->config['db_driver']) ? $this->config['db_driver'] : 'mysql'; $this->config['db_host'] = ($this->config['db_host']) ? $this->config['db_host'] : 'localhost'; $this->config['db_charset'] = ($this->config['db_charset']) ? $this->config['db_charset'] : 'utf8'; diff --git a/System/Libs/Http/Request.php b/System/Libs/Http/Request.php index 9333506..1b20f32 100644 --- a/System/Libs/Http/Request.php +++ b/System/Libs/Http/Request.php @@ -308,11 +308,11 @@ public function segments() * Get specified segment from URL * * @param int $index - * @return string + * @return string|null */ public function getSegment($index) { - return $this->segments()[$index]; + return isset($this->segments()[$index]) ? $this->segments()[$index] : null; } /**