Changeset 3679

Show
Ignore:
Timestamp:
01/30/08 00:32:36 (17 months ago)
Author:
guilhermeblanco
Message:

Merged changeset #3588 into 0.9 and 0.10 branches. Fixed ws in trunk

Files:
3 modified

Legend:

Unmodified
Added
Removed
  • branches/0.10/lib/Doctrine/Task/DropDb.php

    r3130 r3679  
    3535    public $description          =   'Drop database for all existing connections', 
    3636           $requiredArguments    =   array(), 
    37            $optionalArguments    =   array(); 
    38      
     37           $optionalArguments    =   array('force'  =>  'Whether or not to force the drop database task'); 
     38 
    3939    public function execute() 
    4040    { 
    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            } 
    4749        } 
    4850 
    4951        $results = Doctrine::dropDatabases(); 
    50          
     52 
    5153        foreach ($results as $dbName => $bool) { 
    5254            $msg = $bool ? 'Successfully dropped database named: "' . $dbName . '"':'Could not drop database named: "' .$dbName . '"'; 
    53              
     55 
    5456            $this->notify($msg); 
    5557        } 
  • branches/0.9/lib/Doctrine/Task/DropDb.php

    r3128 r3679  
    3535    public $description          =   'Drop database for all existing connections', 
    3636           $requiredArguments    =   array(), 
    37            $optionalArguments    =   array(); 
    38      
     37           $optionalArguments    =   array('force'  =>  'Whether or not to force the drop database task'); 
     38 
    3939    public function execute() 
    4040    { 
    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            } 
    4749        } 
    4850 
    4951        $results = Doctrine::dropDatabases(); 
    50          
     52 
    5153        foreach ($results as $dbName => $bool) { 
    5254            $msg = $bool ? 'Successfully dropped database named: "' . $dbName . '"':'Could not drop database named: "' .$dbName . '"'; 
    53              
     55 
    5456            $this->notify($msg); 
    5557        } 
  • trunk/lib/Doctrine/Task/DropDb.php

    r3588 r3679  
    3636           $requiredArguments    =   array(), 
    3737           $optionalArguments    =   array('force'  =>  'Whether or not to force the drop database task'); 
    38      
     38 
    3939    public function execute() 
    4040    { 
     
    5050 
    5151        $results = Doctrine::dropDatabases(); 
    52          
     52 
    5353        foreach ($results as $name => $result) { 
    5454            $msg = $result instanceof Exception ? 'Could not drop database for connection: "' .$name . '." Failed with exception: ' . $result->getMessage():$result; 
    55              
     55 
    5656            $this->notify($msg); 
    5757        }