File tree Expand file tree Collapse file tree 6 files changed +27
-17
lines changed
Expand file tree Collapse file tree 6 files changed +27
-17
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,11 @@ All notable changes to this project will be documented in this file.
66The format is based on [ Keep a Changelog] ( http://keepachangelog.com/ )
77and 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
Original file line number Diff line number Diff line change 1616 },
1717 "require" : {
1818 "php" : " >=7.0.0" ,
19- "linna/framework" : " ^v0.18 "
19+ "linna/framework" : " ^v0.19 "
2020 }
2121}
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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];
Original file line number Diff line number Diff line change 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];
Original file line number Diff line number Diff line change 1111declare (strict_types=1 );
1212
1313use Linna \Autoloader ;
14- use Linna \DI \Resolver ;
14+ use Linna \DI \Container ;
1515use Linna \Http \Router ;
1616use Linna \Mvc \FrontController ;
1717use Linna \Session \Session ;
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.
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.
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.
You can’t perform that action at this time.
0 commit comments