Author: fabien
Date: 2010-03-05 10:30:09 +0100 (Fri, 05 Mar 2010)
New Revision: 28387
Modified:
branches/2.0/src/Symfony/Framework/DoctrineBundle/Command/BuildDoctrineCommand.php
branches/2.0/src/Symfony/Framework/DoctrineBundle/Command/LoadDataFixturesDoctrineCommand.php
branches/2.0/src/Symfony/Framework/DoctrineBundle/DependencyInjection/DoctrineExtension.php
Log:
Merge branch 'master' of git://github.com/symfony/symfony
Modified:
branches/2.0/src/Symfony/Framework/DoctrineBundle/Command/BuildDoctrineCommand.php
===================================================================
---
branches/2.0/src/Symfony/Framework/DoctrineBundle/Command/BuildDoctrineCommand.php
2010-03-05 00:50:36 UTC (rev 28386)
+++
branches/2.0/src/Symfony/Framework/DoctrineBundle/Command/BuildDoctrineCommand.php
2010-03-05 09:30:09 UTC (rev 28387)
@@ -109,13 +109,13 @@
{
$dirOrFile = $input->getOption('and-load');
$this->runCommand('doctrine:load-data-fixtures',
- array('--dir_or_file' => $dirOrFile, '--append' => false)
+ array('--dir-or-file' => $dirOrFile, '--append' => false)
);
}
else if ($input->hasOption('and-append'))
{
$dirOrFile = $input->getOption('and-append');
- $this->runCommand('doctrine:load-data-fixtures', array('--dir_or_file'
=> $dirOrFile, '--append' => true));
+ $this->runCommand('doctrine:load-data-fixtures', array('--dir-or-file'
=> $dirOrFile, '--append' => true));
}
}
Modified:
branches/2.0/src/Symfony/Framework/DoctrineBundle/Command/LoadDataFixturesDoctrineCommand.php
===================================================================
---
branches/2.0/src/Symfony/Framework/DoctrineBundle/Command/LoadDataFixturesDoctrineCommand.php
2010-03-05 00:50:36 UTC (rev 28386)
+++
branches/2.0/src/Symfony/Framework/DoctrineBundle/Command/LoadDataFixturesDoctrineCommand.php
2010-03-05 09:30:09 UTC (rev 28387)
@@ -41,7 +41,7 @@
$this
->setName('doctrine:load-data-fixtures')
->setDescription('Load data fixtures to your database.')
- ->addOption('dir_or_file', null, InputOption::PARAMETER_OPTIONAL |
InputOption::PARAMETER_IS_ARRAY, 'The directory or file to load data fixtures
from.')
+ ->addOption('dir-or-file', null, InputOption::PARAMETER_OPTIONAL |
InputOption::PARAMETER_IS_ARRAY, 'The directory or file to load data fixtures
from.')
->addOption('append', null, InputOption::PARAMETER_OPTIONAL, 'Whether or
not to append the data fixtures.', false)
;
}
@@ -52,7 +52,7 @@
protected function execute(InputInterface $input, OutputInterface $output)
{
$defaultEm = $this->container->getDoctrine_ORM_EntityManagerService();
- $dirOrFile = $input->getOption('dir_or_file');
+ $dirOrFile = $input->getOption('dir-or-file');
if ($dirOrFile)
{
$paths = is_array($dirOrFile) ? $dirOrFile : array($dirOrFile);
Modified:
branches/2.0/src/Symfony/Framework/DoctrineBundle/DependencyInjection/DoctrineExtension.php
===================================================================
---
branches/2.0/src/Symfony/Framework/DoctrineBundle/DependencyInjection/DoctrineExtension.php
2010-03-05 00:50:36 UTC (rev 28386)
+++
branches/2.0/src/Symfony/Framework/DoctrineBundle/DependencyInjection/DoctrineExtension.php
2010-03-05 09:30:09 UTC (rev 28387)
@@ -200,6 +200,7 @@
$mappingDriverDef = new
Definition('Doctrine\ORM\Mapping\Driver\DriverChain');
$bundleEntityMappings = array();
$bundleDirs = $this->bundleDirs;
+ $aliasMap = array();
foreach ($this->bundles as $className)
{
$tmp = dirname(str_replace('\\', '/', $className));
@@ -208,29 +209,18 @@
if (isset($bundleDirs[$namespace]))
{
+ $type = false;
if (is_dir($dir =
$bundleDirs[$namespace].'/'.$class.'/Resources/config/doctrine/metadata'))
{
$type = $this->detectMappingType($dir);
}
- elseif (is_dir($dir =
$bundleDirs[$namespace].'/'.$class.'/Entities'))
+
+ if (is_dir($dir = $bundleDirs[$namespace].'/'.$class.'/Entities'))
{
$type = 'annotation';
- $reader = new \Doctrine\Common\Annotations\AnnotationReader();
- $reader->setDefaultAnnotationNamespace('Doctrine\\ORM\\Mapping\\');
- $annotationDriver = new
\Doctrine\ORM\Mapping\Driver\AnnotationDriver($reader, $dir);
- $classNames = $annotationDriver->getAllClassNames();
- foreach ($classNames as $className)
- {
- $alias = substr_replace($className, '', 0, strpos($className,
'\\') + 1);
- $alias = str_replace('\Entities\\', '\\', $alias);
- $ormConfigDef->addMethodCall('addEntityAlias', array($className,
$alias));
- }
+ $aliasMap[$class] = $namespace.'\\'.$class.'\\Entities';
}
- else
- {
- $type = false;
- }
if (false !== $type)
{
@@ -242,6 +232,7 @@
}
}
}
+ $ormConfigDef->addMethodCall('setEntityNamespaces', array($aliasMap));
$configuration->setDefinition('doctrine.orm.metadata_driver',
$mappingDriverDef);
--
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.