Commit 6becbaba by Taylor Otwell

more session refactoring.

parent ae5393f5
...@@ -47,12 +47,12 @@ return array( ...@@ -47,12 +47,12 @@ return array(
'mysql' => function($config) 'mysql' => function($config)
{ {
return new PDO('mysql:host=localhost;dbname=database', 'username', 'password', $config['options']); return new PDO('mysql:host=localhost;dbname=database', 'root', 'password', $config['options']);
}, },
'pgsql' => function($config) 'pgsql' => function($config)
{ {
return new PDO('pgsql:host=localhost;dbname=database', 'username', 'password', $config['options']); return new PDO('pgsql:host=localhost;dbname=database', 'root', 'password', $config['options']);
}, },
), ),
......
...@@ -211,6 +211,19 @@ abstract class Driver { ...@@ -211,6 +211,19 @@ abstract class Driver {
} }
/** /**
* Readdress the session data by performing a string replacement on the keys.
*
* @param string $search
* @param string $replace
* @param array $keys
* @return void
*/
private function readdress($search, $replace, $keys)
{
$this->session['data'] = array_combine(str_replace($search, $replace, $keys), array_values($this->session['data']));
}
/**
* Close the session and store the session payload in persistant storage. * Close the session and store the session payload in persistant storage.
* *
* @param Laravel\Input $input * @param Laravel\Input $input
...@@ -257,19 +270,6 @@ abstract class Driver { ...@@ -257,19 +270,6 @@ abstract class Driver {
} }
/** /**
* Readdress the session data by performing a string replacement on the keys.
*
* @param string $search
* @param string $replace
* @param array $keys
* @return void
*/
private function readdress($search, $replace, $keys)
{
$this->session['data'] = array_combine(str_replace($search, $replace, $keys), array_values($this->session['data']));
}
/**
* Write the session cookie. * Write the session cookie.
* *
* @param Laravel\Cookie $cookie * @param Laravel\Cookie $cookie
......
...@@ -34,12 +34,12 @@ class Manager { ...@@ -34,12 +34,12 @@ class Manager {
*/ */
public function driver($driver) public function driver($driver)
{ {
if ( ! $this->container->registered('laravel.session.'.$driver)) if ($this->container->registered('laravel.session.'.$driver))
{ {
throw new \Exception("Session driver [$driver] is not supported."); return $this->container->resolve('laravel.session.'.$driver);
} }
return $this->container->resolve('laravel.session.'.$driver); throw new \Exception("Session driver [$driver] is not supported.");
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment