Commit ecb98ed7 authored by Laszlo Korte's avatar Laszlo Korte

writing the result into the output object instead of just echoing it out.

parent ada344f2
...@@ -26,7 +26,7 @@ use Symfony\Component\Console\Input\InputArgument, ...@@ -26,7 +26,7 @@ use Symfony\Component\Console\Input\InputArgument,
/** /**
* Task for executing arbitrary SQL that can come from a file or directly from * Task for executing arbitrary SQL that can come from a file or directly from
* the command line. * the command line.
* *
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org * @link www.doctrine-project.org
* @since 2.0 * @since 2.0
...@@ -71,13 +71,18 @@ EOT ...@@ -71,13 +71,18 @@ EOT
if ( ! is_numeric($depth)) { if ( ! is_numeric($depth)) {
throw new \LogicException("Option 'depth' must contains an integer value"); throw new \LogicException("Option 'depth' must contains an integer value");
} }
if (preg_match('/^select/i', $sql)) { if (preg_match('/^select/i', $sql)) {
$resultSet = $conn->fetchAll($sql); $resultSet = $conn->fetchAll($sql);
} else { } else {
$resultSet = $conn->executeUpdate($sql); $resultSet = $conn->executeUpdate($sql);
} }
ob_start();
\Doctrine\Common\Util\Debug::dump($resultSet, (int) $depth); \Doctrine\Common\Util\Debug::dump($resultSet, (int) $depth);
$output = ob_get_contents();
ob_end_clean();
$output->write();
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment