Changeset 3679
- Timestamp:
- 01/30/08 00:32:36 (17 months ago)
- Files:
-
- 3 modified
-
branches/0.10/lib/Doctrine/Task/DropDb.php (modified) (1 diff)
-
branches/0.9/lib/Doctrine/Task/DropDb.php (modified) (1 diff)
-
trunk/lib/Doctrine/Task/DropDb.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.10/lib/Doctrine/Task/DropDb.php
r3130 r3679 35 35 public $description = 'Drop database for all existing connections', 36 36 $requiredArguments = array(), 37 $optionalArguments = array( );38 37 $optionalArguments = array('force' => 'Whether or not to force the drop database task'); 38 39 39 public function execute() 40 40 { 41 $answer = $this->ask('Are you sure you wish to drop your databases? (y/n)'); 42 43 if ($answer != 'y') { 44 $this->notify('Successfully cancelled'); 45 46 return; 41 if ( ! $this->getArgument('force')) { 42 $answer = $this->ask('Are you sure you wish to drop your databases? (y/n)'); 43 44 if ($answer != 'y') { 45 $this->notify('Successfully cancelled'); 46 47 return; 48 } 47 49 } 48 50 49 51 $results = Doctrine::dropDatabases(); 50 52 51 53 foreach ($results as $dbName => $bool) { 52 54 $msg = $bool ? 'Successfully dropped database named: "' . $dbName . '"':'Could not drop database named: "' .$dbName . '"'; 53 55 54 56 $this->notify($msg); 55 57 } -
branches/0.9/lib/Doctrine/Task/DropDb.php
r3128 r3679 35 35 public $description = 'Drop database for all existing connections', 36 36 $requiredArguments = array(), 37 $optionalArguments = array( );38 37 $optionalArguments = array('force' => 'Whether or not to force the drop database task'); 38 39 39 public function execute() 40 40 { 41 $answer = $this->ask('Are you sure you wish to drop your databases? (y/n)'); 42 43 if ($answer != 'y') { 44 $this->notify('Successfully cancelled'); 45 46 return; 41 if ( ! $this->getArgument('force')) { 42 $answer = $this->ask('Are you sure you wish to drop your databases? (y/n)'); 43 44 if ($answer != 'y') { 45 $this->notify('Successfully cancelled'); 46 47 return; 48 } 47 49 } 48 50 49 51 $results = Doctrine::dropDatabases(); 50 52 51 53 foreach ($results as $dbName => $bool) { 52 54 $msg = $bool ? 'Successfully dropped database named: "' . $dbName . '"':'Could not drop database named: "' .$dbName . '"'; 53 55 54 56 $this->notify($msg); 55 57 } -
trunk/lib/Doctrine/Task/DropDb.php
r3588 r3679 36 36 $requiredArguments = array(), 37 37 $optionalArguments = array('force' => 'Whether or not to force the drop database task'); 38 38 39 39 public function execute() 40 40 { … … 50 50 51 51 $results = Doctrine::dropDatabases(); 52 52 53 53 foreach ($results as $name => $result) { 54 54 $msg = $result instanceof Exception ? 'Could not drop database for connection: "' .$name . '." Failed with exception: ' . $result->getMessage():$result; 55 55 56 56 $this->notify($msg); 57 57 }