Commit 060784ad authored by Jonathan.Wage's avatar Jonathan.Wage

Merge r3127:3129 (fixes #522)

parent b1c4c5f5
......@@ -37,8 +37,12 @@ class Doctrine_Task_CreateDb extends Doctrine_Task
public function execute()
{
Doctrine::createDatabases();
$results = Doctrine::createDatabases();
$this->notify('Created databases successfully');
foreach ($results as $dbName => $bool) {
$msg = $bool ? 'Successfully created database named: "' . $dbName . '"':'Could not create database named: "' .$dbName . '"';
$this->notify($msg);
}
}
}
\ No newline at end of file
......@@ -46,8 +46,12 @@ class Doctrine_Task_DropDb extends Doctrine_Task
return;
}
Doctrine::dropDatabases();
$results = Doctrine::dropDatabases();
$this->notify('Dropped databases successfully');
foreach ($results as $dbName => $bool) {
$msg = $bool ? 'Successfully dropped database named: "' . $dbName . '"':'Could not drop database named: "' .$dbName . '"';
$this->notify($msg);
}
}
}
\ No newline at end of file
++ Creating & Dropping Databases
Doctrine offers the ability to create and drop your databases from your defined Doctrine connections. The only trick to using it is that the name of your Doctrine connection must be the name of your database. This is required due to the fact that PDO does not offer a method for retrieving the name of the database you are connected to. So in order to create and drop the database Doctrine itself must be aware of the name of the database.
++ Convenience Methods
Doctrine offers static convenience methods available in the main Doctrine class. These methods perform some of the most used functionality of Doctrine with one method. Most of these methods are using in the Doctrine_Task system. These tasks are also what are executed from the Doctrine_Cli.
......
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