8000 [10.x] Set container instance on session manager (#46621) · tegos/laravel-framework@ae8ee69 · GitHub
[go: up one dir, main page]

Skip to content

Commit ae8ee69

Browse files
[10.x] Set container instance on session manager (laravel#46621)
* set container instance on session manager * formatting --------- Co-authored-by: Taylor Otwell <taylor@laravel.com>
1 parent 3bdb47c commit ae8ee69

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

src/Illuminate/Session/SessionManager.php

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ protected function createNullDriver()
3838
protected function createArrayDriver()
3939
{
4040
return $this->buildSession(new ArraySessionHandler(
41-
$this->config->get('session.lifetime')
41+
$this->container['config']->get('session.lifetime')
4242
));
4343
}
4444

@@ -51,8 +51,8 @@ protected function createCookieDriver()
5151
{
5252
return $this->buildSession(new CookieSessionHandler(
5353
$this->container->make('cookie'),
54-
$this->config->get('session.lifetime'),
55-
$this->config->get('session.expire_on_close')
54+
$this->container['config']->get('session.lifetime'),
55+
$this->container['config']->get('session.expire_on_close')
5656
));
5757
}
5858

@@ -73,10 +73,10 @@ protected function createFileDriver()
7373
*/
7474
protected function createNativeDriver()
7575
{
76-
$lifetime = $this->config->get('session.lifetime');
76+
$lifetime = $this->container['config']->get('session.lifetime');
7777

7878
return $this->buildSession(new FileSessionHandler(
79-
$this->container->make('files'), $this->config->get('session.files'), $lifetime
79+
$this->container->make('files'), $this->container['config']->get('session.files'), $lifetime
8080
));
8181
}
8282

@@ -87,9 +87,9 @@ protected function createNativeDriver()
8787
*/
8888
protected function createDatabaseDriver()
8989
{
90-
$table = $this->config->get('session.table');
90+
$table = $this->container['config']->get('session.table');
9191

92-
$lifetime = $this->config->get('session.lifetime');
92+
$lifetime = $this->container['config']->get('session.lifetime');
9393

9494
return $this->buildSession(new DatabaseSessionHandler(
9595
$this->getDatabaseConnection(), $table, $lifetime, $this->container
@@ -103,7 +103,7 @@ protected function createDatabaseDriver()
103103
*/
104104
protected function getDatabaseConnection()
105105
{
106-
$connection = $this->config->get('session.connection');
106+
$connection = $this->container['config']->get('session.connection');
107107

108108
return $this->container->make('db')->connection($connection);
109109
}
@@ -138,7 +138,7 @@ protected function createRedisDriver()
138138
$handler = $this->createCacheHandler('redis');
139139

140140
$handler->getCache()->getStore()->setConnection(
141-
$this->config->get('session.connection')
141+
$this->container['config']->get('session.connection')
142142
);
143143

144144
return $this->buildSession($handler);
@@ -173,11 +173,11 @@ protected function createCacheBased($driver)
173173
*/
174174
protected function createCacheHandler($driver)
175175
{
176-
$store = $this->config->get('session.store') ?: $driver;
176+
$store = $this->container['config']->get('session.store') ?: $driver;
177177

178178
return new CacheBasedSessionHandler(
179179
clone $this->container->make('cache')->store($store),
180-
$this->config->get('session.lifetime')
180+
$this->container['config']->get('session.lifetime')
181181
);
182182
}
183183

@@ -189,13 +189,13 @@ protected function createCacheHandler($driver)
189189
*/
190190
protected function buildSession($handler)
191191
{
192-
return $this->config->get('session.encrypt')
192+
return $this->container['config']->get('session.encrypt')
193193
? $this->buildEncryptedSession($handler)
194194
: new Store(
195-
$this->config->get('session.cookie'),
195+
$this->container['config']->get('session.cookie'),
196196
$handler,
197197
$id = null,
198-
$this->config->get('session.serialization', 'php')
198+
$this->container['config']->get('session.serialization', 'php')
199199
);
200200
}
201201

@@ -208,11 +208,11 @@ protected function buildSession($handler)
208208
protected function buildEncryptedSession($handler)
209209
{
210210
return new EncryptedStore(
211-
$this->config->get('session.cookie'),
211+
$this->container['config']->get('session.cookie'),
212212
$handler,
213213
$this->container['encrypter'],
214214
$id = null,
215-
$this->config->get('session.serialization', 'php'),
215+
$this->container['config']->get('session.serialization', 'php'),
216216
);
217217
}
218218

@@ -223,7 +223,7 @@ protected function buildEncryptedSession($handler)
223223
*/
224224
public function shouldBlock()
225225
{
226-
return $this->config->get('session.block', false);
226+
return $this->container['config']->get('session.block', false);
227227
}
228228

229229
/**
@@ -233,7 +233,7 @@ public function shouldBlock()
233233
*/
234234
public function blockDriver()
235235
{
236-
return $this->config->get('session.block_store');
236+
return $this->container['config']->get('session.block_store');
237237
}
238238

239239
/**
@@ -243,7 +243,7 @@ public function blockDriver()
243243
*/
244244
public function getSessionConfig()
245245
{
246-
return $this->config->get('session');
246+
return $this->container['config']->get('session');
247247
}
248248

249249
/**
@@ -253,7 +253,7 @@ public function getSessionConfig()
253253
*/
254254
public function getDefaultDriver()
255255
{
256-
return $this->config->get('session.driver');
256+
return $this->container['config']->get('session.driver');
257257
}
258258

259259
/**
@@ -264,6 +264,6 @@ public function getDefaultDriver()
264264
*/
265265
public function setDefaultDriver($name)
266266
{
267-
$this->config->set('session.driver', $name);
267+
$this->container['config']->set('session.driver', $name);
268268
}
269269
}

0 commit comments

Comments
 (0)
0