From 4a10894cfe9d4b2f4fff1eb4cef72c34864e9b24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Turan=20Karatu=C4=9F?= Date: Tue, 26 Apr 2022 11:57:10 +0300 Subject: [PATCH] Bugfix for make command --- CHANGELOG | 3 +++ System/Kernel/Constants.php | 2 +- System/Libs/Console/Console.php | 12 ++++++++---- index.php | 2 +- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 385c303..90e567b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +v2.4.1 + - [Düzeltme] Model ve Controller oluşturma komutlarındaki hata giderildi. + v2.4.0 - [Düzeltme] `Request` kütüphanesinde bulunan `getQueryString()` methodundaki hata giderildi. - [Yeni] `Request` kütüphanesine `makeQueryString()` methodu eklendi. diff --git a/System/Kernel/Constants.php b/System/Kernel/Constants.php index 00af489..26edd45 100644 --- a/System/Kernel/Constants.php +++ b/System/Kernel/Constants.php @@ -42,7 +42,7 @@ define('ENV', 'development'); // Framework Version -define('VERSION', '2.3.1'); +define('VERSION', '2.4.1'); // Default Timezone define('TIMEZONE', 'Europe/Istanbul'); diff --git a/System/Libs/Console/Console.php b/System/Libs/Console/Console.php index 2e0b0d6..75c7cb6 100644 --- a/System/Libs/Console/Console.php +++ b/System/Libs/Console/Console.php @@ -180,8 +180,10 @@ private function createController($controller) $location = 'App/Controllers/' . $controller; } - if (file_exists($location)) { - return $this->getColoredString('Controller zaten mevcut:', 'red') . "\t" . $this->getColoredString($location); + $file = "{$location}/{$class}.php"; + + if (file_exists($file)) { + return $this->getColoredString('Controller zaten mevcut:', 'red') . "\t" . $this->getColoredString($file); } else { $this->makeDir($location); $location = $location . '/' . $class . '.php'; @@ -216,8 +218,10 @@ private function createModel($model) $location = 'App/Models'; } - if (file_exists($location)) - return $this->getColoredString('Model zaten mevcut:', 'red') . "\t" . $this->getColoredString($location); + $file = "{$location}/{$class}.php"; + + if (file_exists($file)) + return $this->getColoredString('Model zaten mevcut:', 'red') . "\t" . $this->getColoredString($file); $this->makeDir($location); $location = $location . '/' . $class . '.php'; diff --git a/index.php b/index.php index 8029d6f..6689a34 100644 --- a/index.php +++ b/index.php @@ -6,7 +6,7 @@ * Author : Turan Karatuğ * Web : http://www.titanphp.com * Docs : http://kilavuz.titanphp.com - * Version : 2.2.4 + * Version : 2.4.1 * Github : http://github.com/tkaratug/titan2 * License : MIT *