Merge r3127:3129 (fixes #522)
This commit is contained in:
parent
b1c4c5f53f
commit
060784adfb
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,3 +1,7 @@
|
||||
++ 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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user