Skip to content

Commit 9542b75

Browse files
committed
playing with session adn cache.
1 parent e224497 commit 9542b75

4 files changed

Lines changed: 84 additions & 2 deletions

File tree

app/bulbs/production.php

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,73 @@
1111
|
1212
*/
1313

14-
$app['debug'] = false;
14+
$app['debug'] = false;
15+
16+
/*
17+
|--------------------------------------------------------------------------
18+
| Register The Illuminate Filesystem Manager
19+
|--------------------------------------------------------------------------
20+
|
21+
| The Illuminate file system provides a nice abstraction over the file
22+
| system, which makes testing code that gets or puts files on disk
23+
| much easier, since the file systems can easily be mocked out.
24+
|
25+
*/
26+
27+
$app['files'] = $app->share(function()
28+
{
29+
return new Illuminate\Filesystem;
30+
});
31+
32+
/*
33+
|--------------------------------------------------------------------------
34+
| Register The Illuminate Event Dispatcher
35+
|--------------------------------------------------------------------------
36+
|
37+
| The Illuminate event dispatcher provides a simpler, yet powerful way
38+
| to build de-coupled systems using events, including queueing and
39+
| flushing events. We'll go ahead and register a shared object.
40+
|
41+
*/
42+
43+
$app['events'] = $app->share(function()
44+
{
45+
return new Illuminate\Events\Dispatcher;
46+
});
47+
48+
/*
49+
|--------------------------------------------------------------------------
50+
| Register The Illuminate Encrypter
51+
|--------------------------------------------------------------------------
52+
|
53+
| The Illuminate encrypter service provides a nice, convenient wrapper
54+
| around the mcrypt encryption library. By default, strong AES-256
55+
| encryption is provided out of the box. Just be sure to change
56+
| your application key, as strong encryption depends on it!
57+
|
58+
*/
59+
60+
$app['encrypter.key'] = 'YourSecretKey';
61+
62+
$app['encrypter'] = $app->share(function() use ($app)
63+
{
64+
$key = $app['encrypter.key'];
65+
66+
return new Illuminate\Encrypter(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC, $key);
67+
});
68+
69+
/*
70+
|--------------------------------------------------------------------------
71+
| Register The Illuminate Session
72+
|--------------------------------------------------------------------------
73+
|
74+
| The Illuminate session library provides a variety of simple, clean
75+
| session drivers for use by your application. By default, we'll
76+
| use the light Cookie driver for convenience and simplicity.
77+
|
78+
*/
79+
80+
$app['session'] = $app->share(function() use ($app)
81+
{
82+
return new Illuminate\Session\CookieStore($app['encrypter']);
83+
});

app/routes.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@
1212
|
1313
*/
1414

15+
$app->before(function($request) use ($app)
16+
{
17+
$app['session']->start($request);
18+
});
19+
20+
$app->after(function($request, $response) use ($app)
21+
{
22+
$app['session']->finish($response);
23+
});
24+
1525
$app->get('/', function() use ($app)
1626
{
1727
return 'Hello World!';

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
22
"require": {
33
"illuminate/cache": ">=1.0.0",
4+
"illuminate/encryption": ">=1.0.0",
5+
"illuminate/events": ">=1.0.0",
46
"illuminate/filesystem": ">=1.0.0",
5-
"illuminate/foundation": ">=1.0.0"
7+
"illuminate/foundation": ">=1.0.0",
8+
"illuminate/session": ">=1.0.0"
69
}
710
}

favicon.ico

Whitespace-only changes.

0 commit comments

Comments
 (0)