diff --git a/lib/Doctrine/Cli.php b/lib/Doctrine/Cli.php index d7bded4c3..b26aaea67 100644 --- a/lib/Doctrine/Cli.php +++ b/lib/Doctrine/Cli.php @@ -84,15 +84,11 @@ class Doctrine_Cli */ public function run($args) { - echo "\n"; - try { $this->_run($args); } catch (Exception $exception) { $this->notifyException($exception); } - - echo "\n"; } protected function _getTaskClassFromArgs($args) diff --git a/lib/Doctrine/Data/Export.php b/lib/Doctrine/Data/Export.php index 6a0c5c1a5..7cb6b9185 100644 --- a/lib/Doctrine/Data/Export.php +++ b/lib/Doctrine/Data/Export.php @@ -110,7 +110,7 @@ class Doctrine_Data_Export extends Doctrine_Data } } else { if (is_dir($directory)) { - throw new Doctrine_Data_Exception('You must specify the path to a '.$format.' file to export. You specified a directory.'); + $directory .= DIRECTORY_SEPARATOR . 'data.' . $format; } if ( ! empty($data)) { diff --git a/lib/Doctrine/Export/Schema.php b/lib/Doctrine/Export/Schema.php index 26a2b5bbf..6d6c0f70d 100644 --- a/lib/Doctrine/Export/Schema.php +++ b/lib/Doctrine/Export/Schema.php @@ -123,6 +123,10 @@ class Doctrine_Export_Schema { $array = $this->buildSchema($directory, $models); + if (is_dir($schema)) { + $schema = $schema . DIRECTORY_SEPARATOR . 'schema.' . $format; + } + return Doctrine_Parser::dump($array, $format, $schema); } } \ No newline at end of file diff --git a/lib/Doctrine/Task/DumpData.php b/lib/Doctrine/Task/DumpData.php index f925a6083..8dfe4c17e 100644 --- a/lib/Doctrine/Task/DumpData.php +++ b/lib/Doctrine/Task/DumpData.php @@ -35,25 +35,19 @@ class Doctrine_Task_DumpData extends Doctrine_Task public $description = 'Dump data to a yaml data fixture file.', $requiredArguments = array('data_fixtures_path' => 'Specify path to write the yaml data fixtures file to.', 'models_path' => 'Specify path to your Doctrine_Record definitions.'), - $optionalArguments = array('individual_files' => 'Specify whether or not you want to dump to individual files. One file per model.'); + $optionalArguments = array(); public function execute() { Doctrine::loadModels($this->getArgument('models_path')); - $individualFiles = $this->getArgument('individual_files') ? true:false; - $path = $this->getArgument('data_fixtures_path'); - if ( ! $individualFiles) { - $e = explode('.', $this->getArgument('data_fixtures_path')); - - if (end($e) !== 'yml') { - $path = $this->getArgument('data_fixtures_path'). DIRECTORY_SEPARATOR . 'data.yml'; - } + if (is_array($path)) { + $path = $path[0]; } - Doctrine::dumpData($path, $individualFiles); + Doctrine::dumpData($path); $this->dispatcher->notify(sprintf('Dumped data successfully to: %s', $path)); }