diff --git a/Command/DatabaseCreateCommand.php b/Command/DatabaseCreateCommand.php
index ef06523..6c9f2af 100644
--- a/Command/DatabaseCreateCommand.php
+++ b/Command/DatabaseCreateCommand.php
@@ -54,27 +54,19 @@ class DatabaseCreateCommand extends AbstractCommand
$query = 'CREATE DATABASE '. $dbName .';';
}
- try {
- $manager = new ConnectionManagerSingle();
- $manager->setConfiguration($this->getTemporaryConfiguration($config));
+ $manager = new ConnectionManagerSingle();
+ $manager->setConfiguration($this->getTemporaryConfiguration($config));
- $serviceContainer = Propel::getServiceContainer();
- $serviceContainer->setAdapterClass($connectionName, $config['adapter']);
- $serviceContainer->setConnectionManager($connectionName, $manager);
+ $serviceContainer = Propel::getServiceContainer();
+ $serviceContainer->setAdapterClass($connectionName, $config['adapter']);
+ $serviceContainer->setConnectionManager($connectionName, $manager);
- $connection = Propel::getConnection($connectionName);
+ $connection = Propel::getConnection($connectionName);
- $statement = $connection->prepare($query);
- $statement->execute();
+ $statement = $connection->prepare($query);
+ $statement->execute();
- $output->writeln(sprintf('Database %s has been created.', $dbName));
- } catch (\Exception $e) {
- $this->writeSection($output, array(
- '[Propel] Exception caught',
- '',
- $e->getMessage()
- ), 'fg=white;bg=red');
- }
+ $output->writeln(sprintf('Database %s has been created.', $dbName));
}
/**
diff --git a/Command/DatabaseDropCommand.php b/Command/DatabaseDropCommand.php
index 80fa856..bf17075 100644
--- a/Command/DatabaseDropCommand.php
+++ b/Command/DatabaseDropCommand.php
@@ -79,17 +79,9 @@ EOT
$query = 'DROP DATABASE '. $dbName .';';
}
- try {
- $statement = $connection->prepare($query);
- $statement->execute();
+ $statement = $connection->prepare($query);
+ $statement->execute();
- $output->writeln(sprintf('Database %s has been dropped.', $dbName));
- } catch (\Exception $e) {
- $this->writeSection($output, array(
- '[Propel] Exception caught',
- '',
- $e->getMessage()
- ), 'fg=white;bg=red');
- }
+ $output->writeln(sprintf('Database %s has been dropped.', $dbName));
}
}
diff --git a/Command/FixturesDumpCommand.php b/Command/FixturesDumpCommand.php
index 36af2ef..e23330f 100644
--- a/Command/FixturesDumpCommand.php
+++ b/Command/FixturesDumpCommand.php
@@ -74,16 +74,7 @@ EOT
$filename = $path . '/fixtures_' . time() . '.yml';
$dumper = $this->getContainer()->get('propel.dumper.yaml');
- try {
- $dumper->dump($filename, $input->getOption('connection'));
- } catch (\Exception $e) {
- $this->writeSection($output, array(
- '[Propel] Exception',
- '',
- $e->getMessage()), 'fg=white;bg=red');
-
- return false;
- }
+ $dumper->dump($filename, $input->getOption('connection'));
$this->writeNewFile($output, $filename);
diff --git a/Command/TableDropCommand.php b/Command/TableDropCommand.php
index e6e48a4..812ef67 100644
--- a/Command/TableDropCommand.php
+++ b/Command/TableDropCommand.php
@@ -76,45 +76,37 @@ class TableDropCommand extends ContainerAwareCommand
}
}
- try {
- $showStatement = $connection->prepare('SHOW TABLES;');
- $showStatement->execute();
+ $showStatement = $connection->prepare('SHOW TABLES;');
+ $showStatement->execute();
- $allTables = $showStatement->fetchAll(\PDO::FETCH_COLUMN);
+ $allTables = $showStatement->fetchAll(\PDO::FETCH_COLUMN);
- if ($nbTable) {
- foreach ($tablesToDelete as $tableToDelete) {
- if (!array_search($tableToDelete, $allTables)) {
- throw new \InvalidArgumentException(sprintf('Table %s doesn\'t exist in the database.', $tableToDelete));
- }
+ if ($nbTable) {
+ foreach ($tablesToDelete as $tableToDelete) {
+ if (!array_search($tableToDelete, $allTables)) {
+ throw new \InvalidArgumentException(sprintf('Table %s doesn\'t exist in the database.', $tableToDelete));
}
- } else {
- $tablesToDelete = $allTables;
}
-
- $connection->exec('SET FOREIGN_KEY_CHECKS = 0;');
-
- array_walk($tablesToDelete, function (&$table, $key, $dbAdapter) {
- $table = $dbAdapter->quoteIdentifierTable($table);
- }, $adapter);
-
- $tablesToDelete = join(', ', $tablesToDelete);
-
- if ('' !== $tablesToDelete) {
- $connection->exec('DROP TABLE ' . $tablesToDelete . ' ;');
-
- $output->writeln(sprintf('Table' . $tablePlural . ' %s has been dropped.', $tablesToDelete));
- } else {
- $output->writeln('No tables have been dropped');
- }
-
- $connection->exec('SET FOREIGN_KEY_CHECKS = 1;');
- } catch (\Exception $e) {
- $this->writeSection($output, array(
- '[Propel] Exception caught',
- '',
- $e->getMessage()
- ), 'fg=white;bg=red');
+ } else {
+ $tablesToDelete = $allTables;
}
+
+ $connection->exec('SET FOREIGN_KEY_CHECKS = 0;');
+
+ array_walk($tablesToDelete, function (&$table, $key, $dbAdapter) {
+ $table = $dbAdapter->quoteIdentifierTable($table);
+ }, $adapter);
+
+ $tablesToDelete = join(', ', $tablesToDelete);
+
+ if ('' !== $tablesToDelete) {
+ $connection->exec('DROP TABLE ' . $tablesToDelete . ' ;');
+
+ $output->writeln(sprintf('Table' . $tablePlural . ' %s has been dropped.', $tablesToDelete));
+ } else {
+ $output->writeln('No tables have been dropped');
+ }
+
+ $connection->exec('SET FOREIGN_KEY_CHECKS = 1;');
}
}