Skip to content

Commit

Permalink
Merge pull request #13 from linna/v0.9.0-release
Browse files Browse the repository at this point in the history
v0.9.0 release
  • Loading branch information
s3b4stian authored Jun 24, 2017
2 parents 74d8be0 + 7a23c6c commit e563866
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 17 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [v0.9.0](https://github.com/s3b4stian/linna-app/compare/v0.8.0...v0.9.0) - 2017-06-24

### Changed
* require [linna-framework v0.19.0](https://github.com/s3b4stian/linna-framework/releases/tag/v0.19.0)

## [v0.8.0](https://github.com/s3b4stian/linna-app/compare/v0.7.0...v0.8.0) - 2017-06-01

### Removed
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
},
"require": {
"php": ">=7.0.0",
"linna/framework": "^v0.18"
"linna/framework": "^v0.19"
}
}
1 change: 1 addition & 0 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
],

'session' => [
'name' => 'linna_session',
'expire' => 1800,
'cookieDomain' => URL_DOMAIN, //do not change here
'cookiePath' => '/app', //equal to urlSubFolder
Expand Down
4 changes: 2 additions & 2 deletions config/injections.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
* @license http://opensource.org/licenses/MIT MIT License
*/
$injectionsRules = [
'\Linna\Storage\PdoStorage' => [
Linna\Storage\PdoStorage::class => [
0 => $options['pdo_mysql'],
],
'\Linna\Auth\Password' => [
Linna\Auth\Password::class => [
0 => $options['password'],
],
];
12 changes: 6 additions & 6 deletions config/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@
'name' => 'Home',
'method' => 'GET',
'url' => '/',
'model' => 'HomeModel',
'view' => 'HomeView',
'controller' => 'HomeController',
'model' => App\Models\HomeModel::class,
'view' => App\Views\HomeView::class,
'controller' => App\Controllers\HomeController::class,
'action' => '',
],
[
'name' => 'E404',
'method' => 'GET',
'url' => '/error',
'model' => 'E404Model',
'view' => 'E404View',
'controller' => 'E404Controller',
'model' => App\Models\E404Model::class,
'view' => App\Views\E404View::class,
'controller' => App\Controllers\E404Controller::class,
'action' => '',
],
];
20 changes: 12 additions & 8 deletions public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
declare(strict_types=1);

use Linna\Autoloader;
use Linna\DI\Resolver;
use Linna\DI\Container;
use Linna\Http\Router;
use Linna\Mvc\FrontController;
use Linna\Session\Session;
Expand Down Expand Up @@ -75,9 +75,9 @@
* Dependency Injection Section.
*/

//create dipendency injection resolver
$resolver = new Resolver();
$resolver->rules($injectionsRules);
//create dipendency injection container
$container = new Container();
$container->setRules($injectionsRules);

/**
* Session section.
Expand All @@ -86,11 +86,15 @@
//create session object
$session = new Session($options['session']);

//select custom session handler
//$handler = $container->resolve(Linna\Session\MysqlPdoSessionHandler::class);
//$session->setSessionHandler($handler);

//start session
$session->start();

//store session instance
$resolver->cache('\Linna\Session\Session', $session);
$container->set(Linna\Session\Session::class, $session);

/**
* Router Section.
Expand All @@ -106,13 +110,13 @@
$route = $router->getRoute()->toArray();

//resolve model
$model = $resolver->resolve('\App\Models\\'.$route['model']);
$model = $container->resolve($route['model']);

//resolve view
$view = $resolver->resolve('\App\Views\\'.$route['view']);
$view = $container->resolve($route['view']);

//resolve controller
$controller = $resolver->resolve('\App\Controllers\\'.$route['controller']);
$controller = $container->resolve($route['controller']);

/**
* Front Controller section.
Expand Down

0 comments on commit e563866

Please sign in to comment.