1
0
mirror of synced 2025-01-18 22:41:43 +03:00

dropDatabase() added

This commit is contained in:
zYne 2007-06-13 21:41:20 +00:00
parent 1a14aa301d
commit 27ae95af91

View File

@ -33,6 +33,26 @@ Doctrine::autoload('Doctrine_Export');
*/
class Doctrine_Export_Sqlite extends Doctrine_Export
{
/**
* drop an existing database
*
* @param string $name name of the database that should be dropped
* @throws Doctrine_Export_Exception if the database file does not exist
* @throws Doctrine_Export_Exception if something failed during the removal of the database file
* @return void
*/
public function dropDatabase($name)
{
$databaseFile = $this->conn->formatter->getDatabaseFile($name);
if (!@file_exists($databaseFile)) {
throw new Doctrine_Export_Exception('database does not exist');
}
$result = @unlink($database_file);
if ( ! $result) {
throw new Doctrine_Export_Exception('could not remove the database file');
}
}
/**
* Get the stucture of a field into an array
*