continued ioc refactoring.

This commit is contained in:
Taylor Otwell
2011-08-26 21:42:04 -05:00
parent fb3a0df0dd
commit 1e49001dfc
44 changed files with 1388 additions and 1046 deletions

View File

@@ -1,6 +1,5 @@
<?php namespace Laravel\Session;
use Laravel\Config;
use Laravel\Database\Connection;
class Database extends Driver implements Sweeper {
@@ -12,14 +11,23 @@ class Database extends Driver implements Sweeper {
*/
private $connection;
/**
* The database table to which the sessions should be written.
*
* @var string
*/
private $table;
/**
* Create a new database session driver.
*
* @param Connection $connection
* @param string $table
* @return void
*/
public function __construct(Connection $connection)
public function __construct(Connection $connection, $table)
{
$this->table = $table;
$this->connection = $connection;
}
@@ -90,7 +98,7 @@ class Database extends Driver implements Sweeper {
*/
private function table()
{
return $this->connection->table(Config::get('session.table'));
return $this->connection->table($this->table);
}
}