Skip to content

Commit

Permalink
v2.0.5 release
Browse files Browse the repository at this point in the history
  • Loading branch information
tkaratug committed Oct 30, 2017
1 parent e08eec2 commit bcdc942
Show file tree
Hide file tree
Showing 7 changed files with 430 additions and 484 deletions.
22 changes: 10 additions & 12 deletions App/Config/Routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,16 @@
View::render('errors.404');
});

Route::get('/', 'Home@index', ['namespace' => 'Frontend']);

Route::group('/frontend', function(){

Route::get('/', 'Home@index', ['namespace' => 'Frontend']);
Route::get('/home', 'Home@index', ['namespace' => 'Frontend']);

Route::namespace('frontend')->group(function(){
Route::get('/', 'Home@index');
});

Route::group('/backend', function(){

Route::get('/', 'Dashboard@index', ['namespace' => 'Backend']);
Route::get('/dashboard', 'Dashboard@index', ['namespace' => 'Backend']);
Route::prefix('frontend')->namespacer('frontend')->group(function(){
Route::get('/', 'Home@index');
Route::get('/home', 'Home@index');
});

}, ['middleware' => ['Auth']]);
Route::prefix('backend')->namespacer('backend')->middleware(['auth'])->group(function(){
Route::get('/', 'Dashboard@index');
Route::get('/dashboard', 'Dashboard@index');
});
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v.2.0.5
- [Yeni] Router Kütüphanesi tamamen yenilendi. Domain tanımlama desteği eklendi.
- [Düzeltme] Import kütüphanesi içerisindeki yükleme hataları giderildi.

v2.0.4
- [Yeni] Console desteği eklendi.
- [Düzeltme] Validation kütüphanesindeki rules() ve bulkData() methodları iyileştirildi.
Expand Down
2 changes: 1 addition & 1 deletion System/Kernel/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
define('ENV', 'development');

// Framework Version
define('VERSION', '2.0.4');
define('VERSION', '2.0.5');

// Default Timezone
define('TIMEZONE', 'Europe/Istanbul');
16 changes: 8 additions & 8 deletions System/Kernel/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ public function view($file, $data = [])
*/
public function helper($file)
{
$filePath = APP_DIR . 'Helpers/' . $file . '.php';
$filePath = APP_DIR . 'Helpers/' . ucfirst($file) . '.php';

if (file_exists($filePath))
require_once $filePath;
else
throw new ExceptionHandler('Dosya bulunamadı.', '<b>Helper : </b>' . $file);
throw new ExceptionHandler('Dosya bulunamadı.', '<b>Helper : </b>' . ucfirst($file));

}

Expand All @@ -62,18 +62,18 @@ public function helper($file)
public static function model($file, $namespace = null)
{
if (is_null($namespace)) {
$filePath = MODEL_DIR . $file . '.php';
$class = 'App\\Models\\' . $file;
$filePath = MODEL_DIR . ucfirst($file) . '.php';
$class = 'App\\Models\\' . ucfirst($file);
} else {
$filePath = MODEL_DIR . ucfirst($namespace) . '/' . $file . '.php';
$class = 'App\\Models\\' . ucfirst($namespace) . '\\' . $file;
$filePath = MODEL_DIR . ucfirst($namespace) . '/' . ucfirst($file) . '.php';
$class = 'App\\Models\\' . ucfirst($namespace) . '\\' . ucfirst($file);
}

if (file_exists($filePath)) {
require_once $filePath;
return new $class;
} else
throw new ExceptionHandler('Dosya bulunamadı.', '<b>Model : </b>' . $file);
throw new ExceptionHandler('Dosya bulunamadı.', '<b>Model : </b>' . ucfirst($file));

}

Expand Down Expand Up @@ -104,7 +104,7 @@ public static function config($file)
if (file_exists(APP_DIR . 'Config/' . ucwords($file) . '.php'))
return require APP_DIR . 'Config/' . ucwords($file) . '.php';
else
throw new ExceptionHandler('Dosya bulunamadı.', '<b>Config : </b>' . APP_DIR . 'Config/' . $file . '.php');
throw new ExceptionHandler('Dosya bulunamadı.', '<b>Config : </b>' . APP_DIR . 'Config/' . ucfirst($file) . '.php');

}

Expand Down
25 changes: 0 additions & 25 deletions System/Libs/Console/Console.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ public function run($params)
} else {
return $this->getColoredString('Gecersiz komut. "' . $params[0] . '"', 'white', 'red');
}
} else if ($params[0] == 'routes') {
return $this->getRoutes();
} else {
return $this->getColoredString('Gecersiz komut. "' . $params[0] . '"', 'white', 'red');
}
Expand All @@ -114,8 +112,6 @@ private function help()
$this->getColoredString('[clear:logs]', 'light_blue') . "\t\t" . $this->getColoredString('/App/Storage/Logs dizinini temizlemek icin kullanilir.') . "\n" .
$this->getColoredString('[clear:session]', 'light_blue') . "\t\t" . $this->getColoredString('Tum session verisini temizlemek icin kullanilir.') . "\n\n" .

$this->getColoredString('[routes]', 'light_blue') . "\t\t" . $this->getColoredString('Tum rotalari listelemek icin kullanilir.') . "\n\n" .

$this->getColoredString('[-v]', 'light_blue') . "\t\t\t" . $this->getColoredString('Titan Web Framework versiyon bilgisini verir.') . "\n" .
$this->getColoredString('[-h]', 'light_blue') . "\t\t\t" . $this->getColoredString('Tum console komutlari ile ilgili bilgi verir.') . "\n\n" .
$this->getColoredString('// ========== [-] Titan Web Framework Console Komutlari ========== //', 'red');
Expand Down Expand Up @@ -346,27 +342,6 @@ private function clearSession()
return $this->getColoredString('Tum session verisi silindi.', 'light_blue');
}

/**
* Get Route List
*
* @return string
*/
private function getRoutes()
{
// Getting Routes
Import::config('routes');
$routes = Router::getRoutes();
$list = '';

foreach ($routes as $method => $paths) {
foreach ($paths as $key => $val) {
$list .= str_pad($method, 10) . str_pad($val['pattern'], 30) . str_pad($val['fn'], 10) . "\n";
}
}

return $list;
}

/**
* Returns colored string
* @param string $string
Expand Down
Loading

0 comments on commit bcdc942

Please sign in to comment.