Skip to content

Commit 234c308

Browse files
committed
Added session
1 parent 90bfdd4 commit 234c308

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"type": "library",
55
"require": {
66
"silex/silex": "~1.3",
7-
"statflo/php-di": ">=1.0 <2.0"
7+
"statflo/php-di": ">=1.1 <2.0"
88
},
99
"license": "COPYRIGHT",
1010
"authors": [

src/Statflo/HTTP/Main.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,31 @@ public function start(Application $app)
5151

5252
\Statflo\HTTP\Router::register($routes, $app);
5353
}
54+
55+
private function defineSession($bootstrap, array $configuration = [])
56+
{
57+
$session = [];
58+
59+
if (isset($configuration['session'])) {
60+
$session = [$configuration['session']];
61+
}
62+
63+
$bootstrap->define(
64+
'statflo.session',
65+
\Statflo\DI\DTO\Collection::class,
66+
$session
67+
);
68+
69+
$auth = [];
70+
71+
if (isset($configuration['auth'])) {
72+
$auth = [$configuration['auth']];
73+
}
74+
75+
$bootstrap->define(
76+
'statflo.auth',
77+
\Statflo\DI\DTO\Auth::class,
78+
$auth
79+
);
80+
}
5481
}

0 commit comments

Comments
 (0)