From e4d8efa39466620dad6b86d812b083e0400dd44f Mon Sep 17 00:00:00 2001 From: Guilherme Blanco Date: Fri, 9 Apr 2010 00:53:29 -0300 Subject: [PATCH] [2.0] Couple of fixes to new Console implementation --- lib/Doctrine/Common/Version.php | 2 +- .../DBAL/Tools/Console/Command/RunSqlCommand.php | 3 +-- .../ORM/Tools/Console/Command/RunDqlCommand.php | 2 +- .../Console/Command/SchemaTool/CreateCommand.php | 2 +- .../Console/Command/SchemaTool/DropCommand.php | 2 +- .../Console/Command/SchemaTool/UpdateCommand.php | 2 +- tools/sandbox/cli-config.php | 14 -------------- 7 files changed, 6 insertions(+), 21 deletions(-) diff --git a/lib/Doctrine/Common/Version.php b/lib/Doctrine/Common/Version.php index 2e1847dc6..fd1b499f0 100644 --- a/lib/Doctrine/Common/Version.php +++ b/lib/Doctrine/Common/Version.php @@ -38,7 +38,7 @@ class Version /** * Current Doctrine Version */ - const VERSION = '2.0 ALPHA 4'; + const VERSION = '2.0-DEV'; /** * Compares a Doctrine version with the current one. diff --git a/lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php b/lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php index 6c5ee824e..0e6c05c82 100644 --- a/lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php +++ b/lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php @@ -76,8 +76,7 @@ EOT } if (preg_match('/^select/i', $sql)) { - $stmt = $conn->execute($sql); - $resultSet = $stmt->fetchAll(\Doctrine\DBAL\Connection::FETCH_ASSOC); + $resultSet = $conn->fetchAll($sql); } else { $resultSet = $em->getConnection()->executeUpdate($sql); } diff --git a/lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php index c995fba7b..fc375812b 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php @@ -117,7 +117,7 @@ EOT $query->setMaxResult((int) $maxResult); } - $resultSet = $query->execute(array(), $hydrationMode); + $resultSet = $query->execute(array(), constant($hydrationMode)); \Doctrine\Common\Util\Debug::dump($resultSet, $input->getOption('depth')); } diff --git a/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/CreateCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/CreateCommand.php index 4ca0b3090..fd724c2df 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/CreateCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/CreateCommand.php @@ -76,7 +76,7 @@ EOT { $em = $this->getHelper('em')->getEntityManager(); - $reader = new ClassMetadataReader(); + $reader = new \Doctrine\ORM\Tools\ClassMetadataReader(); $reader->setEntityManager($em); // Process source directories diff --git a/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/DropCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/DropCommand.php index b41c616a8..9bcf280e7 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/DropCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/DropCommand.php @@ -77,7 +77,7 @@ EOT { $em = $this->getHelper('em')->getEntityManager(); - $reader = new ClassMetadataReader(); + $reader = new \Doctrine\ORM\Tools\ClassMetadataReader(); $reader->setEntityManager($em); // Process source directories diff --git a/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/UpdateCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/UpdateCommand.php index 9aba1e9cd..7d85bb6a9 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/UpdateCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/UpdateCommand.php @@ -82,7 +82,7 @@ EOT { $em = $this->getHelper('em')->getEntityManager(); - $reader = new ClassMetadataReader(); + $reader = new \Doctrine\ORM\Tools\ClassMetadataReader(); $reader->setEntityManager($em); // Process source directories diff --git a/tools/sandbox/cli-config.php b/tools/sandbox/cli-config.php index 887780dd9..dc2c9875e 100644 --- a/tools/sandbox/cli-config.php +++ b/tools/sandbox/cli-config.php @@ -1,18 +1,4 @@ option where you can specify the configuration -# file to use for a particular task. If this option is not given, the CLI looks for a file -# named "cli-config.php" (this one) in the same directory and uses that by default. -# require_once __DIR__ . '/../../lib/Doctrine/Common/ClassLoader.php';