2008-09-12 08:51:56 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
#namespace Doctrine::DBAL::Driver::PDOOracle;
|
|
|
|
|
|
|
|
#use Doctrine::DBAL::Driver;
|
|
|
|
|
|
|
|
class Doctrine_DBAL_Driver_PDOSqlite_Driver implements Doctrine_DBAL_Driver
|
|
|
|
{
|
|
|
|
|
|
|
|
public function connect(array $params, $username = null, $password = null, array $driverOptions = array())
|
|
|
|
{
|
2008-09-12 17:25:38 +00:00
|
|
|
return new Doctrine_DBAL_Driver_PDOConnection(
|
|
|
|
$this->_constructPdoDsn($params),
|
|
|
|
$username,
|
|
|
|
$password,
|
|
|
|
$driverOptions);
|
2008-09-12 08:51:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructs the Sqlite PDO DSN.
|
|
|
|
*
|
|
|
|
* @return string The DSN.
|
|
|
|
* @override
|
|
|
|
*/
|
|
|
|
protected function _constructPdoDsn(array $params)
|
|
|
|
{
|
|
|
|
$dsn = 'sqlite:';
|
|
|
|
if (isset($params['path'])) {
|
|
|
|
$dsn .= $params['path'];
|
|
|
|
} else if (isset($params['memory'])) {
|
|
|
|
$dsn .= ':memory:';
|
|
|
|
}
|
|
|
|
|
|
|
|
return $dsn;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getDatabasePlatform()
|
|
|
|
{
|
2008-09-12 17:25:38 +00:00
|
|
|
return new Doctrine_DBAL_Platforms_SqlitePlatform();
|
2008-09-12 08:51:56 +00:00
|
|
|
}
|
|
|
|
|
2008-09-12 17:25:38 +00:00
|
|
|
public function getSchemaManager(Doctrine_DBAL_Connection $conn)
|
2008-09-12 08:51:56 +00:00
|
|
|
{
|
2008-09-12 17:25:38 +00:00
|
|
|
return new Doctrine_DBAL_Schema_SqliteSchemaManager($conn);
|
2008-09-12 08:51:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|