Skip to content

Commit

Permalink
[2.0] Another step towards finishing namespace refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
jwage committed Feb 20, 2009
1 parent 43b6791 commit d458197
Show file tree
Hide file tree
Showing 169 changed files with 460 additions and 1,009 deletions.
39 changes: 0 additions & 39 deletions lib/Doctrine/Common/Configurable.php

This file was deleted.

12 changes: 6 additions & 6 deletions lib/Doctrine/DBAL/Connection.php
Expand Up @@ -284,7 +284,7 @@ public function delete($tableName, array $identifier)
/**
* Updates table row(s) with specified data
*
* @throws Doctrine_Connection_Exception if something went wrong at the database level
* @throws Doctrine\DBAL\ConnectionException if something went wrong at the database level
* @param string $table The table to insert data into
* @param array $values An associateve array containing column-value pairs.
* @return mixed boolean false if empty value array was given,
Expand Down Expand Up @@ -509,7 +509,7 @@ public function select($query, $limit = 0, $offset = 0)
* @param string $query sql query
* @param array $params query parameters
*
* @return PDOStatement|Doctrine_Adapter_Statement
* @return PDOStatement
*/
public function execute($query, array $params = array())
{
Expand All @@ -536,7 +536,7 @@ public function execute($query, array $params = array())
* @param string $query sql query
* @param array $params query parameters
*
* @return PDOStatement|Doctrine_Adapter_Statement
* @return PDOStatement
* @todo Rename to executeUpdate().
*/
public function exec($query, array $params = array()) {
Expand All @@ -562,7 +562,7 @@ public function exec($query, array $params = array()) {
/**
* Wraps the given exception into a driver-specific exception and rethrows it.
*
* @throws Doctrine_Connection_Exception
* @throws Doctrine\DBAL\ConnectionException
*/
public function rethrowException(Exception $e, $invoker)
{
Expand Down Expand Up @@ -711,7 +711,7 @@ public function commit()
* eventlistener methods
*
* @param string $savepoint Name of a savepoint to rollback to.
* @throws Doctrine_Transaction_Exception If the rollback operation fails at database level.
* @throws Doctrine\DBAL\ConnectionException If the rollback operation fails at database level.
* @return boolean FALSE if rollback couldn't be performed, TRUE otherwise.
*/
public function rollback()
Expand Down Expand Up @@ -772,4 +772,4 @@ public function getSchemaManager()
}
return $this->_schemaManager;
}
}
}
7 changes: 3 additions & 4 deletions lib/Doctrine/DBAL/Driver.php
Expand Up @@ -20,21 +20,20 @@ interface Driver
* @return Doctrine::DBAL::Connection The database connection.
*/
public function connect(array $params, $username = null, $password = null, array $driverOptions = array());

/**
* Gets the DatabasePlatform instance that provides all the metadata about
* the platform this driver connects to.
*
* @return Doctrine::DBAL::DatabasePlatform The database platform.
*/
public function getDatabasePlatform();

/**
* Gets the SchemaManager that can be used to inspect and change the underlying
* database schema of the platform this driver connects to.
*
* @return Doctrine\DBAL\SchemaManager
*/
public function getSchemaManager(Connection $conn);
}

}
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Driver/PDOConnection.php
Expand Up @@ -19,4 +19,4 @@ public function __construct($dsn, $user = null, $password = null, array $options
$this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$this->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER);
}
}
}
9 changes: 4 additions & 5 deletions lib/Doctrine/DBAL/Driver/PDOMsSql/Connection.php
Expand Up @@ -7,7 +7,7 @@
*
* @since 2.0
*/
class Connection extends PDO implements \Doctrine\DBAL\Driver\Connection
class Connection extends PDO implements \Doctrine\DBAL\Driver\PDOConnection
{
/**
* Performs the rollback.
Expand All @@ -18,7 +18,7 @@ public function rollback()
{
$this->exec('ROLLBACK TRANSACTION');
}

/**
* Performs the commit.
*
Expand All @@ -28,7 +28,7 @@ public function commit()
{
$this->exec('COMMIT TRANSACTION');
}

/**
* Begins a database transaction.
*
Expand All @@ -38,5 +38,4 @@ public function beginTransaction()
{
$this->exec('BEGIN TRANSACTION');
}
}

}
26 changes: 12 additions & 14 deletions lib/Doctrine/DBAL/Driver/PDOMsSql/Driver.php
Expand Up @@ -4,16 +4,16 @@

class Driver implements \Doctrine\DBAL\Driver
{

public function connect(array $params, $username = null, $password = null, array $driverOptions = array())
{
return new Connection(
$this->_constructPdoDsn($params),
$username,
$password,
$driverOptions);
$this->_constructPdoDsn($params),
$username,
$password,
$driverOptions
);
}

/**
* Constructs the MySql PDO DSN.
*
Expand All @@ -25,16 +25,14 @@ private function _constructPdoDsn(array $params)
{
//TODO
}

public function getDatabasePlatform()
{
return new Doctrine_DatabasePlatform_MySqlPlatform();
return new \Doctrine\DBAL\Platforms\MsSqlPlatform();
}
public function getSchemaManager(Doctrine_Connection $conn)

public function getSchemaManager(\Doctrine\DBAL\Connection $conn)
{
return new Doctrine_Schema_MySqlSchemaManager($conn);
return new \Doctrine\DBAL\Schema\MsSqlSchemaManager($conn);
}

}

}
19 changes: 9 additions & 10 deletions lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php
Expand Up @@ -40,14 +40,15 @@ class Driver implements \Doctrine\DBAL\Driver
public function connect(array $params, $username = null, $password = null, array $driverOptions = array())
{
$conn = new \Doctrine\DBAL\Driver\PDOConnection(
$this->_constructPdoDsn($params),
$username,
$password,
$driverOptions);
$this->_constructPdoDsn($params),
$username,
$password,
$driverOptions
);
$conn->setAttribute(\PDO::ATTR_AUTOCOMMIT, false);
return $conn;
}

/**
* Constructs the MySql PDO DSN.
*
Expand All @@ -73,16 +74,14 @@ private function _constructPdoDsn(array $params)

return $dsn;
}

public function getDatabasePlatform()
{
return new \Doctrine\DBAL\Platforms\MySqlPlatform();
}

public function getSchemaManager(\Doctrine\DBAL\Connection $conn)
{
return new \Doctrine\DBAL\Schema\MySqlSchemaManager($conn);
}

}

}
22 changes: 11 additions & 11 deletions lib/Doctrine/DBAL/Driver/PDOOracle/Driver.php
Expand Up @@ -2,18 +2,20 @@

namespace Doctrine\DBAL\Driver\PDOOracle;

use Doctrine\DBAL\Platforms;

class Driver implements \Doctrine\DBAL\Driver
{

public function connect(array $params, $username = null, $password = null, array $driverOptions = array())
{
return new \Doctrine\DBAL\Driver\PDOConnection(
$this->_constructPdoDsn($params),
$username,
$password,
$driverOptions);
$this->_constructPdoDsn($params),
$username,
$password,
$driverOptions
);
}

/**
* Constructs the Oracle PDO DSN.
*
Expand All @@ -23,16 +25,14 @@ private function _constructPdoDsn(array $params)
{
//TODO
}

public function getDatabasePlatform()
{
return new \Doctrine\DBAL\Platforms\OraclePlatform();
}

public function getSchemaManager(\Doctrine\DBAL\Connection $conn)
{
return new \Doctrine\DBAL\Schema\OracleSchemaManager($conn);
}

}

}
35 changes: 17 additions & 18 deletions lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php
@@ -1,24 +1,26 @@
<?php

#namespace Doctrine::DBAL::Driver::PDOPgSql;
namespace Doctrine\DBAL\Driver\PDOPgSql;

use Doctrine\DBAL\Platforms;

/**
* Driver that connects through pdo_pgsql.
*
* @since 2.0
*/
class Doctrine_DBAL_Driver_PDOPgSql_Driver implements Doctrine_DBAL_Driver
class Driver implements \Doctrine\DBAL\Driver
{

public function connect(array $params, $username = null, $password = null, array $driverOptions = array())
{
return new Doctrine_DBAL_Driver_PDOConnection(
$this->_constructPdoDsn($params),
$username,
$password,
$driverOptions);
return new \Doctrine\DBAL\Driver\PDOConnection(
$this->_constructPdoDsn($params),
$username,
$password,
$driverOptions
);
}

/**
* Constructs the Postgres PDO DSN.
*
Expand All @@ -28,17 +30,14 @@ private function _constructPdoDsn(array $params)
{
//TODO
}

public function getDatabasePlatform()
{
return new Doctrine_DBAL_Platforms_PostgreSqlPlatform();
return new \Doctrine\DBAL\Platforms\PostgreSqlPlatform();
}
public function getSchemaManager(Doctrine_DBAL_Connection $conn)

public function getSchemaManager(\Doctrine\DBAL\Connection $conn)
{
return new Doctrine_DBAL_Schema_PostgreSqlSchemaManager($conn);
return new \Doctrine\DBAL\Schema\PostgreSqlSchemaManager($conn);
}

}

?>
}

0 comments on commit d458197

Please sign in to comment.