Skip to content

Commit

Permalink
Revert "[10.x] Set container instance on session manager (#46621)" (#…
Browse files Browse the repository at this point in the history
…46691)

This reverts commit ae8ee69.
  • Loading branch information
taylorotwell authored Apr 4, 2023
1 parent a9c6b58 commit dc76856
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions src/Illuminate/Session/SessionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected function createNullDriver()
protected function createArrayDriver()
{
return $this->buildSession(new ArraySessionHandler(
$this->container['config']->get('session.lifetime')
$this->config->get('session.lifetime')
));
}

Expand All @@ -51,8 +51,8 @@ protected function createCookieDriver()
{
return $this->buildSession(new CookieSessionHandler(
$this->container->make('cookie'),
$this->container['config']->get('session.lifetime'),
$this->container['config']->get('session.expire_on_close')
$this->config->get('session.lifetime'),
$this->config->get('session.expire_on_close')
));
}

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

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

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

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

return $this->buildSession(new DatabaseSessionHandler(
$this->getDatabaseConnection(), $table, $lifetime, $this->container
Expand All @@ -103,7 +103,7 @@ protected function createDatabaseDriver()
*/
protected function getDatabaseConnection()
{
$connection = $this->container['config']->get('session.connection');
$connection = $this->config->get('session.connection');

return $this->container->make('db')->connection($connection);
}
Expand Down Expand Up @@ -138,7 +138,7 @@ protected function createRedisDriver()
$handler = $this->createCacheHandler('redis');

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

return $this->buildSession($handler);
Expand Down Expand Up @@ -173,11 +173,11 @@ protected function createCacheBased($driver)
*/
protected function createCacheHandler($driver)
{
$store = $this->container['config']->get('session.store') ?: $driver;
$store = $this->config->get('session.store') ?: $driver;

return new CacheBasedSessionHandler(
clone $this->container->make('cache')->store($store),
$this->container['config']->get('session.lifetime')
$this->config->get('session.lifetime')
);
}

Expand All @@ -189,13 +189,13 @@ protected function createCacheHandler($driver)
*/
protected function buildSession($handler)
{
return $this->container['config']->get('session.encrypt')
return $this->config->get('session.encrypt')
? $this->buildEncryptedSession($handler)
: new Store(
$this->container['config']->get('session.cookie'),
$this->config->get('session.cookie'),
$handler,
$id = null,
$this->container['config']->get('session.serialization', 'php')
$this->config->get('session.serialization', 'php')
);
}

Expand All @@ -208,11 +208,11 @@ protected function buildSession($handler)
protected function buildEncryptedSession($handler)
{
return new EncryptedStore(
$this->container['config']->get('session.cookie'),
$this->config->get('session.cookie'),
$handler,
$this->container['encrypter'],
$id = null,
$this->container['config']->get('session.serialization', 'php'),
$this->config->get('session.serialization', 'php'),
);
}

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

/**
Expand All @@ -233,7 +233,7 @@ public function shouldBlock()
*/
public function blockDriver()
{
return $this->container['config']->get('session.block_store');
return $this->config->get('session.block_store');
}

/**
Expand All @@ -243,7 +243,7 @@ public function blockDriver()
*/
public function getSessionConfig()
{
return $this->container['config']->get('session');
return $this->config->get('session');
}

/**
Expand All @@ -253,7 +253,7 @@ public function getSessionConfig()
*/
public function getDefaultDriver()
{
return $this->container['config']->get('session.driver');
return $this->config->get('session.driver');
}

/**
Expand All @@ -264,6 +264,6 @@ public function getDefaultDriver()
*/
public function setDefaultDriver($name)
{
$this->container['config']->set('session.driver', $name);
$this->config->set('session.driver', $name);
}
}

0 comments on commit dc76856

Please sign in to comment.