Author: Russ
Date: 2010-04-19 15:25:45 +0200 (Mon, 19 Apr 2010)
New Revision: 29205
Modified:
plugins/sfDoctrinePlugin/branches/1.3-2.0/config/sfDoctrine2PluginConfiguration.class.php
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/cli/sfDoctrineCliPrinter.class.php
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/debug/sfDoctrineSqlLogger.class.php
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineBaseTask.class.php
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineBuildFiltersTask.class.php
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineBuildFormsTask.class.php
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineCheckSettingsTask.class.php
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineConvertMappingTask.class.php
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineCreateDbTask.class.php
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineCreateSchemaTask.class.php
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineDropDbTask.class.php
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineDropSchemaTask.class.php
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineGenerateAdminTask.class.php
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineGenerateModuleTask.class.php
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineGenerateProxiesTask.class.php
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineLoadDataFixturesTask.class.php
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineRunDqlTask.class.php
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineRunSqlTask.class.php
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineUpdateSchemaTask.class.php
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineVersionTask.class.php
Log:
[1.4][sfDoctrine2Plugin] Bring the plugin up to date with latest Doctrine CLI
changes
Modified:
plugins/sfDoctrinePlugin/branches/1.3-2.0/config/sfDoctrine2PluginConfiguration.class.php
===================================================================
---
plugins/sfDoctrinePlugin/branches/1.3-2.0/config/sfDoctrine2PluginConfiguration.class.php
2010-04-19 09:57:33 UTC (rev 29204)
+++
plugins/sfDoctrinePlugin/branches/1.3-2.0/config/sfDoctrine2PluginConfiguration.class.php
2010-04-19 13:25:45 UTC (rev 29205)
@@ -46,6 +46,10 @@
$classLoader->setIncludePath(__DIR__.'/../lib/vendor/doctrine');
$classLoader->register();
+ $classLoader = new \Doctrine\Common\ClassLoader('Symfony');
+ $classLoader->setIncludePath(__DIR__.'/../lib/vendor');
+ $classLoader->register();
+
$this->dispatcher->connect('component.method_not_found', array($this,
'componentMethodNotFound'));
}
@@ -125,4 +129,4 @@
return false;
}
}
-}
\ No newline at end of file
+}
Modified:
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/cli/sfDoctrineCliPrinter.class.php
===================================================================
---
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/cli/sfDoctrineCliPrinter.class.php
2010-04-19 09:57:33 UTC (rev 29204)
+++
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/cli/sfDoctrineCliPrinter.class.php
2010-04-19 13:25:45 UTC (rev 29205)
@@ -1,29 +1,43 @@
<?php
+use Symfony\Components\Console\Output\OutputInterface;
-use Doctrine\Common\CLI\Printers\AnsiColorPrinter;
-
-class sfDoctrineCliPrinter extends AnsiColorPrinter
+class sfDoctrineCliPrinter implements OutputInterface
{
protected $formatter;
+ protected $dispatcher;
public function setFormatter($formatter)
{
$this->formatter = $formatter;
}
- public function write($message, $style = 'NONE')
+ public function setDispatcher($dispatcher)
{
- fwrite($this->_stream, $this->format($message, $style));
-
+ $this->dispatcher = $dispatcher;
+ }
+
+ public function logSection($section, $message, $size = null, $style = 'INFO')
+ {
+ $this->dispatcher->notify(new sfEvent($this, 'command.log',
array($this->formatter->formatSection($section, $message, $size, $style))));
+ }
+
+ /**
+ * Writes a message to the output.
+ *
+ * @param string|array $messages The message as an array of lines of a
single string
+ * @param integer $type The type of output
+ */
+ public function write($messages, $type = 0)
+ {
+ $this->logSection("Doctrine", $messages);
return $this;
}
- public function writeln($message, $style = 'NONE')
+ public function setVerbosity($level)
{
- $messages = explode("\n", $message);
- foreach ($messages as $message)
- {
- $this->write($this->formatter->formatSection('doctrine',
$this->format($message.PHP_EOL, $style)));
- }
}
-}
\ No newline at end of file
+
+ public function setDecorated($decorated)
+ {
+ }
+}
Modified:
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/debug/sfDoctrineSqlLogger.class.php
===================================================================
---
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/debug/sfDoctrineSqlLogger.class.php
2010-04-19 09:57:33 UTC (rev 29204)
+++
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/debug/sfDoctrineSqlLogger.class.php
2010-04-19 13:25:45 UTC (rev 29205)
@@ -1,6 +1,6 @@
<?php
-class sfDoctrineSqlLogger implements Doctrine\DBAL\Logging\SqlLogger
+class sfDoctrineSqlLogger implements Doctrine\DBAL\Logging\SQLLogger
{
protected $dispatcher;
@@ -25,12 +25,16 @@
{
foreach ((array) $params as $key => $param)
{
- if (strlen($param) >= 255)
+ if (is_object($param))
{
+ $params[$key] = "(Object, " . get_class($param) . ")";
+ }
+ elseif (strlen($param) >= 255)
+ {
$params[$key] = '['.number_format(strlen($param) / 1024, 2).'Kb]';
}
}
return $params;
}
-}
\ No newline at end of file
+}
Modified:
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineBaseTask.class.php
===================================================================
---
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineBaseTask.class.php
2010-04-19 09:57:33 UTC (rev 29204)
+++
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineBaseTask.class.php
2010-04-19 13:25:45 UTC (rev 29205)
@@ -20,6 +20,8 @@
*/
abstract class sfDoctrineBaseTask extends sfBaseTask
{
+ static protected $databaseManagers = array();
+
protected function prepareDoctrineCliArguments(array $arguments, array $keys
= array())
{
$args = array();
@@ -44,38 +46,76 @@
return $args;
}
+ protected function getCli()
+ {
+ $helperSet = new \Symfony\Components\Console\Helper\HelperSet(array(
+ 'em' => new
\Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($this->getEntityManager()),
+ 'db' => new
\Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($this->getEntityManager()->getConnection()),
+ ));
+
+ $cli = new \Symfony\Components\Console\Application('Doctrine Command Line
Interface', Doctrine\Common\Version::VERSION);
+ $cli->setCatchExceptions(false);
+ $cli->setAutoExit(false);
+ $cli->setHelperSet($helperSet);
+ $cli->addCommands(array(
+ // DBAL Commands
+ new \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(),
+ new \Doctrine\DBAL\Tools\Console\Command\ImportCommand(),
+
+ // ORM Commands
+ new \Doctrine\ORM\Tools\Console\Command\ClearCache\MetadataCommand(),
+ new \Doctrine\ORM\Tools\Console\Command\ClearCache\ResultCommand(),
+ new \Doctrine\ORM\Tools\Console\Command\ClearCache\QueryCommand(),
+ new \Doctrine\ORM\Tools\Console\Command\SchemaTool\CreateCommand(),
+ new \Doctrine\ORM\Tools\Console\Command\SchemaTool\UpdateCommand(),
+ new \Doctrine\ORM\Tools\Console\Command\SchemaTool\DropCommand(),
+ new
\Doctrine\ORM\Tools\Console\Command\EnsureProductionSettingsCommand(),
+ new \Doctrine\ORM\Tools\Console\Command\ConvertDoctrine1SchemaCommand(),
+ new \Doctrine\ORM\Tools\Console\Command\GenerateRepositoriesCommand(),
+ new \Doctrine\ORM\Tools\Console\Command\GenerateEntitiesCommand(),
+ new \Doctrine\ORM\Tools\Console\Command\GenerateProxiesCommand(),
+ new \Doctrine\ORM\Tools\Console\Command\ConvertMappingCommand(),
+ new \Doctrine\ORM\Tools\Console\Command\RunDqlCommand(),
+ ));
+
+ return $cli;
+ }
+
protected function callDoctrineCli($task, $arguments = array())
{
- $this->databaseManager = new sfDatabaseManager($this->configuration);
- $em = $this->getEntityManager();
- $args = array(
- './doctrine',
- $task
- );
+ $this->initDBM();
+ $args = array($task);
$args = array_merge($args, $arguments);
- $args[] = '--config='.__DIR__.'/../../config/cli-config.php';
- $args[] = '--class-dir=' . join(",",
$em->getConfiguration()->getMetadataDriverImpl()->getPaths());
- $printer = new sfDoctrineCliPrinter();
- $printer->setFormatter($this->formatter);
+ $input = new \Symfony\Components\Console\Input\StringInput(join(" ",
$args));
- $config = new \Doctrine\Common\CLI\Configuration;
- $config->setAttribute("em", $em);
+ $output = new sfDoctrineCliPrinter();
+ $output->setFormatter($this->formatter);
+ $output->setDispatcher($this->dispatcher);
- $cli = new \Doctrine\Common\CLI\CLIController($config, $printer);
- return $cli->run($args);
+ $cli = $this->getCli();
+ return $cli->run($input, $output);
}
- protected function getEntityManager($name = null)
+ protected function initDBM()
{
- if (!isset($this->databaseManager))
+ $hash = spl_object_hash($this->configuration);
+
+ if (!isset(self::$databaseManagers[$hash]))
{
- throw new sfException('No $databaseManager property found.');
+ self::$databaseManagers[$hash] = new
sfDatabaseManager($this->configuration);
}
- $names = $this->databaseManager->getNames();
+ return self::$databaseManagers[$hash];
+ }
+ protected function getEntityManager($name = null)
+ {
+ $databaseManager = $this->initDBM();
+
+ $names = $databaseManager->getNames();
+
if ($name !== null)
{
if (!in_array($name, $names))
@@ -85,9 +125,9 @@
'the database connection named: "%s"', $name)
);
}
- $database = $this->databaseManager->getDatabase($name);
+ $database = $databaseManager->getDatabase($name);
} else {
- $database = $this->databaseManager->getDatabase(end($names));
+ $database = $databaseManager->getDatabase(end($names));
}
return $database->getEntityManager();
Modified:
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineBuildFiltersTask.class.php
===================================================================
---
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineBuildFiltersTask.class.php
2010-04-19 09:57:33 UTC (rev 29204)
+++
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineBuildFiltersTask.class.php
2010-04-19 13:25:45 UTC (rev 29205)
@@ -57,7 +57,7 @@
protected function execute($arguments = array(), $options = array())
{
$this->logSection('doctrine', 'generating filter form classes');
- $databaseManager = new sfDatabaseManager($this->configuration);
+ $databaseManager = $this->initDBM();
$generatorManager = new sfGeneratorManager($this->configuration);
$generatorManager->generate('sfDoctrineFormFilterGenerator', array(
'model_dir_name' => $options['model-dir-name'],
@@ -78,4 +78,4 @@
$this->reloadAutoload();
}
-}
\ No newline at end of file
+}
Modified:
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineBuildFormsTask.class.php
===================================================================
---
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineBuildFormsTask.class.php
2010-04-19 09:57:33 UTC (rev 29204)
+++
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineBuildFormsTask.class.php
2010-04-19 13:25:45 UTC (rev 29205)
@@ -57,7 +57,7 @@
protected function execute($arguments = array(), $options = array())
{
$this->logSection('doctrine', 'generating form classes');
- $databaseManager = new sfDatabaseManager($this->configuration);
+ $databaseManager = $this->initDBM();
$generatorManager = new sfGeneratorManager($this->configuration);
$generatorManager->generate('sfDoctrineFormGenerator', array(
'model_dir_name' => $options['model-dir-name'],
@@ -78,4 +78,4 @@
$this->reloadAutoload();
}
-}
\ No newline at end of file
+}
Modified:
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineCheckSettingsTask.class.php
===================================================================
---
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineCheckSettingsTask.class.php
2010-04-19 09:57:33 UTC (rev 29204)
+++
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineCheckSettingsTask.class.php
2010-04-19 13:25:45 UTC (rev 29205)
@@ -46,6 +46,6 @@
*/
protected function execute($arguments = array(), $options = array())
{
- $this->callDoctrineCli('Orm:ensure-production-settings');
+ $this->callDoctrineCli('orm:ensure-production-settings');
}
}
Modified:
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineConvertMappingTask.class.php
===================================================================
---
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineConvertMappingTask.class.php
2010-04-19 09:57:33 UTC (rev 29204)
+++
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineConvertMappingTask.class.php
2010-04-19 13:25:45 UTC (rev 29205)
@@ -65,6 +65,6 @@
}
$args = $this->prepareDoctrineCliArguments($options, $keys);
- $this->callDoctrineCli('Orm:convert-mapping', $args, $em);
+ $this->callDoctrineCli('orm:convert-mapping', $args, $em);
}
}
\ No newline at end of file
Modified:
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineCreateDbTask.class.php
===================================================================
---
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineCreateDbTask.class.php
2010-04-19 09:57:33 UTC (rev 29204)
+++
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineCreateDbTask.class.php
2010-04-19 13:25:45 UTC (rev 29205)
@@ -49,7 +49,7 @@
*/
protected function execute($arguments = array(), $options = array())
{
- $databaseManager = new sfDatabaseManager($this->configuration);
+ $databaseManager = $this->initDBM();
foreach ($databaseManager->getNames() as $name)
{
$database = $databaseManager->getDatabase($name);
@@ -73,4 +73,4 @@
$tmpConnection->close();
}
}
-}
\ No newline at end of file
+}
Modified:
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineCreateSchemaTask.class.php
===================================================================
---
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineCreateSchemaTask.class.php
2010-04-19 09:57:33 UTC (rev 29204)
+++
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineCreateSchemaTask.class.php
2010-04-19 13:25:45 UTC (rev 29205)
@@ -52,10 +52,9 @@
*/
protected function execute($arguments = array(), $options = array())
{
- $keys = array('dump-sql', 'create');
- $options['create'] = true;
- $args = $this->prepareDoctrineCliArguments($options, $keys);
+ $keys = array('dump-sql');
+ $args = $this->prepareDoctrineCliArguments((array)$options, $keys);
- $this->callDoctrineCli('Orm:schema-tool', $args);
+ return $this->callDoctrineCli('orm:schema-tool:create', $args);
}
-}
\ No newline at end of file
+}
Modified:
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineDropDbTask.class.php
===================================================================
---
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineDropDbTask.class.php
2010-04-19 09:57:33 UTC (rev 29204)
+++
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineDropDbTask.class.php
2010-04-19 13:25:45 UTC (rev 29205)
@@ -50,7 +50,7 @@
*/
protected function execute($arguments = array(), $options = array())
{
- $databaseManager = new sfDatabaseManager($this->configuration);
+ $databaseManager = $this->initDBM();
$names = $databaseManager->getNames();
if (
@@ -80,4 +80,4 @@
}
}
}
-}
\ No newline at end of file
+}
Modified:
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineDropSchemaTask.class.php
===================================================================
---
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineDropSchemaTask.class.php
2010-04-19 09:57:33 UTC (rev 29204)
+++
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineDropSchemaTask.class.php
2010-04-19 13:25:45 UTC (rev 29205)
@@ -51,10 +51,9 @@
*/
protected function execute($arguments = array(), $options = array())
{
- $keys = array('dump-sql', 'drop');
- $options['drop'] = true;
+ $keys = array('dump-sql');
$args = $this->prepareDoctrineCliArguments($options, $keys);
- $this->callDoctrineCli('Orm:schema-tool', $args);
+ return $this->callDoctrineCli('orm:schema-tool:drop', $args);
}
-}
\ No newline at end of file
+}
Modified:
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineGenerateAdminTask.class.php
===================================================================
---
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineGenerateAdminTask.class.php
2010-04-19 09:57:33 UTC (rev 29204)
+++
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineGenerateAdminTask.class.php
2010-04-19 13:25:45 UTC (rev 29205)
@@ -101,7 +101,7 @@
if (!isset($routesArray[$name]))
{
- $databaseManager = new sfDatabaseManager($this->configuration);
+ $databaseManager = $this->initDBM();
$primaryKey = 'id';
$module = $options['module'] ? $options['module'] : $name;
$content = sprintf(<<<EOF
@@ -169,4 +169,4 @@
return false;
}
-}
\ No newline at end of file
+}
Modified:
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineGenerateModuleTask.class.php
===================================================================
---
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineGenerateModuleTask.class.php
2010-04-19 09:57:33 UTC (rev 29204)
+++
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineGenerateModuleTask.class.php
2010-04-19 13:25:45 UTC (rev 29205)
@@ -75,7 +75,7 @@
*/
protected function execute($arguments = array(), $options = array())
{
- $databaseManager = new sfDatabaseManager($this->configuration);
+ $databaseManager = $this->initDBM();
$properties =
parse_ini_file(sfConfig::get('sf_config_dir').'/properties.ini', true);
@@ -97,7 +97,7 @@
{
// generate module
$tmpDir =
sfConfig::get('sf_cache_dir').DIRECTORY_SEPARATOR.'tmp'.DIRECTORY_SEPARATOR.md5(uniqid(rand(),
true));
- $databaseManager = new sfDatabaseManager($this->configuration);
+ $databaseManager = $this->initDBM();
$generatorManager = new
sfGeneratorManager($this->configuration, $tmpDir);
$generatorManager->generate('sfDoctrineGenerator', array(
'model_class' => $arguments['model'],
@@ -213,4 +213,4 @@
);
$this->getFilesystem()->replaceTokens($finder->in($moduleDir), '##', '##',
$this->constants);
}
-}
\ No newline at end of file
+}
Modified:
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineGenerateProxiesTask.class.php
===================================================================
---
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineGenerateProxiesTask.class.php
2010-04-19 09:57:33 UTC (rev 29204)
+++
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineGenerateProxiesTask.class.php
2010-04-19 13:25:45 UTC (rev 29205)
@@ -50,6 +50,6 @@
*/
protected function execute($arguments = array(), $options = array())
{
- $this->callDoctrineCli('Orm:generate-proxies');
+ $this->callDoctrineCli('orm:generate-proxies');
}
}
Modified:
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineLoadDataFixturesTask.class.php
===================================================================
---
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineLoadDataFixturesTask.class.php
2010-04-19 09:57:33 UTC (rev 29204)
+++
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineLoadDataFixturesTask.class.php
2010-04-19 13:25:45 UTC (rev 29205)
@@ -54,16 +54,16 @@
*/
protected function execute($arguments = array(), $options = array())
{
- $this->databaseManager = new sfDatabaseManager($this->configuration);
+ $databaseManager = $this->initDBM();
if (!$options['append'])
{
- $names = $this->databaseManager->getNames();
+ $names = $databaseManager->getNames();
$entityManagers = array();
foreach ($names as $name)
{
- $metadatas = $this->databaseManager
+ $metadatas = $databaseManager
->getDatabase($name)
->getEntityManager()
->getMetadataFactory()
@@ -79,7 +79,7 @@
}
foreach ($entityManagers as $name => $classes)
{
- $em = $this->databaseManager->getDatabase($name)->getEntityManager();
+ $em = $databaseManager->getDatabase($name)->getEntityManager();
$cmf = $em->getMetadataFactory();
$classes = $this->getCommitOrder($em, $classes);
for ($i = count($classes) - 1; $i >= 0; --$i)
@@ -157,4 +157,4 @@
return $calc->getCommitOrder();
}
-}
\ No newline at end of file
+}
Modified:
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineRunDqlTask.class.php
===================================================================
---
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineRunDqlTask.class.php
2010-04-19 09:57:33 UTC (rev 29204)
+++
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineRunDqlTask.class.php
2010-04-19 13:25:45 UTC (rev 29205)
@@ -75,6 +75,6 @@
$args[] = '--hydrate='.$options["hydrate"];
}
- $this->callDoctrineCli('Orm:run-dql', $args);
+ $this->callDoctrineCli('orm:run-dql', $args);
}
}
\ No newline at end of file
Modified:
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineRunSqlTask.class.php
===================================================================
---
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineRunSqlTask.class.php
2010-04-19 09:57:33 UTC (rev 29204)
+++
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineRunSqlTask.class.php
2010-04-19 13:25:45 UTC (rev 29205)
@@ -53,21 +53,18 @@
protected function execute($arguments = array(), $options = array())
{
$args = array();
- if (isset($options['sql']))
- {
- $args[] = '--sql='.$options['sql'];
- }
- if (isset($options['file']))
+ if (isset($options['depth']))
{
- $args[] = '--file='.$options['file'];
+ $args[] = '--depth='.$options['depth'];
}
- if (isset($options['depth']))
+ if (isset($options['sql']))
{
- $args[] = '--depth='.$options['depth'];
+ $args[] = '"' . $options['sql'] . '"';
}
- $this->callDoctrineCli('Dbal:run-sql', $args);
+
+ $this->callDoctrineCli('dbal:run-sql', $args);
}
-}
\ No newline at end of file
+}
Modified:
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineUpdateSchemaTask.class.php
===================================================================
---
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineUpdateSchemaTask.class.php
2010-04-19 09:57:33 UTC (rev 29204)
+++
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineUpdateSchemaTask.class.php
2010-04-19 13:25:45 UTC (rev 29205)
@@ -51,17 +51,9 @@
*/
protected function execute($arguments = array(), $options = array())
{
- $keys = array('dump-sql', 'update');
- $options['update'] = true;
+ $keys = array('dump-sql');
$args = $this->prepareDoctrineCliArguments($options, $keys);
- $retval = $this->callDoctrineCli('Orm:schema-tool', $args);
-
- if ($retval === true)
- {
- return 0;
- }
-
- return 1;
+ return $this->callDoctrineCli('orm:schema-tool:update', $args);
}
-}
\ No newline at end of file
+}
Modified:
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineVersionTask.class.php
===================================================================
---
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineVersionTask.class.php
2010-04-19 09:57:33 UTC (rev 29204)
+++
plugins/sfDoctrinePlugin/branches/1.3-2.0/lib/task/sfDoctrineVersionTask.class.php
2010-04-19 13:25:45 UTC (rev 29205)
@@ -44,6 +44,6 @@
*/
protected function execute($arguments = array(), $options = array())
{
- $this->callDoctrineCli('Orm:version');
+ $this->callDoctrineCli('--version');
}
-}
\ No newline at end of file
+}
--
You received this message because you are subscribed to the Google Groups
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-svn?hl=en.