Skip to content

Commit e563866

Browse files
authored
Merge pull request #13 from linna/v0.9.0-release
v0.9.0 release
2 parents 74d8be0 + 7a23c6c commit e563866

File tree

6 files changed

+27
-17
lines changed

6 files changed

+27
-17
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ All notable changes to this project will be documented in this file.
66
The format is based on [Keep a Changelog](http://keepachangelog.com/)
77
and this project adheres to [Semantic Versioning](http://semver.org/).
88

9+
## [v0.9.0](https://github.com/s3b4stian/linna-app/compare/v0.8.0...v0.9.0) - 2017-06-24
10+
11+
### Changed
12+
* require [linna-framework v0.19.0](https://github.com/s3b4stian/linna-framework/releases/tag/v0.19.0)
13+
914
## [v0.8.0](https://github.com/s3b4stian/linna-app/compare/v0.7.0...v0.8.0) - 2017-06-01
1015

1116
### Removed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
},
1717
"require": {
1818
"php": ">=7.0.0",
19-
"linna/framework": "^v0.18"
19+
"linna/framework": "^v0.19"
2020
}
2121
}

config/config.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
],
1818

1919
'session' => [
20+
'name' => 'linna_session',
2021
'expire' => 1800,
2122
'cookieDomain' => URL_DOMAIN, //do not change here
2223
'cookiePath' => '/app', //equal to urlSubFolder

config/injections.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
* @license http://opensource.org/licenses/MIT MIT License
1010
*/
1111
$injectionsRules = [
12-
'\Linna\Storage\PdoStorage' => [
12+
Linna\Storage\PdoStorage::class => [
1313
0 => $options['pdo_mysql'],
1414
],
15-
'\Linna\Auth\Password' => [
15+
Linna\Auth\Password::class => [
1616
0 => $options['password'],
1717
],
1818
];

config/routes.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@
1313
'name' => 'Home',
1414
'method' => 'GET',
1515
'url' => '/',
16-
'model' => 'HomeModel',
17-
'view' => 'HomeView',
18-
'controller' => 'HomeController',
16+
'model' => App\Models\HomeModel::class,
17+
'view' => App\Views\HomeView::class,
18+
'controller' => App\Controllers\HomeController::class,
1919
'action' => '',
2020
],
2121
[
2222
'name' => 'E404',
2323
'method' => 'GET',
2424
'url' => '/error',
25-
'model' => 'E404Model',
26-
'view' => 'E404View',
27-
'controller' => 'E404Controller',
25+
'model' => App\Models\E404Model::class,
26+
'view' => App\Views\E404View::class,
27+
'controller' => App\Controllers\E404Controller::class,
2828
'action' => '',
2929
],
3030
];

public/index.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
declare(strict_types=1);
1212

1313
use Linna\Autoloader;
14-
use Linna\DI\Resolver;
14+
use Linna\DI\Container;
1515
use Linna\Http\Router;
1616
use Linna\Mvc\FrontController;
1717
use Linna\Session\Session;
@@ -75,9 +75,9 @@
7575
* Dependency Injection Section.
7676
*/
7777

78-
//create dipendency injection resolver
79-
$resolver = new Resolver();
80-
$resolver->rules($injectionsRules);
78+
//create dipendency injection container
79+
$container = new Container();
80+
$container->setRules($injectionsRules);
8181

8282
/**
8383
* Session section.
@@ -86,11 +86,15 @@
8686
//create session object
8787
$session = new Session($options['session']);
8888

89+
//select custom session handler
90+
//$handler = $container->resolve(Linna\Session\MysqlPdoSessionHandler::class);
91+
//$session->setSessionHandler($handler);
92+
8993
//start session
9094
$session->start();
9195

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

9599
/**
96100
* Router Section.
@@ -106,13 +110,13 @@
106110
$route = $router->getRoute()->toArray();
107111

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

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

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

117121
/**
118122
* Front Controller section.

0 commit comments

Comments
 (0)